diff --git a/FCLauncher/src/main/jni/Android.mk b/FCLauncher/src/main/jni/Android.mk index 0a5c6a07..56022e1b 100644 --- a/FCLauncher/src/main/jni/Android.mk +++ b/FCLauncher/src/main/jni/Android.mk @@ -23,35 +23,6 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/fcl/include LOCAL_LDLIBS := -llog -ldl -landroid include $(BUILD_SHARED_LIBRARY) -include $(CLEAR_VARS) -LOCAL_MODULE := glfw -LOCAL_SHARED_LIBRARIES := fcl -LOCAL_SRC_FILES := glfw/context.c \ - glfw/init.c \ - glfw/input.c \ - glfw/monitor.c \ - glfw/vulkan.c \ - glfw/window.c \ - glfw/fcl_init.c \ - glfw/fcl_monitor.c \ - glfw/fcl_window.c \ - glfw/egl_context.c \ - glfw/osmesa_context.c \ - glfw/platform.c \ - glfw/posix_thread.c \ - glfw/posix_time.c \ - glfw/driver_helper.c \ - driver_helper/nsbypass.c -LOCAL_C_INCLUDES := $(LOCAL_PATH)/fcl/include \ - $(LOCAL_PATH)/glfw/include -LOCAL_CFLAGS := -Wall -LOCAL_LDLIBS := -llog -ldl -landroid -ifeq ($(TARGET_ARCH_ABI), arm64-v8a) -LOCAL_CFLAGS += -DADRENO_POSSIBLE -LOCAL_LDLIBS += -lEGL -lGLESv2 -endif -include $(BUILD_SHARED_LIBRARY) - #ifeq ($(TARGET_ARCH_ABI), arm64-v8a) include $(CLEAR_VARS) LOCAL_MODULE := linkerhook @@ -77,259 +48,4 @@ LOCAL_SHARED_LIBRARIES := fcl LOCAL_SRC_FILES := awt/awt_bridge.c include $(BUILD_SHARED_LIBRARY) -include $(CLEAR_VARS) -LOCAL_MODULE := libffi -LOCAL_SRC_FILES := lwjgl/libffi/$(TARGET_ARCH_ABI)/libffi.a -include $(PREBUILT_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := lwjgl -LOCAL_STATIC_LIBRARIES := libffi -LOCAL_SHARED_LIBRARIES := fcl -LOCAL_SRC_FILES := lwjgl/fcl_hook.c \ - lwjgl/common_tools.c \ - lwjgl/org_lwjgl_system_Callback.c \ - lwjgl/org_lwjgl_system_linux_DynamicLinkLoader.c \ - lwjgl/org_lwjgl_system_JNI.c \ - lwjgl/org_lwjgl_system_jni_JNINativeInterface.c \ - lwjgl/org_lwjgl_system_libc_LibCErrno.c \ - lwjgl/org_lwjgl_system_libc_LibCLocale.c \ - lwjgl/org_lwjgl_system_libc_LibCStdio.c \ - lwjgl/org_lwjgl_system_libc_LibCStdlib.c \ - lwjgl/org_lwjgl_system_libc_LibCString.c \ - lwjgl/org_lwjgl_system_libffi_FFICIF.c \ - lwjgl/org_lwjgl_system_libffi_FFIClosure.c \ - lwjgl/org_lwjgl_system_libffi_LibFFI.c \ - lwjgl/org_lwjgl_system_MemoryAccessJNI.c \ - lwjgl/org_lwjgl_system_MemoryUtil.c \ - lwjgl/org_lwjgl_system_SharedLibraryUtil.c \ - lwjgl/org_lwjgl_system_ThreadLocalUtil.c -LOCAL_C_INCLUDES := $(LOCAL_PATH)/lwjgl/libffi/$(TARGET_ARCH_ABI) -LOCAL_CFLAGS := -O2 -Wall -c -fPIC -std=c99 -Wunused -DLWJGL_FCL -Wunused-value -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := lwjgl_tinyfd -LOCAL_SRC_FILES := lwjgl/tinyfd/org_lwjgl_util_tinyfd_TinyFileDialogs.c \ - lwjgl/tinyfd/tinyfiledialogs.c -LOCAL_CFLAGS := -O2 -Wall -c -fPIC -std=c99 -Wunused -DLWJGL_FCL -Wunused-value -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := lwjgl_nanovg -LOCAL_SRC_FILES := lwjgl/nanovg/org_lwjgl_nanovg_Blendish.c \ - lwjgl/nanovg/org_lwjgl_nanovg_LibNanoVG.c \ - lwjgl/nanovg/org_lwjgl_nanovg_NanoSVG.c \ - lwjgl/nanovg/org_lwjgl_nanovg_NanoVG.c \ - lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGL2.c \ - lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGL3.c \ - lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGLES2.c \ - lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGLES3.c \ - lwjgl/nanovg/org_lwjgl_nanovg_OUI.c -LOCAL_CFLAGS := -O2 -Wall -c -fPIC -std=c99 -Wunused -DLWJGL_FCL -Wunused-value -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := lwjgl_stb -LOCAL_SRC_FILES := lwjgl/stb/org_lwjgl_stb_LibSTB.c \ - lwjgl/stb/org_lwjgl_stb_STBDXT.c \ - lwjgl/stb/org_lwjgl_stb_STBEasyFont.c \ - lwjgl/stb/org_lwjgl_stb_STBImage.c \ - lwjgl/stb/org_lwjgl_stb_STBImageResize.c \ - lwjgl/stb/org_lwjgl_stb_STBImageWrite.c \ - lwjgl/stb/org_lwjgl_stb_STBPerlin.c \ - lwjgl/stb/org_lwjgl_stb_STBRectPack.c \ - lwjgl/stb/org_lwjgl_stb_STBTruetype.c \ - lwjgl/stb/org_lwjgl_stb_STBTTFontinfo.c \ - lwjgl/stb/org_lwjgl_stb_STBVorbis.c -LOCAL_CFLAGS := -O2 -Wall -c -fPIC -std=c99 -Wunused -DLWJGL_FCL -Wunused-value -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := lwjgl_opengl -LOCAL_SRC_FILES := lwjgl/opengl/org_lwjgl_opengl_AMDDebugOutput.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDDrawBuffersBlend.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDFramebufferMultisampleAdvanced.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDInterleavedElements.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDOcclusionQueryEvent.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDPerformanceMonitor.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDSamplePositions.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDSparseTexture.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDStencilOperationExtended.c \ - lwjgl/opengl/org_lwjgl_opengl_AMDVertexShaderTessellator.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBBindlessTexture.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBBufferStorage.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBClearBufferObject.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBCLEvent.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBColorBufferFloat.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBComputeVariableGroupSize.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBDebugOutput.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBDrawBuffers.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBDrawBuffersBlend.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBDrawInstanced.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBES32Compatibility.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBFramebufferNoAttachments.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBGeometryShader4.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBGLSPIRV.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBGPUShaderFP64.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBGPUShaderInt64.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBImaging.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBIndirectParameters.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBInstancedArrays.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBMatrixPalette.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBMultisample.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBMultitexture.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBOcclusionQuery.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBParallelShaderCompile.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBPointParameters.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBRobustness.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBSampleLocations.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBSampleShading.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBShaderObjects.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBShadingLanguageInclude.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBSparseBuffer.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBSparseTexture.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBTextureBufferObject.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBTextureBufferRange.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBTextureCompression.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBTextureStorage.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBTextureStorageMultisample.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBTransposeMatrix.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBVertexAttrib64Bit.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBVertexAttribBinding.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBVertexBlend.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBVertexBufferObject.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBVertexProgram.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBVertexShader.c \ - lwjgl/opengl/org_lwjgl_opengl_ARBWindowPos.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTBindableUniform.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTBlendColor.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTBlendEquationSeparate.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTBlendFuncSeparate.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTBlendMinmax.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTCompiledVertexArray.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTDebugLabel.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTDebugMarker.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTDepthBoundsTest.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTDirectStateAccess.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTDrawBuffers2.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTDrawInstanced.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTEGLImageStorage.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTExternalBuffer.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferBlit.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferBlitLayers.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferMultisample.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferObject.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTGeometryShader4.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTGPUProgramParameters.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTGPUShader4.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObject.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObjectFD.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObjectWin32.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTPointParameters.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTPolygonOffsetClamp.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTProvokingVertex.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTRasterMultisample.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTSecondaryColor.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTSemaphore.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTSemaphoreFD.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTSemaphoreWin32.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTSeparateShaderObjects.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTShaderFramebufferFetchNonCoherent.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTShaderImageLoadStore.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTStencilClearTag.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTStencilTwoSide.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTTextureArray.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTTextureBufferObject.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTTextureInteger.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTTextureStorage.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTTimerQuery.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTTransformFeedback.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTVertexAttrib64bit.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTWin32KeyedMutex.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTWindowRectangles.c \ - lwjgl/opengl/org_lwjgl_opengl_EXTX11SyncObject.c \ - lwjgl/opengl/org_lwjgl_opengl_GL11.c \ - lwjgl/opengl/org_lwjgl_opengl_GL11C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL12C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL13.c \ - lwjgl/opengl/org_lwjgl_opengl_GL13C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL14.c \ - lwjgl/opengl/org_lwjgl_opengl_GL14C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL15C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL20C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL21C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL30C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL31C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL32C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL33.c \ - lwjgl/opengl/org_lwjgl_opengl_GL33C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL40C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL41C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL42C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL43C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL44C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL45.c \ - lwjgl/opengl/org_lwjgl_opengl_GL45C.c \ - lwjgl/opengl/org_lwjgl_opengl_GL46C.c \ - lwjgl/opengl/org_lwjgl_opengl_GREMEDYFrameTerminator.c \ - lwjgl/opengl/org_lwjgl_opengl_GREMEDYStringMarker.c \ - lwjgl/opengl/org_lwjgl_opengl_INTELFramebufferCMAA.c \ - lwjgl/opengl/org_lwjgl_opengl_INTELMapTexture.c \ - lwjgl/opengl/org_lwjgl_opengl_INTELPerformanceQuery.c \ - lwjgl/opengl/org_lwjgl_opengl_KHRBlendEquationAdvanced.c \ - lwjgl/opengl/org_lwjgl_opengl_KHRParallelShaderCompile.c \ - lwjgl/opengl/org_lwjgl_opengl_MESAFramebufferFlipY.c \ - lwjgl/opengl/org_lwjgl_opengl_NVAlphaToCoverageDitherControl.c \ - lwjgl/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirect.c \ - lwjgl/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirectCount.c \ - lwjgl/opengl/org_lwjgl_opengl_NVBindlessTexture.c \ - lwjgl/opengl/org_lwjgl_opengl_NVBlendEquationAdvanced.c \ - lwjgl/opengl/org_lwjgl_opengl_NVClipSpaceWScaling.c \ - lwjgl/opengl/org_lwjgl_opengl_NVCommandList.c \ - lwjgl/opengl/org_lwjgl_opengl_NVConditionalRender.c \ - lwjgl/opengl/org_lwjgl_opengl_NVConservativeRaster.c \ - lwjgl/opengl/org_lwjgl_opengl_NVConservativeRasterDilate.c \ - lwjgl/opengl/org_lwjgl_opengl_NVConservativeRasterPreSnapTriangles.c \ - lwjgl/opengl/org_lwjgl_opengl_NVCopyImage.c \ - lwjgl/opengl/org_lwjgl_opengl_NVDepthBufferFloat.c \ - lwjgl/opengl/org_lwjgl_opengl_NVDrawTexture.c \ - lwjgl/opengl/org_lwjgl_opengl_NVDrawVulkanImage.c \ - lwjgl/opengl/org_lwjgl_opengl_NVExplicitMultisample.c \ - lwjgl/opengl/org_lwjgl_opengl_NVFence.c \ - lwjgl/opengl/org_lwjgl_opengl_NVFragmentCoverageToColor.c \ - lwjgl/opengl/org_lwjgl_opengl_NVFramebufferMixedSamples.c \ - lwjgl/opengl/org_lwjgl_opengl_NVFramebufferMultisampleCoverage.c \ - lwjgl/opengl/org_lwjgl_opengl_NVGPUMulticast.c \ - lwjgl/opengl/org_lwjgl_opengl_NVGPUShader5.c \ - lwjgl/opengl/org_lwjgl_opengl_NVHalfFloat.c \ - lwjgl/opengl/org_lwjgl_opengl_NVInternalformatSampleQuery.c \ - lwjgl/opengl/org_lwjgl_opengl_NVMemoryAttachment.c \ - lwjgl/opengl/org_lwjgl_opengl_NVMemoryObjectSparse.c \ - lwjgl/opengl/org_lwjgl_opengl_NVMeshShader.c \ - lwjgl/opengl/org_lwjgl_opengl_NVPathRendering.c \ - lwjgl/opengl/org_lwjgl_opengl_NVPixelDataRange.c \ - lwjgl/opengl/org_lwjgl_opengl_NVPointSprite.c \ - lwjgl/opengl/org_lwjgl_opengl_NVPrimitiveRestart.c \ - lwjgl/opengl/org_lwjgl_opengl_NVQueryResource.c \ - lwjgl/opengl/org_lwjgl_opengl_NVQueryResourceTag.c \ - lwjgl/opengl/org_lwjgl_opengl_NVSampleLocations.c \ - lwjgl/opengl/org_lwjgl_opengl_NVScissorExclusive.c \ - lwjgl/opengl/org_lwjgl_opengl_NVShaderBufferLoad.c \ - lwjgl/opengl/org_lwjgl_opengl_NVShadingRateImage.c \ - lwjgl/opengl/org_lwjgl_opengl_NVTextureBarrier.c \ - lwjgl/opengl/org_lwjgl_opengl_NVTextureMultisample.c \ - lwjgl/opengl/org_lwjgl_opengl_NVTimelineSemaphore.c \ - lwjgl/opengl/org_lwjgl_opengl_NVTransformFeedback.c \ - lwjgl/opengl/org_lwjgl_opengl_NVTransformFeedback2.c \ - lwjgl/opengl/org_lwjgl_opengl_NVVertexArrayRange.c \ - lwjgl/opengl/org_lwjgl_opengl_NVVertexAttribInteger64bit.c \ - lwjgl/opengl/org_lwjgl_opengl_NVVertexBufferUnifiedMemory.c \ - lwjgl/opengl/org_lwjgl_opengl_NVViewportSwizzle.c \ - lwjgl/opengl/org_lwjgl_opengl_NVXConditionalRender.c \ - lwjgl/opengl/org_lwjgl_opengl_NVXGpuMulticast2.c \ - lwjgl/opengl/org_lwjgl_opengl_NVXProgressFence.c \ - lwjgl/opengl/org_lwjgl_opengl_OVRMultiview.c -LOCAL_CFLAGS := -O2 -Wall -c -fPIC -std=c99 -Wunused -DLWJGL_FCL -Wunused-value -include $(BUILD_SHARED_LIBRARY) $(call import-module,prefab/bytehook) \ No newline at end of file diff --git a/FCLauncher/src/main/jni/glfw/context.c b/FCLauncher/src/main/jni/glfw/context.c deleted file mode 100644 index f1a705e3..00000000 --- a/FCLauncher/src/main/jni/glfw/context.c +++ /dev/null @@ -1,565 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#include -#include -#include -#include -#include -#include "fcl_bridge.h" - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -// Checks whether the desired context attributes are valid -// -// This function checks things like whether the specified client API version -// exists and whether all relevant options have supported and non-conflicting -// values -// -GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) -{ - if (ctxconfig->share) - { - if (ctxconfig->client == GLFW_NO_API || - ctxconfig->share->context.client == GLFW_NO_API) - { - _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); - return GLFW_FALSE; - } - } - - if (ctxconfig->source != GLFW_NATIVE_CONTEXT_API && - ctxconfig->source != GLFW_EGL_CONTEXT_API && - ctxconfig->source != GLFW_OSMESA_CONTEXT_API) - { - _glfwInputError(GLFW_INVALID_ENUM, - "Invalid context creation API 0x%08X", - ctxconfig->source); - return GLFW_FALSE; - } - - if (ctxconfig->client != GLFW_NO_API && - ctxconfig->client != GLFW_OPENGL_API && - ctxconfig->client != GLFW_OPENGL_ES_API) - { - _glfwInputError(GLFW_INVALID_ENUM, - "Invalid client API 0x%08X", - ctxconfig->client); - return GLFW_FALSE; - } - - if (ctxconfig->client == GLFW_OPENGL_API) - { - if ((ctxconfig->major < 1 || ctxconfig->minor < 0) || - (ctxconfig->major == 1 && ctxconfig->minor > 5) || - (ctxconfig->major == 2 && ctxconfig->minor > 1) || - (ctxconfig->major == 3 && ctxconfig->minor > 3)) - { - // OpenGL 1.0 is the smallest valid version - // OpenGL 1.x series ended with version 1.5 - // OpenGL 2.x series ended with version 2.1 - // OpenGL 3.x series ended with version 3.3 - // For now, let everything else through - - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid OpenGL version %i.%i", - ctxconfig->major, ctxconfig->minor); - return GLFW_FALSE; - } - - if (ctxconfig->profile) - { - if (ctxconfig->profile != GLFW_OPENGL_CORE_PROFILE && - ctxconfig->profile != GLFW_OPENGL_COMPAT_PROFILE) - { - _glfwInputError(GLFW_INVALID_ENUM, - "Invalid OpenGL profile 0x%08X", - ctxconfig->profile); - return GLFW_FALSE; - } - - if (ctxconfig->major <= 2 || - (ctxconfig->major == 3 && ctxconfig->minor < 2)) - { - // Desktop OpenGL context profiles are only defined for version 3.2 - // and above - - _glfwInputError(GLFW_INVALID_VALUE, - "Context profiles are only defined for OpenGL version 3.2 and above"); - return GLFW_FALSE; - } - } - - if (ctxconfig->forward && ctxconfig->major <= 2) - { - // Forward-compatible contexts are only defined for OpenGL version 3.0 and above - _glfwInputError(GLFW_INVALID_VALUE, - "Forward-compatibility is only defined for OpenGL version 3.0 and above"); - return GLFW_FALSE; - } - } - else if (ctxconfig->client == GLFW_OPENGL_ES_API) - { - if (ctxconfig->major < 1 || ctxconfig->minor < 0 || - (ctxconfig->major == 1 && ctxconfig->minor > 1) || - (ctxconfig->major == 2 && ctxconfig->minor > 0)) - { - // OpenGL ES 1.0 is the smallest valid version - // OpenGL ES 1.x series ended with version 1.1 - // OpenGL ES 2.x series ended with version 2.0 - // For now, let everything else through - - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid OpenGL ES version %i.%i", - ctxconfig->major, ctxconfig->minor); - return GLFW_FALSE; - } - } - - if (ctxconfig->robustness) - { - if (ctxconfig->robustness != GLFW_NO_RESET_NOTIFICATION && - ctxconfig->robustness != GLFW_LOSE_CONTEXT_ON_RESET) - { - _glfwInputError(GLFW_INVALID_ENUM, - "Invalid context robustness mode 0x%08X", - ctxconfig->robustness); - return GLFW_FALSE; - } - } - - if (ctxconfig->release) - { - if (ctxconfig->release != GLFW_RELEASE_BEHAVIOR_NONE && - ctxconfig->release != GLFW_RELEASE_BEHAVIOR_FLUSH) - { - _glfwInputError(GLFW_INVALID_ENUM, - "Invalid context release behavior 0x%08X", - ctxconfig->release); - return GLFW_FALSE; - } - } - - return GLFW_TRUE; -} - -// Retrieves the attributes of the current context -// -GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig) -{ - int i; - _GLFWwindow* previous; - const char* version; - const char* prefixes[] = - { - "OpenGL ES-CM ", - "OpenGL ES-CL ", - "OpenGL ES ", - NULL - }; - - window->context.source = ctxconfig->source; - window->context.client = GLFW_OPENGL_API; - - previous = _glfwPlatformGetTls(&_glfw.contextSlot); - glfwMakeContextCurrent((GLFWwindow*) window); - - window->context.GetIntegerv = (PFNGLGETINTEGERVPROC) - window->context.getProcAddress("glGetIntegerv"); - window->context.GetString = (PFNGLGETSTRINGPROC) - window->context.getProcAddress("glGetString"); - if (!window->context.GetIntegerv || !window->context.GetString) - { - _glfwInputError(GLFW_PLATFORM_ERROR, "Entry point retrieval is broken"); - glfwMakeContextCurrent((GLFWwindow*) previous); - return GLFW_FALSE; - } - - version = (const char*) window->context.GetString(GL_VERSION); - if (!version) - { - if (ctxconfig->client == GLFW_OPENGL_API) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "OpenGL version string retrieval is broken"); - } - else - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "OpenGL ES version string retrieval is broken"); - } - - glfwMakeContextCurrent((GLFWwindow*) previous); - return GLFW_FALSE; - } - - for (i = 0; prefixes[i]; i++) - { - const size_t length = strlen(prefixes[i]); - - if (strncmp(version, prefixes[i], length) == 0) - { - version += length; - window->context.client = GLFW_OPENGL_ES_API; - break; - } - } - - if (!sscanf(version, "%d.%d.%d", - &window->context.major, - &window->context.minor, - &window->context.revision)) - { - if (window->context.client == GLFW_OPENGL_API) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "No version found in OpenGL version string"); - } - else - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "No version found in OpenGL ES version string"); - } - - glfwMakeContextCurrent((GLFWwindow*) previous); - return GLFW_FALSE; - } - - if (window->context.major >= 3) - { - // OpenGL 3.0+ uses a different function for extension string retrieval - // We cache it here instead of in glfwExtensionSupported mostly to alert - // users as early as possible that their build may be broken - - window->context.GetStringi = (PFNGLGETSTRINGIPROC) - window->context.getProcAddress("glGetStringi"); - if (!window->context.GetStringi) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Entry point retrieval is broken"); - glfwMakeContextCurrent((GLFWwindow*) previous); - return GLFW_FALSE; - } - } - - if (window->context.client == GLFW_OPENGL_API) - { - // Read back context flags (OpenGL 3.0 and above) - if (window->context.major >= 3) - { - GLint flags; - window->context.GetIntegerv(GL_CONTEXT_FLAGS, &flags); - - if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) - window->context.forward = GLFW_TRUE; - - if (flags & GL_CONTEXT_FLAG_DEBUG_BIT) - window->context.debug = GLFW_TRUE; - else if (glfwExtensionSupported("GL_ARB_debug_output") && - ctxconfig->debug) - { - // HACK: This is a workaround for older drivers (pre KHR_debug) - // not setting the debug bit in the context flags for - // debug contexts - window->context.debug = GLFW_TRUE; - } - - if (flags & GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR) - window->context.noerror = GLFW_TRUE; - } - - // Read back OpenGL context profile (OpenGL 3.2 and above) - if (window->context.major >= 4 || - (window->context.major == 3 && window->context.minor >= 2)) - { - GLint mask; - window->context.GetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask); - - if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) - window->context.profile = GLFW_OPENGL_COMPAT_PROFILE; - else if (mask & GL_CONTEXT_CORE_PROFILE_BIT) - window->context.profile = GLFW_OPENGL_CORE_PROFILE; - else if (glfwExtensionSupported("GL_ARB_compatibility")) - { - // HACK: This is a workaround for the compatibility profile bit - // not being set in the context flags if an OpenGL 3.2+ - // context was created without having requested a specific - // version - window->context.profile = GLFW_OPENGL_COMPAT_PROFILE; - } - } - - // Read back robustness strategy - if (glfwExtensionSupported("GL_ARB_robustness")) - { - // NOTE: We avoid using the context flags for detection, as they are - // only present from 3.0 while the extension applies from 1.1 - - GLint strategy; - window->context.GetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, - &strategy); - - if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB) - window->context.robustness = GLFW_LOSE_CONTEXT_ON_RESET; - else if (strategy == GL_NO_RESET_NOTIFICATION_ARB) - window->context.robustness = GLFW_NO_RESET_NOTIFICATION; - } - } - else - { - // Read back robustness strategy - if (glfwExtensionSupported("GL_EXT_robustness")) - { - // NOTE: The values of these constants match those of the OpenGL ARB - // one, so we can reuse them here - - GLint strategy; - window->context.GetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, - &strategy); - - if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB) - window->context.robustness = GLFW_LOSE_CONTEXT_ON_RESET; - else if (strategy == GL_NO_RESET_NOTIFICATION_ARB) - window->context.robustness = GLFW_NO_RESET_NOTIFICATION; - } - } - - if (glfwExtensionSupported("GL_KHR_context_flush_control")) - { - GLint behavior; - window->context.GetIntegerv(GL_CONTEXT_RELEASE_BEHAVIOR, &behavior); - - if (behavior == GL_NONE) - window->context.release = GLFW_RELEASE_BEHAVIOR_NONE; - else if (behavior == GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH) - window->context.release = GLFW_RELEASE_BEHAVIOR_FLUSH; - } - - // Clearing the front buffer to black to avoid garbage pixels left over from - // previous uses of our bit of VRAM - { - PFNGLCLEARPROC glClear = (PFNGLCLEARPROC) - window->context.getProcAddress("glClear"); - glClear(GL_COLOR_BUFFER_BIT); - - if (window->doublebuffer) - window->context.swapBuffers(window); - } - - glfwMakeContextCurrent((GLFWwindow*) previous); - return GLFW_TRUE; -} - -// Searches an extension string for the specified extension -// -GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions) -{ - const char* start = extensions; - - for (;;) - { - const char* where; - const char* terminator; - - where = strstr(start, string); - if (!where) - return GLFW_FALSE; - - terminator = where + strlen(string); - if (where == start || *(where - 1) == ' ') - { - if (*terminator == ' ' || *terminator == '\0') - break; - } - - start = terminator; - } - - return GLFW_TRUE; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW public API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI int glfwGetOSMesaWidth() { - struct ANativeWindow* window = fclGetNativeWindow(); - return ANativeWindow_getWidth(window); -} - -GLFWAPI int glfwGetOSMesaHeight() { - struct ANativeWindow* window = fclGetNativeWindow(); - return ANativeWindow_getHeight(window); -} - -GLFWAPI void* glfwGetOSMesaCurrentContext() { - if (!_glfw.osmesa.GetCurrentContext) - { - _glfwInputError(GLFW_PLATFORM_ERROR, "OSMesa: Failed to load required entry points"); - _glfwTerminateOSMesa(); - return GLFW_FALSE; - } - return OSMesaGetCurrentContext(); -} - -GLFWAPI long glfwGetGraphicBuffersAddr(GLFWwindow* handle) { - _GLFWwindow* window = (_GLFWwindow*) handle; - return &window->context.osmesa.buffer; -} - -GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFWwindow* previous = _glfwPlatformGetTls(&_glfw.contextSlot); - - _GLFW_REQUIRE_INIT(); - - if (window && window->context.client == GLFW_NO_API) - { - _glfwInputError(GLFW_NO_WINDOW_CONTEXT, - "Cannot make current with a window that has no OpenGL or OpenGL ES context"); - return; - } - - if (previous) - { - if (!window || window->context.source != previous->context.source) - previous->context.makeCurrent(NULL); - } - - if (window) - window->context.makeCurrent(window); -} - -GLFWAPI GLFWwindow* glfwGetCurrentContext(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return _glfwPlatformGetTls(&_glfw.contextSlot); -} - -GLFWAPI void glfwSwapBuffers(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - if (window->context.client == GLFW_NO_API) - { - _glfwInputError(GLFW_NO_WINDOW_CONTEXT, - "Cannot swap buffers of a window that has no OpenGL or OpenGL ES context"); - return; - } - - window->context.swapBuffers(window); -} - -GLFWAPI void glfwSwapInterval(int interval) -{ - _GLFWwindow* window; - - _GLFW_REQUIRE_INIT(); - - window = _glfwPlatformGetTls(&_glfw.contextSlot); - if (!window) - { - _glfwInputError(GLFW_NO_CURRENT_CONTEXT, - "Cannot set swap interval without a current OpenGL or OpenGL ES context"); - return; - } - - window->context.swapInterval(interval); -} - -GLFWAPI int glfwExtensionSupported(const char* extension) -{ - _GLFWwindow* window; - assert(extension != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE); - - window = _glfwPlatformGetTls(&_glfw.contextSlot); - if (!window) - { - _glfwInputError(GLFW_NO_CURRENT_CONTEXT, - "Cannot query extension without a current OpenGL or OpenGL ES context"); - return GLFW_FALSE; - } - - if (*extension == '\0') - { - _glfwInputError(GLFW_INVALID_VALUE, "Extension name cannot be an empty string"); - return GLFW_FALSE; - } - - if (window->context.major >= 3) - { - int i; - GLint count; - - // Check if extension is in the modern OpenGL extensions string list - - window->context.GetIntegerv(GL_NUM_EXTENSIONS, &count); - - for (i = 0; i < count; i++) - { - const char* en = (const char*) - window->context.GetStringi(GL_EXTENSIONS, i); - if (!en) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Extension string retrieval is broken"); - return GLFW_FALSE; - } - - if (strcmp(en, extension) == 0) - return GLFW_TRUE; - } - } - else - { - // Check if extension is in the old style OpenGL extensions string - - const char* extensions = (const char*) - window->context.GetString(GL_EXTENSIONS); - if (!extensions) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Extension string retrieval is broken"); - return GLFW_FALSE; - } - - if (_glfwStringInExtensionString(extension, extensions)) - return GLFW_TRUE; - } - - // Check if extension is in the platform-specific string - return window->context.extensionSupported(extension); -} - -GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname) -{ - _GLFWwindow* window; - assert(procname != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - window = _glfwPlatformGetTls(&_glfw.contextSlot); - if (!window) - { - _glfwInputError(GLFW_NO_CURRENT_CONTEXT, - "Cannot query entry point without a current OpenGL or OpenGL ES context"); - return NULL; - } - - return window->context.getProcAddress(procname); -} - diff --git a/FCLauncher/src/main/jni/glfw/driver_helper.c b/FCLauncher/src/main/jni/glfw/driver_helper.c deleted file mode 100644 index 4454807c..00000000 --- a/FCLauncher/src/main/jni/glfw/driver_helper.c +++ /dev/null @@ -1,80 +0,0 @@ -// -// Created by hanji on 2023/8/2. -// - -#include -#include -#include -#include -#include -#include -#include "driver_helper/nsbypass.h" -#include "gl/gl.h" - -//#define ADRENO_POSSIBLE -#ifdef ADRENO_POSSIBLE -//Checks if your graphics are Adreno. Returns true if your graphics are Adreno, false otherwise or if there was an error -bool checkAdrenoGraphics() { - EGLDisplay eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if(eglDisplay == EGL_NO_DISPLAY || eglInitialize(eglDisplay, NULL, NULL) != EGL_TRUE) return false; - EGLint egl_attributes[] = { EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 24, EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; - EGLint num_configs = 0; - if(eglChooseConfig(eglDisplay, egl_attributes, NULL, 0, &num_configs) != EGL_TRUE || num_configs == 0) { - eglTerminate(eglDisplay); - return false; - } - EGLConfig eglConfig; - eglChooseConfig(eglDisplay, egl_attributes, &eglConfig, 1, &num_configs); - const EGLint egl_context_attributes[] = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE }; - EGLContext context = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, egl_context_attributes); - if(context == EGL_NO_CONTEXT) { - eglTerminate(eglDisplay); - return false; - } - if(eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, context) != EGL_TRUE) { - eglDestroyContext(eglDisplay, context); - eglTerminate(eglDisplay); - } - const char* vendor = glGetString(GL_VENDOR); - const char* renderer = glGetString(GL_RENDERER); - bool is_adreno = false; - if(strcmp(vendor, "Qualcomm") == 0 && strstr(renderer, "Adreno") != NULL) { - is_adreno = true; // TODO: check for Turnip support - } - eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - eglDestroyContext(eglDisplay, context); - eglTerminate(eglDisplay); - return is_adreno; -} -void* load_turnip_vulkan() { - if(!checkAdrenoGraphics()) return NULL; - const char* native_dir = getenv("FCL_NATIVEDIR"); - const char* cache_dir = getenv("TMPDIR"); - if(!linker_ns_load(native_dir)) return NULL; - void* linkerhook = linker_ns_dlopen("liblinkerhook.so", RTLD_LOCAL | RTLD_NOW); - if(linkerhook == NULL) return NULL; - void* turnip_driver_handle = linker_ns_dlopen("libvulkan_freedreno.so", RTLD_LOCAL | RTLD_NOW); - if(turnip_driver_handle == NULL) { - printf("AdrenoSupp: Failed to load Turnip!\n%s\n", dlerror()); - dlclose(linkerhook); - return NULL; - } - void* dl_android = linker_ns_dlopen("libdl_android.so", RTLD_LOCAL | RTLD_LAZY); - if(dl_android == NULL) { - dlclose(linkerhook); - dlclose(turnip_driver_handle); - return NULL; - } - void* android_get_exported_namespace = dlsym(dl_android, "android_get_exported_namespace"); - void (*linkerhook_pass_handles)(void*, void*, void*) = dlsym(linkerhook, "app__pojav_linkerhook_pass_handles"); - if(linkerhook_pass_handles == NULL || android_get_exported_namespace == NULL) { - dlclose(dl_android); - dlclose(linkerhook); - dlclose(turnip_driver_handle); - return NULL; - } - linkerhook_pass_handles(turnip_driver_handle, android_dlopen_ext, android_get_exported_namespace); - void* libvulkan = linker_ns_dlopen_unique(cache_dir, "libvulkan.so", RTLD_LOCAL | RTLD_NOW); - return libvulkan; -} -#endif \ No newline at end of file diff --git a/FCLauncher/src/main/jni/glfw/egl_context.c b/FCLauncher/src/main/jni/glfw/egl_context.c deleted file mode 100644 index 7f612223..00000000 --- a/FCLauncher/src/main/jni/glfw/egl_context.c +++ /dev/null @@ -1,499 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#include -#include -#include -#include - - -// Return a description of the specified EGL error -// -static const char* getEGLErrorString(EGLint error) -{ - switch (error) - { - case EGL_SUCCESS: - return "Success"; - case EGL_NOT_INITIALIZED: - return "EGL is not or could not be initialized"; - case EGL_BAD_ACCESS: - return "EGL cannot access a requested resource"; - case EGL_BAD_ALLOC: - return "EGL failed to allocate resources for the requested operation"; - case EGL_BAD_ATTRIBUTE: - return "An unrecognized attribute or attribute value was passed in the attribute list"; - case EGL_BAD_CONTEXT: - return "An EGLContext argument does not name a valid EGL rendering context"; - case EGL_BAD_CONFIG: - return "An EGLConfig argument does not name a valid EGL frame buffer configuration"; - case EGL_BAD_CURRENT_SURFACE: - return "The current surface of the calling thread is a window, pixel buffer or pixmap that is no longer valid"; - case EGL_BAD_DISPLAY: - return "An EGLDisplay argument does not name a valid EGL display connection"; - case EGL_BAD_SURFACE: - return "An EGLSurface argument does not name a valid surface configured for GL rendering"; - case EGL_BAD_MATCH: - return "Arguments are inconsistent"; - case EGL_BAD_PARAMETER: - return "One or more argument values are invalid"; - case EGL_BAD_NATIVE_PIXMAP: - return "A NativePixmapType argument does not refer to a valid native pixmap"; - case EGL_BAD_NATIVE_WINDOW: - return "A NativeWindowType argument does not refer to a valid native window"; - case EGL_CONTEXT_LOST: - return "The application must destroy all contexts and reinitialise"; - default: - return "ERROR: UNKNOWN EGL ERROR"; - } -} - -static void makeContextCurrentEGL(_GLFWwindow* window) -{ - if (window) - { - if (!eglMakeCurrent(_glfw.egl.display, - window->context.egl.surface, - window->context.egl.surface, - window->context.egl.handle)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "EGL: Failed to make context current: %s", - getEGLErrorString(eglGetError())); - return; - } - } - else - { - if (!eglMakeCurrent(_glfw.egl.display, - EGL_NO_SURFACE, - EGL_NO_SURFACE, - EGL_NO_CONTEXT)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "EGL: Failed to clear current context: %s", - getEGLErrorString(eglGetError())); - return; - } - } - - _glfwPlatformSetTls(&_glfw.contextSlot, window); -} - -static void swapBuffersEGL(_GLFWwindow* window) -{ - if (window != _glfwPlatformGetTls(&_glfw.contextSlot)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "EGL: The context must be current on the calling thread when swapping buffers"); - return; - } - - eglSwapBuffers(_glfw.egl.display, window->context.egl.surface); -} - -static void swapIntervalEGL(int interval) -{ - eglSwapInterval(_glfw.egl.display, interval); -} - -static int extensionSupportedEGL(const char* extension) -{ - const char* extensions = eglQueryString(_glfw.egl.display, EGL_EXTENSIONS); - if (extensions) - { - if (_glfwStringInExtensionString(extension, extensions)) - return GLFW_TRUE; - } - - return GLFW_FALSE; -} - -static GLFWglproc getProcAddressEGL(const char* procname) -{ - _GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot); - - if (window->context.egl.client) - { - GLFWglproc proc = (GLFWglproc) _glfw_dlsym(window->context.egl.client, - procname); - if (proc) - return proc; - } - - return eglGetProcAddress(procname); -} - -static void destroyContextEGL(_GLFWwindow* window) -{ - { - if (window->context.egl.client) - { - _glfw_dlclose(window->context.egl.client); - window->context.egl.client = NULL; - } - } - - if (window->context.egl.surface) - { - eglDestroySurface(_glfw.egl.display, window->context.egl.surface); - window->context.egl.surface = EGL_NO_SURFACE; - } - - if (window->context.egl.handle) - { - eglDestroyContext(_glfw.egl.display, window->context.egl.handle); - window->context.egl.handle = EGL_NO_CONTEXT; - } -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -// Initialize EGL -// -GLFWbool _glfwInitEGL(void) -{ - int i; - const char* sonames[] = - { - getenv("LIBEGL_NAME") - }; - - if (_glfw.egl.handle) - return GLFW_TRUE; - - for (i = 0; sonames[i]; i++) - { - _glfw.egl.handle = _glfw_dlopen(sonames[i]); - if (_glfw.egl.handle) - break; - } - - if (!_glfw.egl.handle) - { - _glfwInputError(GLFW_API_UNAVAILABLE, "EGL: Library not found"); - return GLFW_FALSE; - } - - const char* lib = getenv("LIBGL_NAME"); - _glfw_dlopen(lib); - - _glfw.egl.prefix = (strncmp(sonames[i], "lib", 3) == 0); - - _glfw.egl.GetConfigAttrib = (PFN_eglGetConfigAttrib) - _glfw_dlsym(_glfw.egl.handle, "eglGetConfigAttrib"); - _glfw.egl.GetConfigs = (PFN_eglGetConfigs) - _glfw_dlsym(_glfw.egl.handle, "eglGetConfigs"); - _glfw.egl.ChooseConfig = (PFN_eglChooseConfig) - _glfw_dlsym(_glfw.egl.handle, "eglChooseConfig"); - _glfw.egl.GetDisplay = (PFN_eglGetDisplay) - _glfw_dlsym(_glfw.egl.handle, "eglGetDisplay"); - _glfw.egl.GetError = (PFN_eglGetError) - _glfw_dlsym(_glfw.egl.handle, "eglGetError"); - _glfw.egl.Initialize = (PFN_eglInitialize) - _glfw_dlsym(_glfw.egl.handle, "eglInitialize"); - _glfw.egl.Terminate = (PFN_eglTerminate) - _glfw_dlsym(_glfw.egl.handle, "eglTerminate"); - _glfw.egl.BindAPI = (PFN_eglBindAPI) - _glfw_dlsym(_glfw.egl.handle, "eglBindAPI"); - _glfw.egl.CreateContext = (PFN_eglCreateContext) - _glfw_dlsym(_glfw.egl.handle, "eglCreateContext"); - _glfw.egl.DestroySurface = (PFN_eglDestroySurface) - _glfw_dlsym(_glfw.egl.handle, "eglDestroySurface"); - _glfw.egl.DestroyContext = (PFN_eglDestroyContext) - _glfw_dlsym(_glfw.egl.handle, "eglDestroyContext"); - _glfw.egl.CreateWindowSurface = (PFN_eglCreateWindowSurface) - _glfw_dlsym(_glfw.egl.handle, "eglCreateWindowSurface"); - _glfw.egl.MakeCurrent = (PFN_eglMakeCurrent) - _glfw_dlsym(_glfw.egl.handle, "eglMakeCurrent"); - _glfw.egl.SwapBuffers = (PFN_eglSwapBuffers) - _glfw_dlsym(_glfw.egl.handle, "eglSwapBuffers"); - _glfw.egl.SwapInterval = (PFN_eglSwapInterval) - _glfw_dlsym(_glfw.egl.handle, "eglSwapInterval"); - _glfw.egl.QueryString = (PFN_eglQueryString) - _glfw_dlsym(_glfw.egl.handle, "eglQueryString"); - _glfw.egl.GetProcAddress = (PFN_eglGetProcAddress) - _glfw_dlsym(_glfw.egl.handle, "eglGetProcAddress"); - - if (!_glfw.egl.GetConfigAttrib || - !_glfw.egl.GetConfigs || - !_glfw.egl.GetDisplay || - !_glfw.egl.GetError || - !_glfw.egl.Initialize || - !_glfw.egl.Terminate || - !_glfw.egl.BindAPI || - !_glfw.egl.CreateContext || - !_glfw.egl.DestroySurface || - !_glfw.egl.DestroyContext || - !_glfw.egl.CreateWindowSurface || - !_glfw.egl.MakeCurrent || - !_glfw.egl.SwapBuffers || - !_glfw.egl.SwapInterval || - !_glfw.egl.QueryString || - !_glfw.egl.GetProcAddress) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "EGL: Failed to load required entry points"); - - _glfwTerminateEGL(); - return GLFW_FALSE; - } - - _glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY); - if (_glfw.egl.display == EGL_NO_DISPLAY) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "EGL: Failed to get EGL display: %s", - getEGLErrorString(eglGetError())); - - _glfwTerminateEGL(); - return GLFW_FALSE; - } - - if (!eglInitialize(_glfw.egl.display, &_glfw.egl.major, &_glfw.egl.minor)) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "EGL: Failed to initialize EGL: %s", - getEGLErrorString(eglGetError())); - - _glfwTerminateEGL(); - return GLFW_FALSE; - } - - _glfw.egl.KHR_create_context = - extensionSupportedEGL("EGL_KHR_create_context"); - _glfw.egl.KHR_create_context_no_error = - extensionSupportedEGL("EGL_KHR_create_context_no_error"); - _glfw.egl.KHR_gl_colorspace = - extensionSupportedEGL("EGL_KHR_gl_colorspace"); - _glfw.egl.KHR_get_all_proc_addresses = - extensionSupportedEGL("EGL_KHR_get_all_proc_addresses"); - _glfw.egl.KHR_context_flush_control = - extensionSupportedEGL("EGL_KHR_context_flush_control"); - - return GLFW_TRUE; -} - -// Terminate EGL -// -void _glfwTerminateEGL(void) -{ - if (_glfw.egl.display) - { - eglTerminate(_glfw.egl.display); - _glfw.egl.display = EGL_NO_DISPLAY; - } - - if (_glfw.egl.handle) - { - _glfw_dlclose(_glfw.egl.handle); - _glfw.egl.handle = NULL; - } -} - - -// Create the OpenGL or OpenGL ES context -// -GLFWbool _glfwCreateContextEGL(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig) -{ - EGLConfig config = malloc(sizeof(EGLConfig)); - EGLContext share = NULL; - - if (!_glfw.egl.display) - { - _glfwInputError(GLFW_API_UNAVAILABLE, "EGL: API not available"); - return GLFW_FALSE; - } - - if (ctxconfig->share) - share = ctxconfig->share->context.egl.handle; - - EGLint egl_attributes[] = { - EGL_BLUE_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_RED_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 24, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT|0x0001, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_NONE - }; - EGLint num_configs = 0; - int libgl_es = strtol(getenv("LIBGL_ES"), NULL, 0); - if (libgl_es < 0 || libgl_es > INT16_MAX) - libgl_es = 2; - const EGLint egl_context_attributes[] = { EGL_CONTEXT_CLIENT_VERSION, libgl_es, EGL_NONE }; - if (eglChooseConfig(_glfw.egl.display, egl_attributes, NULL, 0, &num_configs) != GLFW_TRUE) { - _glfwInputError(GLFW_API_UNAVAILABLE, "eglChooseConfig() failed: %04x", - eglGetError()); - return GLFW_FALSE; - } - - if (num_configs == 0) { - _glfwInputError(GLFW_API_UNAVAILABLE, "%s", - "eglChooseConfig() found no matching config"); - return GLFW_FALSE; - } - - eglChooseConfig(_glfw.egl.display, egl_attributes, &config, 1, &num_configs); - int client = 0; - const char* renderer = getenv("LIBGL_NAME"); - if (strcmp(renderer, "libgl4es_114.so") == 0) { - client = 0; - } else if (strcmp(renderer, "libtinywrapper.so") == 0) { - client = 1; - } - - if (client == 0) - { - if (!eglBindAPI(EGL_OPENGL_ES_API)) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "EGL: Failed to bind OpenGL ES: %s", - getEGLErrorString(eglGetError())); - return GLFW_FALSE; - } - } - else - { - if (!eglBindAPI(EGL_OPENGL_API)) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "EGL: Failed to bind OpenGL: %s", - getEGLErrorString(eglGetError())); - return GLFW_FALSE; - } - } - - window->context.egl.handle = eglCreateContext(_glfw.egl.display, - config, share, egl_context_attributes); - - if (window->context.egl.handle == EGL_NO_CONTEXT) - { - _glfwInputError(GLFW_VERSION_UNAVAILABLE, - "EGL: Failed to create context: %s", - getEGLErrorString(eglGetError())); - return GLFW_FALSE; - } - - window->context.egl.surface = - eglCreateWindowSurface(_glfw.egl.display, - config, - _GLFW_EGL_NATIVE_WINDOW, - NULL); - if (window->context.egl.surface == EGL_NO_SURFACE) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "EGL: Failed to create window surface: %s", - getEGLErrorString(eglGetError())); - return GLFW_FALSE; - } - window->context.egl.config = config; - - // Load the appropriate client library - if (!_glfw.egl.KHR_get_all_proc_addresses) - { - int i; - const char** sonames; - const char* es1sonames[] = - { - "libGLESv1_CM.so.1", - "libGLES_CM.so.1", - }; - const char* es2sonames[] = - { - "libGLESv2.so.2", - }; - const char* glsonames[] = - { - getenv("LIBGL_NAME"), - }; - - if (ctxconfig->client == GLFW_OPENGL_ES_API) - { - if (ctxconfig->major == 1) - sonames = es1sonames; - else - sonames = es2sonames; - } - else - sonames = glsonames; - - for (i = 0; sonames[i]; i++) - { - // HACK: Match presence of lib prefix to increase chance of finding - // a matching pair in the jungle that is Win32 EGL/GLES - if (_glfw.egl.prefix != (strncmp(sonames[i], "lib", 3) == 0)) - continue; - - window->context.egl.client = _glfw_dlopen(sonames[i]); - if (window->context.egl.client) - break; - } - - if (!window->context.egl.client) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "EGL: Failed to load client library"); - return GLFW_FALSE; - } - } - - window->context.makeCurrent = makeContextCurrentEGL; - window->context.swapBuffers = swapBuffersEGL; - window->context.swapInterval = swapIntervalEGL; - window->context.extensionSupported = extensionSupportedEGL; - window->context.getProcAddress = getProcAddressEGL; - window->context.destroy = destroyContextEGL; - - return GLFW_TRUE; -} - - - -////////////////////////////////////////////////////////////////////////// -////// GLFW native API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI EGLDisplay glfwGetEGLDisplay(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_DISPLAY); - return _glfw.egl.display; -} - -GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_CONTEXT); - - if (window->context.client == GLFW_NO_API) - { - _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); - return EGL_NO_CONTEXT; - } - - return window->context.egl.handle; -} - -GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_SURFACE); - - if (window->context.client == GLFW_NO_API) - { - _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); - return EGL_NO_SURFACE; - } - - return window->context.egl.surface; -} - diff --git a/FCLauncher/src/main/jni/glfw/fcl_init.c b/FCLauncher/src/main/jni/glfw/fcl_init.c deleted file mode 100644 index 93a86f48..00000000 --- a/FCLauncher/src/main/jni/glfw/fcl_init.c +++ /dev/null @@ -1,260 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// -//======================================================================== -// This file is derived from x11_init.c -//======================================================================== - -#include - -#include - -#include -#include - - -// Create key code translation tables -// derived from wl_init.c -// -static void createKeyTables(void) -{ - int scancode; - - memset(_glfw.fcl.keycodes, -1, sizeof(_glfw.fcl.keycodes)); - memset(_glfw.fcl.scancodes, -1, sizeof(_glfw.fcl.scancodes)); - - _glfw.fcl.keycodes[KEY_GRAVE] = GLFW_KEY_GRAVE_ACCENT; - _glfw.fcl.keycodes[KEY_1] = GLFW_KEY_1; - _glfw.fcl.keycodes[KEY_2] = GLFW_KEY_2; - _glfw.fcl.keycodes[KEY_3] = GLFW_KEY_3; - _glfw.fcl.keycodes[KEY_4] = GLFW_KEY_4; - _glfw.fcl.keycodes[KEY_5] = GLFW_KEY_5; - _glfw.fcl.keycodes[KEY_6] = GLFW_KEY_6; - _glfw.fcl.keycodes[KEY_7] = GLFW_KEY_7; - _glfw.fcl.keycodes[KEY_8] = GLFW_KEY_8; - _glfw.fcl.keycodes[KEY_9] = GLFW_KEY_9; - _glfw.fcl.keycodes[KEY_0] = GLFW_KEY_0; - _glfw.fcl.keycodes[KEY_SPACE] = GLFW_KEY_SPACE; - _glfw.fcl.keycodes[KEY_MINUS] = GLFW_KEY_MINUS; - _glfw.fcl.keycodes[KEY_EQUAL] = GLFW_KEY_EQUAL; - _glfw.fcl.keycodes[KEY_Q] = GLFW_KEY_Q; - _glfw.fcl.keycodes[KEY_W] = GLFW_KEY_W; - _glfw.fcl.keycodes[KEY_E] = GLFW_KEY_E; - _glfw.fcl.keycodes[KEY_R] = GLFW_KEY_R; - _glfw.fcl.keycodes[KEY_T] = GLFW_KEY_T; - _glfw.fcl.keycodes[KEY_Y] = GLFW_KEY_Y; - _glfw.fcl.keycodes[KEY_U] = GLFW_KEY_U; - _glfw.fcl.keycodes[KEY_I] = GLFW_KEY_I; - _glfw.fcl.keycodes[KEY_O] = GLFW_KEY_O; - _glfw.fcl.keycodes[KEY_P] = GLFW_KEY_P; - _glfw.fcl.keycodes[KEY_LEFTBRACE] = GLFW_KEY_LEFT_BRACKET; - _glfw.fcl.keycodes[KEY_RIGHTBRACE] = GLFW_KEY_RIGHT_BRACKET; - _glfw.fcl.keycodes[KEY_A] = GLFW_KEY_A; - _glfw.fcl.keycodes[KEY_S] = GLFW_KEY_S; - _glfw.fcl.keycodes[KEY_D] = GLFW_KEY_D; - _glfw.fcl.keycodes[KEY_F] = GLFW_KEY_F; - _glfw.fcl.keycodes[KEY_G] = GLFW_KEY_G; - _glfw.fcl.keycodes[KEY_H] = GLFW_KEY_H; - _glfw.fcl.keycodes[KEY_J] = GLFW_KEY_J; - _glfw.fcl.keycodes[KEY_K] = GLFW_KEY_K; - _glfw.fcl.keycodes[KEY_L] = GLFW_KEY_L; - _glfw.fcl.keycodes[KEY_SEMICOLON] = GLFW_KEY_SEMICOLON; - _glfw.fcl.keycodes[KEY_APOSTROPHE] = GLFW_KEY_APOSTROPHE; - _glfw.fcl.keycodes[KEY_Z] = GLFW_KEY_Z; - _glfw.fcl.keycodes[KEY_X] = GLFW_KEY_X; - _glfw.fcl.keycodes[KEY_C] = GLFW_KEY_C; - _glfw.fcl.keycodes[KEY_V] = GLFW_KEY_V; - _glfw.fcl.keycodes[KEY_B] = GLFW_KEY_B; - _glfw.fcl.keycodes[KEY_N] = GLFW_KEY_N; - _glfw.fcl.keycodes[KEY_M] = GLFW_KEY_M; - _glfw.fcl.keycodes[KEY_COMMA] = GLFW_KEY_COMMA; - _glfw.fcl.keycodes[KEY_DOT] = GLFW_KEY_PERIOD; - _glfw.fcl.keycodes[KEY_SLASH] = GLFW_KEY_SLASH; - _glfw.fcl.keycodes[KEY_BACKSLASH] = GLFW_KEY_BACKSLASH; - _glfw.fcl.keycodes[KEY_ESC] = GLFW_KEY_ESCAPE; - _glfw.fcl.keycodes[KEY_TAB] = GLFW_KEY_TAB; - _glfw.fcl.keycodes[KEY_LEFTSHIFT] = GLFW_KEY_LEFT_SHIFT; - _glfw.fcl.keycodes[KEY_RIGHTSHIFT] = GLFW_KEY_RIGHT_SHIFT; - _glfw.fcl.keycodes[KEY_LEFTCTRL] = GLFW_KEY_LEFT_CONTROL; - _glfw.fcl.keycodes[KEY_RIGHTCTRL] = GLFW_KEY_RIGHT_CONTROL; - _glfw.fcl.keycodes[KEY_LEFTALT] = GLFW_KEY_LEFT_ALT; - _glfw.fcl.keycodes[KEY_RIGHTALT] = GLFW_KEY_RIGHT_ALT; - _glfw.fcl.keycodes[KEY_LEFTMETA] = GLFW_KEY_LEFT_SUPER; - _glfw.fcl.keycodes[KEY_RIGHTMETA] = GLFW_KEY_RIGHT_SUPER; - _glfw.fcl.keycodes[KEY_MENU] = GLFW_KEY_MENU; - _glfw.fcl.keycodes[KEY_NUMLOCK] = GLFW_KEY_NUM_LOCK; - _glfw.fcl.keycodes[KEY_CAPSLOCK] = GLFW_KEY_CAPS_LOCK; - _glfw.fcl.keycodes[KEY_PRINT] = GLFW_KEY_PRINT_SCREEN; - _glfw.fcl.keycodes[KEY_SCROLLLOCK] = GLFW_KEY_SCROLL_LOCK; - _glfw.fcl.keycodes[KEY_PAUSE] = GLFW_KEY_PAUSE; - _glfw.fcl.keycodes[KEY_DELETE] = GLFW_KEY_DELETE; - _glfw.fcl.keycodes[KEY_BACKSPACE] = GLFW_KEY_BACKSPACE; - _glfw.fcl.keycodes[KEY_ENTER] = GLFW_KEY_ENTER; - _glfw.fcl.keycodes[KEY_HOME] = GLFW_KEY_HOME; - _glfw.fcl.keycodes[KEY_END] = GLFW_KEY_END; - _glfw.fcl.keycodes[KEY_PAGEUP] = GLFW_KEY_PAGE_UP; - _glfw.fcl.keycodes[KEY_PAGEDOWN] = GLFW_KEY_PAGE_DOWN; - _glfw.fcl.keycodes[KEY_INSERT] = GLFW_KEY_INSERT; - _glfw.fcl.keycodes[KEY_LEFT] = GLFW_KEY_LEFT; - _glfw.fcl.keycodes[KEY_RIGHT] = GLFW_KEY_RIGHT; - _glfw.fcl.keycodes[KEY_DOWN] = GLFW_KEY_DOWN; - _glfw.fcl.keycodes[KEY_UP] = GLFW_KEY_UP; - _glfw.fcl.keycodes[KEY_F1] = GLFW_KEY_F1; - _glfw.fcl.keycodes[KEY_F2] = GLFW_KEY_F2; - _glfw.fcl.keycodes[KEY_F3] = GLFW_KEY_F3; - _glfw.fcl.keycodes[KEY_F4] = GLFW_KEY_F4; - _glfw.fcl.keycodes[KEY_F5] = GLFW_KEY_F5; - _glfw.fcl.keycodes[KEY_F6] = GLFW_KEY_F6; - _glfw.fcl.keycodes[KEY_F7] = GLFW_KEY_F7; - _glfw.fcl.keycodes[KEY_F8] = GLFW_KEY_F8; - _glfw.fcl.keycodes[KEY_F9] = GLFW_KEY_F9; - _glfw.fcl.keycodes[KEY_F10] = GLFW_KEY_F10; - _glfw.fcl.keycodes[KEY_F11] = GLFW_KEY_F11; - _glfw.fcl.keycodes[KEY_F12] = GLFW_KEY_F12; - _glfw.fcl.keycodes[KEY_F13] = GLFW_KEY_F13; - _glfw.fcl.keycodes[KEY_F14] = GLFW_KEY_F14; - _glfw.fcl.keycodes[KEY_F15] = GLFW_KEY_F15; - _glfw.fcl.keycodes[KEY_F16] = GLFW_KEY_F16; - _glfw.fcl.keycodes[KEY_F17] = GLFW_KEY_F17; - _glfw.fcl.keycodes[KEY_F18] = GLFW_KEY_F18; - _glfw.fcl.keycodes[KEY_F19] = GLFW_KEY_F19; - _glfw.fcl.keycodes[KEY_F20] = GLFW_KEY_F20; - _glfw.fcl.keycodes[KEY_F21] = GLFW_KEY_F21; - _glfw.fcl.keycodes[KEY_F22] = GLFW_KEY_F22; - _glfw.fcl.keycodes[KEY_F23] = GLFW_KEY_F23; - _glfw.fcl.keycodes[KEY_F24] = GLFW_KEY_F24; - _glfw.fcl.keycodes[KEY_KPSLASH] = GLFW_KEY_KP_DIVIDE; - _glfw.fcl.keycodes[KEY_KPASTERISK] = GLFW_KEY_KP_MULTIPLY; - _glfw.fcl.keycodes[KEY_KPMINUS] = GLFW_KEY_KP_SUBTRACT; - _glfw.fcl.keycodes[KEY_KPPLUS] = GLFW_KEY_KP_ADD; - _glfw.fcl.keycodes[KEY_KP0] = GLFW_KEY_KP_0; - _glfw.fcl.keycodes[KEY_KP1] = GLFW_KEY_KP_1; - _glfw.fcl.keycodes[KEY_KP2] = GLFW_KEY_KP_2; - _glfw.fcl.keycodes[KEY_KP3] = GLFW_KEY_KP_3; - _glfw.fcl.keycodes[KEY_KP4] = GLFW_KEY_KP_4; - _glfw.fcl.keycodes[KEY_KP5] = GLFW_KEY_KP_5; - _glfw.fcl.keycodes[KEY_KP6] = GLFW_KEY_KP_6; - _glfw.fcl.keycodes[KEY_KP7] = GLFW_KEY_KP_7; - _glfw.fcl.keycodes[KEY_KP8] = GLFW_KEY_KP_8; - _glfw.fcl.keycodes[KEY_KP9] = GLFW_KEY_KP_9; - _glfw.fcl.keycodes[KEY_KPEQUAL] = GLFW_KEY_KP_EQUAL; - _glfw.fcl.keycodes[KEY_KPENTER] = GLFW_KEY_KP_ENTER; - _glfw.fcl.keycodes[KEY_KPDOT] = GLFW_KEY_KP_DECIMAL; - - for (scancode = 0; scancode < 256; scancode++) - { - // Store the reverse translation for faster key name lookup - if (_glfw.fcl.keycodes[scancode] > 0) - _glfw.fcl.scancodes[_glfw.fcl.keycodes[scancode]] = scancode; - } - - strcpy(_glfw.fcl.keynames[GLFW_KEY_GRAVE_ACCENT], "`"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_1], "1"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_2], "2"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_3], "3"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_4], "4"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_5], "5"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_6], "6"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_7], "7"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_8], "8"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_9], "9"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_0], "0"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_MINUS], "-"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_EQUAL], "="); - strcpy(_glfw.fcl.keynames[GLFW_KEY_Q], "q"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_W], "w"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_E], "e"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_R], "r"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_T], "t"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_Y], "y"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_U], "u"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_I], "i"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_O], "o"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_P], "p"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_LEFT_BRACKET], "["); - strcpy(_glfw.fcl.keynames[GLFW_KEY_RIGHT_BRACKET], "]"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_A], "a"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_S], "s"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_D], "d"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_F], "f"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_G], "g"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_H], "h"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_J], "j"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_K], "k"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_L], "l"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_SEMICOLON], ";"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_APOSTROPHE], "'"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_Z], "z"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_X], "x"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_C], "c"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_V], "v"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_B], "b"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_N], "n"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_M], "m"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_COMMA], ","); - strcpy(_glfw.fcl.keynames[GLFW_KEY_PERIOD], "."); - strcpy(_glfw.fcl.keynames[GLFW_KEY_SLASH], "/"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_BACKSLASH], "\\"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_DIVIDE], "/"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_MULTIPLY], "*"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_ADD], "+"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_SUBTRACT], "-"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_0], "0"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_1], "1"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_2], "2"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_3], "3"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_4], "4"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_5], "5"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_6], "6"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_7], "7"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_8], "8"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_9], "9"); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_EQUAL], "="); - strcpy(_glfw.fcl.keynames[GLFW_KEY_KP_DECIMAL], "."); -} - -// Retrieve system content scale via folklore heuristics -// -static void getSystemContentScale(float* xscale, float* yscale) -{ - *xscale = 1.f; - *yscale = 1.f; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -int _glfwPlatformInit(void) -{ - getSystemContentScale(&_glfw.fcl.contentScaleX, &_glfw.fcl.contentScaleY); - createKeyTables(); - - _glfwInitTimerPOSIX(); - _glfwPollMonitorsFCL(); - return GLFW_TRUE; -} - -void _glfwPlatformTerminate(void) -{ - _glfwTerminateEGL(); -} - -const char* _glfwPlatformGetVersionString(void) -{ - return _GLFW_VERSION_NUMBER " FCL EGL OSMesa" -#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) - " clock_gettime" -#else - " gettimeofday" -#endif -#if defined(__linux__) - " evdev" -#endif -#if defined(_GLFW_BUILD_DLL) - " shared" -#endif - ; -} - diff --git a/FCLauncher/src/main/jni/glfw/fcl_monitor.c b/FCLauncher/src/main/jni/glfw/fcl_monitor.c deleted file mode 100644 index 338eeada..00000000 --- a/FCLauncher/src/main/jni/glfw/fcl_monitor.c +++ /dev/null @@ -1,123 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// -//======================================================================== -// This file is derived from x11_monitor.c -//======================================================================== - -#include - -#include -#include -#include - - -static void modeChangeHandle(int width, int height, void* data) -{ - GLFWvidmode mode; - _GLFWmonitor* monitor = data; - - mode.width = width; - mode.height = height; - mode.redBits = 8; - mode.greenBits = 8; - mode.blueBits = 8; - mode.refreshRate = 0; - - monitor->modeCount++; - monitor->modes = - realloc(monitor->modes, monitor->modeCount * sizeof(GLFWvidmode)); - monitor->modes[monitor->modeCount - 1] = mode; - - monitor->fcl.currentMode = monitor->modeCount - 1; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -void _glfwPollMonitorsFCL(void) -{ - struct ANativeWindow* window = fclGetNativeWindow(); - const float dpi = 141.f; - _GLFWmonitor* monitor = _glfwAllocMonitor("FCL Monitor 0", - (int) (ANativeWindow_getWidth(window) * 25.4f / dpi), - (int) (ANativeWindow_getHeight(window) * 25.4f / dpi)); - _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_FIRST); -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor) -{ -} - -void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) -{ - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; -} - -void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, - float* xscale, float* yscale) -{ - if (xscale) - *xscale = _glfw.fcl.contentScaleX; - if (yscale) - *yscale = _glfw.fcl.contentScaleY; -} - -void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height) -{ - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; - if (width) - *width = monitor->modes[monitor->fcl.currentMode].width; - if (height) - *height = monitor->modes[monitor->fcl.currentMode].height; -} - -GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count) -{ - if (monitor->modes == NULL || monitor->modeCount == 0) { - struct ANativeWindow* window = fclGetNativeWindow(); - modeChangeHandle(ANativeWindow_getWidth(window), - ANativeWindow_getHeight(window), - monitor); - } - *count = monitor->modeCount; - return monitor->modes; -} - -void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) -{ - if (monitor->modes == NULL || monitor->modeCount == 0) { - struct ANativeWindow* window = fclGetNativeWindow(); - modeChangeHandle(ANativeWindow_getWidth(window), - ANativeWindow_getHeight(window), - monitor); - } - *mode = monitor->modes[monitor->fcl.currentMode]; -} - -GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "FCL: Gamma ramp access not supported"); - return GLFW_FALSE; -} - -void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "FCL: Gamma ramp access not supported"); -} - diff --git a/FCLauncher/src/main/jni/glfw/fcl_window.c b/FCLauncher/src/main/jni/glfw/fcl_window.c deleted file mode 100644 index ccb978b8..00000000 --- a/FCLauncher/src/main/jni/glfw/fcl_window.c +++ /dev/null @@ -1,760 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// -//======================================================================== -// This file is derived from x11_window.c -//======================================================================== - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -// Translates an FCL event modifier state mask -// -static int translateState(int state) -{ - int mods = 0; - - if (state & ShiftMask) - mods |= GLFW_MOD_SHIFT; - if (state & ControlMask) - mods |= GLFW_MOD_CONTROL; - if (state & Mod1Mask) - mods |= GLFW_MOD_ALT; - if (state & Mod4Mask) - mods |= GLFW_MOD_SUPER; - if (state & LockMask) - mods |= GLFW_MOD_CAPS_LOCK; - if (state & Mod2Mask) - mods |= GLFW_MOD_NUM_LOCK; - - return mods; -} - -// Translates an FCL key code to a GLFW key token -// -static int translateKey(int scancode) -{ - // Use the pre-filled LUT (see createKeyTables() in fcl_init.c) - if (scancode < 0 || scancode > 255) - return GLFW_KEY_UNKNOWN; - - return _glfw.fcl.keycodes[scancode]; -} - -// Apply disabled cursor mode to a focused window -// -static void disableCursor(_GLFWwindow* window) -{ - _glfw.fcl.disabledCursorWindow = window; - _glfwPlatformGetCursorPos(window, - &_glfw.fcl.restoreCursorPosX, - &_glfw.fcl.restoreCursorPosY); - // updateCursorImage(window); - _glfwCenterCursorInContentArea(window); - fclSetCursorMode(CursorDisabled); -} - -// Exit disabled cursor mode for the specified window -// -static void enableCursor(_GLFWwindow* window) -{ - _glfw.fcl.disabledCursorWindow = NULL; - fclSetCursorMode(CursorEnabled); - _glfwPlatformSetCursorPos(window, - _glfw.fcl.restoreCursorPosX, - _glfw.fcl.restoreCursorPosY); - // updateCursorImage(window); -} - -// Get the ANativeWindow and peer infomation -// -static GLFWbool createNativeWindow(_GLFWwindow* window, - const _GLFWwndconfig* wndconfig) -{ - // window width and height requirements ignored - window->fcl.handle = fclGetNativeWindow(); - ANativeWindow_acquire(window->fcl.handle); - - if (!window->fcl.handle) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "FCL: Failed to get window"); - return GLFW_FALSE; - } - - _glfw.fcl.eventCurrent = window; - - if (!wndconfig->decorated) - _glfwPlatformSetWindowDecorated(window, GLFW_FALSE); - - window->fcl.maximized = GLFW_TRUE; - _glfwPlatformSetWindowTitle(window, wndconfig->title); - _glfwPlatformGetWindowPos(window, &window->fcl.xpos, &window->fcl.ypos); - _glfwPlatformGetWindowSize(window, &window->fcl.width, &window->fcl.height); - - return GLFW_TRUE; -} - -// Make the specified window and its video mode active on its monitor -// -static void acquireMonitor(_GLFWwindow* window) -{ - _glfwInputMonitorWindow(window->monitor, window); -} - -// Remove the window -// -static void releaseMonitor(_GLFWwindow* window) -{ - if (window->monitor->window != window) - return; - - _glfwInputMonitorWindow(window->monitor, NULL); -} - -// Process the specified FCL event -// -static void processEvent(FCLEvent *event) -{ - _GLFWwindow* window = _glfw.fcl.eventCurrent; - - switch (event->type) - { - case KeyPress: - { - const int keycode = event->keycode; - const int keychar = event->keychar; - const int key = translateKey(keycode); - const int mods = translateState(event->state); - const int plain = !(mods & (GLFW_MOD_CONTROL | GLFW_MOD_ALT)); - - _glfwInputKey(window, key, keycode, GLFW_PRESS, mods); - if (keychar) { - _glfwInputChar(window, keychar, mods, plain); - } - return; - } - - case KeyRelease: - { - const int keycode = event->keycode; - const int key = translateKey(keycode); - const int mods = translateState(event->state); - - _glfwInputKey(window, key, keycode, GLFW_RELEASE, mods); - return; - } - - case ButtonPress: - { - const int mods = translateState(event->state); - - if (event->button == Button1) - _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_LEFT, GLFW_PRESS, mods); - else if (event->button == Button2) - _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_MIDDLE, GLFW_PRESS, mods); - else if (event->button == Button3) - _glfwInputMouseClick(window, GLFW_MOUSE_BUTTON_RIGHT, GLFW_PRESS, mods); - - // Like X11, FCL provides scroll events as mouse button presses - else if (event->button == Button4) - _glfwInputScroll(window, 0.0, 1.0); - else if (event->button == Button5) - _glfwInputScroll(window, 0.0, -1.0); - else if (event->button == Button6) - _glfwInputScroll(window, 1.0, 0.0); - else if (event->button == Button7) - _glfwInputScroll(window, -1.0, 0.0); - - else - { - // Additional buttons after 7 are treated as regular buttons - // We subtract 4 to fill the gap left by scroll input above - _glfwInputMouseClick(window, - event->button - Button1 - 4, - GLFW_PRESS, - mods); - } - - return; - } - - case ButtonRelease: - { - const int mods = translateState(event->state); - - if (event->button == Button1) - { - _glfwInputMouseClick(window, - GLFW_MOUSE_BUTTON_LEFT, - GLFW_RELEASE, - mods); - } - else if (event->button == Button2) - { - _glfwInputMouseClick(window, - GLFW_MOUSE_BUTTON_MIDDLE, - GLFW_RELEASE, - mods); - } - else if (event->button == Button3) - { - _glfwInputMouseClick(window, - GLFW_MOUSE_BUTTON_RIGHT, - GLFW_RELEASE, - mods); - } - else if (event->button > Button7) - { - // Additional buttons after 7 are treated as regular buttons - // We subtract 4 to fill the gap left by scroll input above - _glfwInputMouseClick(window, - event->button - Button1 - 4, - GLFW_RELEASE, - mods); - } - - return; - } - - case MotionNotify: - { - const int x = event->x; - const int y = event->y; - - if (x != window->fcl.warpCursorPosX || - y != window->fcl.warpCursorPosY) - { - // The cursor was moved by something other than GLFW - - if (window->cursorMode == GLFW_CURSOR_DISABLED) - { - if (_glfw.fcl.disabledCursorWindow != window) - return; - if (window->rawMouseMotion) - return; - - const int dx = x - window->fcl.lastCursorPosX; - const int dy = y - window->fcl.lastCursorPosY; - - _glfwInputCursorPos(window, - window->virtualCursorPosX + dx, - window->virtualCursorPosY + dy); - } - else - _glfwInputCursorPos(window, x, y); - } - - window->fcl.lastCursorPosX = x; - window->fcl.lastCursorPosY = y; - return; - } - - case KeyChar: - { - const int keychar = event->keychar; - const int mods = translateState(event->state); - const int plain = !(mods & (GLFW_MOD_CONTROL | GLFW_MOD_ALT)); - - if (keychar) { - _glfwInputChar(window, keychar, mods, plain); - } - return; - } - - case ConfigureNotify: - { - const int width = event->width; - const int height = event->height; - if (width != window->fcl.width || - height != window->fcl.height) - { - _glfwInputFramebufferSize(window, - width, - height); - - _glfwInputWindowSize(window, - width, - height); - - window->fcl.width = width; - window->fcl.height = height; - } - - return; - } - - case FCLMessage: - { - if (event->message == CloseRequest) - { - // The FCL was asked to close the window, for - // example by the user pressing 'back' key - _glfwInputWindowCloseRequest(window); - } - } - } -} - -static void handleEvents(int timeout) -{ - if (fclWaitForEvent(timeout) == 0) { - return; - } - FCLEvent event; - while (fclPollEvent(&event)) - { - processEvent(&event); - if (fclWaitForEvent(0) == 0) { - break; - } - } -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -int _glfwPlatformCreateWindow(_GLFWwindow* window, - const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig) -{ - if (!createNativeWindow(window, wndconfig)) - return GLFW_FALSE; - - if (ctxconfig->client != GLFW_NO_API) - { - if (ctxconfig->source == GLFW_EGL_CONTEXT_API || - ctxconfig->source == GLFW_NATIVE_CONTEXT_API) - { - if (!_glfwInitEGL()) - return GLFW_FALSE; - if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig)) - return GLFW_FALSE; - } - else if (ctxconfig->source == GLFW_OSMESA_CONTEXT_API) - { - const char *renderer = getenv("LIBGL_STRING"); - if (strcmp(renderer, "Zink") == 0 || - strcmp(renderer, "Freedreno") == 0 || - strcmp(renderer, "VirGLRenderer") == 0) - { - if (!_glfwInitEGL()) - return GLFW_FALSE; - } - if (!_glfwInitOSMesa()) - return GLFW_FALSE; - if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig)) - return GLFW_FALSE; - } - } - - if (window->monitor) - { - _glfwPlatformShowWindow(window); - acquireMonitor(window); - } - - return GLFW_TRUE; -} - -void _glfwPlatformDestroyWindow(_GLFWwindow* window) -{ - if (_glfw.fcl.disabledCursorWindow == window) - _glfw.fcl.disabledCursorWindow = NULL; - - if (window->monitor) - releaseMonitor(window); - - if (window->context.destroy) - window->context.destroy(window); - - if (window->fcl.handle) - { - ANativeWindow_release(window->fcl.handle); - window->fcl.handle = NULL; - } -} - -void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) -{ -} - -void _glfwPlatformSetWindowIcon(_GLFWwindow* window, - int count, const GLFWimage* images) -{ -} - -void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) -{ - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; -} - -void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos) -{ -} - -void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) -{ - if (width) - *width = ANativeWindow_getWidth(window->fcl.handle); - if (height) - *height = ANativeWindow_getHeight(window->fcl.handle); -} - -void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) -{ - if (window->monitor) - { - if (window->monitor->window == window) - acquireMonitor(window); - } -} - -void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window, - int minwidth, int minheight, - int maxwidth, int maxheight) -{ -} - -void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom) -{ -} - -void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height) -{ - _glfwPlatformGetWindowSize(window, width, height); -} - -void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, - int* left, int* top, - int* right, int* bottom) -{ - if (left) - *left = 0; - if (top) - *top = 0; - if (right) - *right = 0; - if (bottom) - *bottom = 0; -} - -void _glfwPlatformGetWindowContentScale(_GLFWwindow* window, - float* xscale, float* yscale) -{ - if (xscale) - *xscale = _glfw.fcl.contentScaleX; - if (yscale) - *yscale = _glfw.fcl.contentScaleY; -} - -void _glfwPlatformIconifyWindow(_GLFWwindow* window) -{ -} - -void _glfwPlatformRestoreWindow(_GLFWwindow* window) -{ -} - -void _glfwPlatformMaximizeWindow(_GLFWwindow* window) -{ -} - -void _glfwPlatformShowWindow(_GLFWwindow* window) -{ -} - -void _glfwPlatformHideWindow(_GLFWwindow* window) -{ -} - -void _glfwPlatformRequestWindowAttention(_GLFWwindow* window) -{ -} - -void _glfwPlatformFocusWindow(_GLFWwindow* window) -{ -} - -void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, - _GLFWmonitor* monitor, - int xpos, int ypos, - int width, int height, - int refreshRate) -{ - // Are these codes meaningful? - if (window->monitor == monitor) - { - if (monitor) - { - if (monitor->window == window) - acquireMonitor(window); - } - - return; - } - - if (window->monitor) - { - _glfwPlatformSetWindowDecorated(window, window->decorated); - _glfwPlatformSetWindowFloating(window, window->floating); - releaseMonitor(window); - } - - _glfwInputWindowMonitor(window, monitor); - - if (window->monitor) - { - acquireMonitor(window); - } -} - -int _glfwPlatformWindowFocused(_GLFWwindow* window) -{ - return GLFW_TRUE; -} - -int _glfwPlatformWindowIconified(_GLFWwindow* window) -{ - return GLFW_FALSE; -} - -int _glfwPlatformWindowVisible(_GLFWwindow* window) -{ - return GLFW_TRUE; -} - -int _glfwPlatformWindowMaximized(_GLFWwindow* window) -{ - return GLFW_TRUE; -} - -int _glfwPlatformWindowHovered(_GLFWwindow* window) -{ - return GLFW_TRUE; -} - -int _glfwPlatformFramebufferTransparent(_GLFWwindow* window) -{ - return GLFW_FALSE; -} - -void _glfwPlatformSetWindowResizable(_GLFWwindow* window, GLFWbool enabled) -{ -} - -void _glfwPlatformSetWindowDecorated(_GLFWwindow* window, GLFWbool enabled) -{ -} - -void _glfwPlatformSetWindowFloating(_GLFWwindow* window, GLFWbool enabled) -{ -} - -float _glfwPlatformGetWindowOpacity(_GLFWwindow* window) -{ - return 1.f; -} - -void _glfwPlatformSetWindowOpacity(_GLFWwindow* window, float opacity) -{ -} - -void _glfwPlatformSetRawMouseMotion(_GLFWwindow *window, GLFWbool enabled) -{ -} - -GLFWbool _glfwPlatformRawMouseMotionSupported(void) -{ - return GLFW_FALSE; -} - -void _glfwPlatformPollEvents(void) -{ - handleEvents(0); -} - -void _glfwPlatformWaitEvents(void) -{ - handleEvents(-1); -} - -void _glfwPlatformWaitEventsTimeout(double timeout) -{ - handleEvents((int) (timeout * 1e3)); -} - -void _glfwPlatformPostEmptyEvent(void) -{ -} - -void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos) -{ - int x, y; - - // fclGetCursorPos(&x, &y); - x = 0; - y = 0; - - if (xpos) - *xpos = x; - if (ypos) - *ypos = y; -} - -void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y) -{ - // Store the new position so it can be recognized later - window->fcl.warpCursorPosX = (int) x; - window->fcl.warpCursorPosY = (int) y; - // fclSetCursorPos(x, y); -} - -void _glfwPlatformSetInjectorCallback(FCLinjectorfun callback) { - fclSetInjectorCallback(callback); -} - -void _glfwPlatformSetHitResultType(int type) { - fclSetHitResultType(type); -} - -void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode) -{ - if (mode == GLFW_CURSOR_DISABLED) - { - if (_glfwPlatformWindowFocused(window)) - disableCursor(window); - } - else if (_glfw.fcl.disabledCursorWindow == window) - enableCursor(window); - // else - // updateCursorImage(window); -} - -const char* _glfwPlatformGetScancodeName(int scancode) -{ - if (scancode < 0 || scancode > 0xff || - _glfw.fcl.keycodes[scancode] == GLFW_KEY_UNKNOWN) - { -// _glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode:%d",scancode); - return NULL; - } - - const int key = _glfw.fcl.keycodes[scancode]; - return _glfw.fcl.keynames[key]; -} - -int _glfwPlatformGetKeyScancode(int key) -{ - return _glfw.fcl.scancodes[key]; -} - -int _glfwPlatformCreateCursor(_GLFWcursor* cursor, - const GLFWimage* image, - int xhot, int yhot) -{ - return GLFW_TRUE; -} - -int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape) -{ - return GLFW_TRUE; -} - -void _glfwPlatformDestroyCursor(_GLFWcursor* cursor) -{ -} - -void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) -{ - if (window->cursorMode == GLFW_CURSOR_NORMAL) - { - // updateCursorImage(window); - } -} - -void _glfwPlatformSetClipboardString(const char* string) -{ - fclSetPrimaryClipString(string); -} - -const char* _glfwPlatformGetClipboardString(void) -{ - return fclGetPrimaryClipString(); -} - -void _glfwPlatformGetRequiredInstanceExtensions(char** extensions) -{ - if (!_glfw.vk.KHR_surface || !_glfw.vk.KHR_android_surface) - return; - - extensions[0] = "VK_KHR_surface"; - extensions[1] = "VK_KHR_android_surface"; -} - -int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, - VkPhysicalDevice device, - uint32_t queuefamily) -{ - return GLFW_FALSE; -} - -VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, - _GLFWwindow* window, - const VkAllocationCallbacks* allocator, - VkSurfaceKHR* surface) -{ - VkResult err; - VkAndroidSurfaceCreateInfoKHR sci; - PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR; - - vkCreateAndroidSurfaceKHR = (PFN_vkCreateAndroidSurfaceKHR) - vkGetInstanceProcAddr(instance, "vkCreateAndroidSurfaceKHR"); - if (!vkCreateAndroidSurfaceKHR) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "FCL: Vulkan instance missing VK_KHR_android_surface extension"); - return VK_ERROR_EXTENSION_NOT_PRESENT; - } - - memset(&sci, 0, sizeof(sci)); - sci.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; - sci.window = window->fcl.handle; - - err = vkCreateAndroidSurfaceKHR(instance, &sci, allocator, surface); - if (err) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "FCL: Failed to create Vulkan Android surface: %s", - _glfwGetVulkanResultString(err)); - } - - return err; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW native API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI struct ANativeWindow* glfwGetFCLWindow(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return window->fcl.handle; -} - diff --git a/FCLauncher/src/main/jni/glfw/include/egl_context.h b/FCLauncher/src/main/jni/glfw/include/egl_context.h deleted file mode 100644 index 84760fc9..00000000 --- a/FCLauncher/src/main/jni/glfw/include/egl_context.h +++ /dev/null @@ -1,173 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#define EGLAPIENTRY -typedef void* EGLNativeDisplayType; -typedef struct ANativeWindow* EGLNativeWindowType; - -#define EGL_SUCCESS 0x3000 -#define EGL_NOT_INITIALIZED 0x3001 -#define EGL_BAD_ACCESS 0x3002 -#define EGL_BAD_ALLOC 0x3003 -#define EGL_BAD_ATTRIBUTE 0x3004 -#define EGL_BAD_CONFIG 0x3005 -#define EGL_BAD_CONTEXT 0x3006 -#define EGL_BAD_CURRENT_SURFACE 0x3007 -#define EGL_BAD_DISPLAY 0x3008 -#define EGL_BAD_MATCH 0x3009 -#define EGL_BAD_NATIVE_PIXMAP 0x300a -#define EGL_BAD_NATIVE_WINDOW 0x300b -#define EGL_BAD_PARAMETER 0x300c -#define EGL_BAD_SURFACE 0x300d -#define EGL_CONTEXT_LOST 0x300e -#define EGL_COLOR_BUFFER_TYPE 0x303f -#define EGL_RGB_BUFFER 0x308e -#define EGL_SURFACE_TYPE 0x3033 -#define EGL_WINDOW_BIT 0x0004 -#define EGL_RENDERABLE_TYPE 0x3040 -#define EGL_OPENGL_ES_BIT 0x0001 -#define EGL_OPENGL_ES2_BIT 0x0004 -#define EGL_OPENGL_BIT 0x0008 -#define EGL_ALPHA_SIZE 0x3021 -#define EGL_BLUE_SIZE 0x3022 -#define EGL_GREEN_SIZE 0x3023 -#define EGL_RED_SIZE 0x3024 -#define EGL_DEPTH_SIZE 0x3025 -#define EGL_STENCIL_SIZE 0x3026 -#define EGL_SAMPLES 0x3031 -#define EGL_OPENGL_ES_API 0x30a0 -#define EGL_OPENGL_API 0x30a2 -#define EGL_NONE 0x3038 -#define EGL_RENDER_BUFFER 0x3086 -#define EGL_SINGLE_BUFFER 0x3085 -#define EGL_EXTENSIONS 0x3055 -#define EGL_CONTEXT_CLIENT_VERSION 0x3098 -#define EGL_NATIVE_VISUAL_ID 0x302e -#define EGL_NO_SURFACE ((EGLSurface) 0) -#define EGL_NO_DISPLAY ((EGLDisplay) 0) -#define EGL_NO_CONTEXT ((EGLContext) 0) -#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType) 0) - -#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 -#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 -#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31bd -#define EGL_NO_RESET_NOTIFICATION_KHR 0x31be -#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31bf -#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 -#define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098 -#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30fb -#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30fd -#define EGL_CONTEXT_FLAGS_KHR 0x30fc -#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31b3 -#define EGL_GL_COLORSPACE_KHR 0x309d -#define EGL_GL_COLORSPACE_SRGB_KHR 0x3089 -#define EGL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x2097 -#define EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR 0 -#define EGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x2098 - -typedef int EGLint; -typedef unsigned int EGLBoolean; -typedef unsigned int EGLenum; -typedef void* EGLConfig; -typedef void* EGLContext; -typedef void* EGLDisplay; -typedef void* EGLSurface; - -// EGL function pointer typedefs -typedef EGLBoolean (EGLAPIENTRY * PFN_eglGetConfigAttrib)(EGLDisplay,EGLConfig,EGLint,EGLint*); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglGetConfigs)(EGLDisplay,EGLConfig*,EGLint,EGLint*); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglChooseConfig)(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); -typedef EGLDisplay (EGLAPIENTRY * PFN_eglGetDisplay)(EGLNativeDisplayType); -typedef EGLint (EGLAPIENTRY * PFN_eglGetError)(void); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglInitialize)(EGLDisplay,EGLint*,EGLint*); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglTerminate)(EGLDisplay); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglBindAPI)(EGLenum); -typedef EGLContext (EGLAPIENTRY * PFN_eglCreateContext)(EGLDisplay,EGLConfig,EGLContext,const EGLint*); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglDestroySurface)(EGLDisplay,EGLSurface); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglDestroyContext)(EGLDisplay,EGLContext); -typedef EGLSurface (EGLAPIENTRY * PFN_eglCreateWindowSurface)(EGLDisplay,EGLConfig,EGLNativeWindowType,const EGLint*); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglMakeCurrent)(EGLDisplay,EGLSurface,EGLSurface,EGLContext); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglSwapBuffers)(EGLDisplay,EGLSurface); -typedef EGLBoolean (EGLAPIENTRY * PFN_eglSwapInterval)(EGLDisplay,EGLint); -typedef const char* (EGLAPIENTRY * PFN_eglQueryString)(EGLDisplay,EGLint); -typedef GLFWglproc (EGLAPIENTRY * PFN_eglGetProcAddress)(const char*); -#define eglGetConfigAttrib _glfw.egl.GetConfigAttrib -#define eglGetConfigs _glfw.egl.GetConfigs -#define eglChooseConfig _glfw.egl.ChooseConfig -#define eglGetDisplay _glfw.egl.GetDisplay -#define eglGetError _glfw.egl.GetError -#define eglInitialize _glfw.egl.Initialize -#define eglTerminate _glfw.egl.Terminate -#define eglBindAPI _glfw.egl.BindAPI -#define eglCreateContext _glfw.egl.CreateContext -#define eglDestroySurface _glfw.egl.DestroySurface -#define eglDestroyContext _glfw.egl.DestroyContext -#define eglCreateWindowSurface _glfw.egl.CreateWindowSurface -#define eglMakeCurrent _glfw.egl.MakeCurrent -#define eglSwapBuffers _glfw.egl.SwapBuffers -#define eglSwapInterval _glfw.egl.SwapInterval -#define eglQueryString _glfw.egl.QueryString -#define eglGetProcAddress _glfw.egl.GetProcAddress - -#define _GLFW_EGL_CONTEXT_STATE _GLFWcontextEGL egl -#define _GLFW_EGL_LIBRARY_CONTEXT_STATE _GLFWlibraryEGL egl - - -// EGL-specific per-context data -// -typedef struct _GLFWcontextEGL -{ - EGLConfig config; - EGLContext handle; - EGLSurface surface; - - void* client; - -} _GLFWcontextEGL; - -// EGL-specific global data -// -typedef struct _GLFWlibraryEGL -{ - EGLDisplay display; - EGLint major, minor; - GLFWbool prefix; - - GLFWbool KHR_create_context; - GLFWbool KHR_create_context_no_error; - GLFWbool KHR_gl_colorspace; - GLFWbool KHR_get_all_proc_addresses; - GLFWbool KHR_context_flush_control; - - void* handle; - - PFN_eglGetConfigAttrib GetConfigAttrib; - PFN_eglGetConfigs GetConfigs; - PFN_eglChooseConfig ChooseConfig; - PFN_eglGetDisplay GetDisplay; - PFN_eglGetError GetError; - PFN_eglInitialize Initialize; - PFN_eglTerminate Terminate; - PFN_eglBindAPI BindAPI; - PFN_eglCreateContext CreateContext; - PFN_eglDestroySurface DestroySurface; - PFN_eglDestroyContext DestroyContext; - PFN_eglCreateWindowSurface CreateWindowSurface; - PFN_eglMakeCurrent MakeCurrent; - PFN_eglSwapBuffers SwapBuffers; - PFN_eglSwapInterval SwapInterval; - PFN_eglQueryString QueryString; - PFN_eglGetProcAddress GetProcAddress; - -} _GLFWlibraryEGL; - - -GLFWbool _glfwInitEGL(void); -void _glfwTerminateEGL(void); -GLFWbool _glfwCreateContextEGL(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); - diff --git a/FCLauncher/src/main/jni/glfw/include/fcl_platform.h b/FCLauncher/src/main/jni/glfw/include/fcl_platform.h deleted file mode 100644 index 611a3169..00000000 --- a/FCLauncher/src/main/jni/glfw/include/fcl_platform.h +++ /dev/null @@ -1,112 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// -//======================================================================== -// This file is derived from x11_platform.h -//======================================================================== - -#include -#include -#include -#include - -#include - -typedef VkFlags VkAndroidSurfaceCreateFlagsKHR; - -typedef struct VkAndroidSurfaceCreateInfoKHR -{ - VkStructureType sType; - const void* pNext; - VkAndroidSurfaceCreateFlagsKHR flags; - struct ANativeWindow* window; -} VkAndroidSurfaceCreateInfoKHR; - -typedef VkResult (APIENTRY *PFN_vkCreateAndroidSurfaceKHR)(VkInstance, const VkAndroidSurfaceCreateInfoKHR*, const VkAllocationCallbacks*, VkSurfaceKHR*); - -#include "posix_thread.h" -#include "posix_time.h" -#include "egl_context.h" -#include "osmesa_context.h" - -#define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_GLOBAL) -#define _glfw_dlclose(handle) dlclose(handle) -#define _glfw_dlsym(handle, name) dlsym(handle, name) - -#define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->fcl.handle) -#define _GLFW_EGL_NATIVE_DISPLAY EGL_DEFAULT_DISPLAY - -#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowFCL fcl -#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryFCL fcl -#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorFCL fcl -#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorFCL fcl - -#define _GLFW_PLATFORM_CONTEXT_STATE struct { int dummyContext; } -#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE struct { int dummyLibraryContext; } - -// FCL-specific per-window data -// -typedef struct _GLFWwindowFCL -{ - struct ANativeWindow* handle; - - GLFWbool overrideRedirect; - GLFWbool iconified; - GLFWbool maximized; - - // Whether the visual supports framebuffer transparency - GLFWbool transparent; - - // Cached position and size used to filter out duplicate events - int width, height; - int xpos, ypos; - - // The last received cursor position, regardless of source - int lastCursorPosX, lastCursorPosY; - // The last position the cursor was warped to by GLFW - int warpCursorPosX, warpCursorPosY; - -} _GLFWwindowFCL; - -// FCL-specific global data -// -typedef struct _GLFWlibraryFCL -{ - // System content scale - float contentScaleX, contentScaleY; - // Key name string - char keynames[GLFW_KEY_LAST + 1][5]; - // FCL keycode to GLFW key LUT - short int keycodes[256]; - // GLFW key to FCL keycode LUT - short int scancodes[GLFW_KEY_LAST + 1]; - // Where to place the cursor when re-enabled - double restoreCursorPosX, restoreCursorPosY; - // The window whose disabled cursor mode is active - _GLFWwindow* disabledCursorWindow; - // The window receiving and processing events - _GLFWwindow* eventCurrent; - -} _GLFWlibraryFCL; - -// FCL-specific per-monitor data -// -typedef struct _GLFWmonitorFCL -{ - // Current monitor mode index - int currentMode; - -} _GLFWmonitorFCL; - -// FCL-specific per-cursor data -// -typedef struct _GLFWcursorFCL -{ - // Useless struct filler - void* handle; - -} _GLFWcursorFCL; - - -void _glfwPollMonitorsFCL(void); - diff --git a/FCLauncher/src/main/jni/glfw/include/glfw3.h b/FCLauncher/src/main/jni/glfw/include/glfw3.h deleted file mode 100644 index 66d00729..00000000 --- a/FCLauncher/src/main/jni/glfw/include/glfw3.h +++ /dev/null @@ -1,6136 +0,0 @@ -/************************************************************************* - * GLFW 3.3 - www.glfw.org - * A library for OpenGL, window and input - *------------------------------------------------------------------------ - * Copyright (c) 2002-2006 Marcus Geelnard - * Copyright (c) 2006-2019 Camilla Löwy - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would - * be appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not - * be misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. - * - *************************************************************************/ - -#ifndef _glfw3_h_ -#define _glfw3_h_ - -#ifdef __cplusplus -extern "C" { -#endif - - -/************************************************************************* - * Doxygen documentation - *************************************************************************/ - -/*! @file glfw3.h - * @brief The header of the GLFW 3 API. - * - * This is the header file of the GLFW 3 API. It defines all its types and - * declares all its functions. - * - * For more information about how to use this file, see @ref build_include. - */ -/*! @defgroup context Context reference - * @brief Functions and types related to OpenGL and OpenGL ES contexts. - * - * This is the reference documentation for OpenGL and OpenGL ES context related - * functions. For more task-oriented information, see the @ref context_guide. - */ -/*! @defgroup vulkan Vulkan support reference - * @brief Functions and types related to Vulkan. - * - * This is the reference documentation for Vulkan related functions and types. - * For more task-oriented information, see the @ref vulkan_guide. - */ -/*! @defgroup init Initialization, version and error reference - * @brief Functions and types related to initialization and error handling. - * - * This is the reference documentation for initialization and termination of - * the library, version management and error handling. For more task-oriented - * information, see the @ref intro_guide. - */ -/*! @defgroup input Input reference - * @brief Functions and types related to input handling. - * - * This is the reference documentation for input related functions and types. - * For more task-oriented information, see the @ref input_guide. - */ -/*! @defgroup monitor Monitor reference - * @brief Functions and types related to monitors. - * - * This is the reference documentation for monitor related functions and types. - * For more task-oriented information, see the @ref monitor_guide. - */ -/*! @defgroup window Window reference - * @brief Functions and types related to windows. - * - * This is the reference documentation for window related functions and types, - * including creation, deletion and event polling. For more task-oriented - * information, see the @ref window_guide. - */ - - -/************************************************************************* - * Compiler- and platform-specific preprocessor work - *************************************************************************/ - -/* If we are we on Windows, we want a single define for it. - */ -#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)) - #define _WIN32 -#endif /* _WIN32 */ - -/* Include because most Windows GLU headers need wchar_t and - * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h. - * Include it unconditionally to avoid surprising side-effects. - */ -#include - -/* Include because it is needed by Vulkan and related functions. - * Include it unconditionally to avoid surprising side-effects. - */ -#include -#include "fcl_bridge.h" - -#if defined(GLFW_INCLUDE_VULKAN) - #include -#endif /* Vulkan header */ - -/* The Vulkan header may have indirectly included windows.h (because of - * VK_USE_PLATFORM_WIN32_KHR) so we offer our replacement symbols after it. - */ - -/* It is customary to use APIENTRY for OpenGL function pointer declarations on - * all platforms. Additionally, the Windows OpenGL header needs APIENTRY. - */ -#if !defined(APIENTRY) - #if defined(_WIN32) - #define APIENTRY __stdcall - #else - #define APIENTRY - #endif - #define GLFW_APIENTRY_DEFINED -#endif /* APIENTRY */ - -/* Some Windows OpenGL headers need this. - */ -#if !defined(WINGDIAPI) && defined(_WIN32) - #define WINGDIAPI __declspec(dllimport) - #define GLFW_WINGDIAPI_DEFINED -#endif /* WINGDIAPI */ - -/* Some Windows GLU headers need this. - */ -#if !defined(CALLBACK) && defined(_WIN32) - #define CALLBACK __stdcall - #define GLFW_CALLBACK_DEFINED -#endif /* CALLBACK */ - -/* Include the chosen OpenGL or OpenGL ES headers. - */ -#if defined(GLFW_INCLUDE_ES1) - - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - -#elif defined(GLFW_INCLUDE_ES2) - - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - -#elif defined(GLFW_INCLUDE_ES3) - - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - -#elif defined(GLFW_INCLUDE_ES31) - - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - -#elif defined(GLFW_INCLUDE_ES32) - - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - -#elif defined(GLFW_INCLUDE_GLCOREARB) - - #if defined(__APPLE__) - - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif /*GLFW_INCLUDE_GLEXT*/ - - #else /*__APPLE__*/ - - #include - - #endif /*__APPLE__*/ - -#elif defined(GLFW_INCLUDE_GLU) - - #if defined(__APPLE__) - - #if defined(GLFW_INCLUDE_GLU) - #include - #endif - - #else /*__APPLE__*/ - - #if defined(GLFW_INCLUDE_GLU) - #include - #endif - - #endif /*__APPLE__*/ - -#elif !defined(GLFW_INCLUDE_NONE) && \ - !defined(__gl_h_) && \ - !defined(__gles1_gl_h_) && \ - !defined(__gles2_gl2_h_) && \ - !defined(__gles2_gl3_h_) && \ - !defined(__gles2_gl31_h_) && \ - !defined(__gles2_gl32_h_) && \ - !defined(__gl_glcorearb_h_) && \ - !defined(__gl2_h_) /*legacy*/ && \ - !defined(__gl3_h_) /*legacy*/ && \ - !defined(__gl31_h_) /*legacy*/ && \ - !defined(__gl32_h_) /*legacy*/ && \ - !defined(__glcorearb_h_) /*legacy*/ && \ - !defined(__GL_H__) /*non-standard*/ && \ - !defined(__gltypes_h_) /*non-standard*/ && \ - !defined(__glee_h_) /*non-standard*/ - -#endif /* OpenGL and OpenGL ES headers */ - -#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) - /* GLFW_DLL must be defined by applications that are linking against the DLL - * version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW - * configuration header when compiling the DLL version of the library. - */ - #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined" -#endif - -/* GLFWAPI is used to declare public API functions for export - * from the DLL / shared library / dynamic library. - */ -#if defined(_WIN32) && defined(_GLFW_BUILD_DLL) - /* We are building GLFW as a Win32 DLL */ - #define GLFWAPI __declspec(dllexport) -#elif defined(_WIN32) && defined(GLFW_DLL) - /* We are calling GLFW as a Win32 DLL */ - #define GLFWAPI __declspec(dllimport) -#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL) - /* We are building GLFW as a shared / dynamic library */ - #define GLFWAPI __attribute__((visibility("default"))) -#else - /* We are building or calling GLFW as a static library */ - #define GLFWAPI -#endif - - -/************************************************************************* - * GLFW API tokens - *************************************************************************/ - -/*! @name GLFW version macros - * @{ */ -/*! @brief The major version number of the GLFW header. - * - * The major version number of the GLFW header. This is incremented when the - * API is changed in non-compatible ways. - * @ingroup init - */ -#define GLFW_VERSION_MAJOR 3 -/*! @brief The minor version number of the GLFW header. - * - * The minor version number of the GLFW header. This is incremented when - * features are added to the API but it remains backward-compatible. - * @ingroup init - */ -#define GLFW_VERSION_MINOR 3 -/*! @brief The revision number of the GLFW header. - * - * The revision number of the GLFW header. This is incremented when a bug fix - * release is made that does not contain any API changes. - * @ingroup init - */ -#define GLFW_VERSION_REVISION 5 -/*! @} */ - -/*! @brief One. - * - * This is only semantic sugar for the number 1. You can instead use `1` or - * `true` or `_True` or `GL_TRUE` or `VK_TRUE` or anything else that is equal - * to one. - * - * @ingroup init - */ -#define GLFW_TRUE 1 -/*! @brief Zero. - * - * This is only semantic sugar for the number 0. You can instead use `0` or - * `false` or `_False` or `GL_FALSE` or `VK_FALSE` or anything else that is - * equal to zero. - * - * @ingroup init - */ -#define GLFW_FALSE 0 - -/*! @name Key and button actions - * @{ */ -/*! @brief The key or mouse button was released. - * - * The key or mouse button was released. - * - * @ingroup input - */ -#define GLFW_RELEASE 0 -/*! @brief The key or mouse button was pressed. - * - * The key or mouse button was pressed. - * - * @ingroup input - */ -#define GLFW_PRESS 1 -/*! @brief The key was held down until it repeated. - * - * The key was held down until it repeated. - * - * @ingroup input - */ -#define GLFW_REPEAT 2 -/*! @} */ - -/*! @defgroup hat_state Joystick hat states - * @brief Joystick hat states. - * - * See [joystick hat input](@ref joystick_hat) for how these are used. - * - * @ingroup input - * @{ */ -#define GLFW_HAT_CENTERED 0 -#define GLFW_HAT_UP 1 -#define GLFW_HAT_RIGHT 2 -#define GLFW_HAT_DOWN 4 -#define GLFW_HAT_LEFT 8 -#define GLFW_HAT_RIGHT_UP (GLFW_HAT_RIGHT | GLFW_HAT_UP) -#define GLFW_HAT_RIGHT_DOWN (GLFW_HAT_RIGHT | GLFW_HAT_DOWN) -#define GLFW_HAT_LEFT_UP (GLFW_HAT_LEFT | GLFW_HAT_UP) -#define GLFW_HAT_LEFT_DOWN (GLFW_HAT_LEFT | GLFW_HAT_DOWN) -/*! @} */ - -/*! @defgroup keys Keyboard keys - * @brief Keyboard key IDs. - * - * See [key input](@ref input_key) for how these are used. - * - * These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60), - * but re-arranged to map to 7-bit ASCII for printable keys (function keys are - * put in the 256+ range). - * - * The naming of the key codes follow these rules: - * - The US keyboard layout is used - * - Names of printable alpha-numeric characters are used (e.g. "A", "R", - * "3", etc.) - * - For non-alphanumeric characters, Unicode:ish names are used (e.g. - * "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not - * correspond to the Unicode standard (usually for brevity) - * - Keys that lack a clear US mapping are named "WORLD_x" - * - For non-printable keys, custom names are used (e.g. "F4", - * "BACKSPACE", etc.) - * - * @ingroup input - * @{ - */ - -/* The unknown key */ -#define GLFW_KEY_UNKNOWN -1 - -/* Printable keys */ -#define GLFW_KEY_SPACE 32 -#define GLFW_KEY_APOSTROPHE 39 /* ' */ -#define GLFW_KEY_COMMA 44 /* , */ -#define GLFW_KEY_MINUS 45 /* - */ -#define GLFW_KEY_PERIOD 46 /* . */ -#define GLFW_KEY_SLASH 47 /* / */ -#define GLFW_KEY_0 48 -#define GLFW_KEY_1 49 -#define GLFW_KEY_2 50 -#define GLFW_KEY_3 51 -#define GLFW_KEY_4 52 -#define GLFW_KEY_5 53 -#define GLFW_KEY_6 54 -#define GLFW_KEY_7 55 -#define GLFW_KEY_8 56 -#define GLFW_KEY_9 57 -#define GLFW_KEY_SEMICOLON 59 /* ; */ -#define GLFW_KEY_EQUAL 61 /* = */ -#define GLFW_KEY_A 65 -#define GLFW_KEY_B 66 -#define GLFW_KEY_C 67 -#define GLFW_KEY_D 68 -#define GLFW_KEY_E 69 -#define GLFW_KEY_F 70 -#define GLFW_KEY_G 71 -#define GLFW_KEY_H 72 -#define GLFW_KEY_I 73 -#define GLFW_KEY_J 74 -#define GLFW_KEY_K 75 -#define GLFW_KEY_L 76 -#define GLFW_KEY_M 77 -#define GLFW_KEY_N 78 -#define GLFW_KEY_O 79 -#define GLFW_KEY_P 80 -#define GLFW_KEY_Q 81 -#define GLFW_KEY_R 82 -#define GLFW_KEY_S 83 -#define GLFW_KEY_T 84 -#define GLFW_KEY_U 85 -#define GLFW_KEY_V 86 -#define GLFW_KEY_W 87 -#define GLFW_KEY_X 88 -#define GLFW_KEY_Y 89 -#define GLFW_KEY_Z 90 -#define GLFW_KEY_LEFT_BRACKET 91 /* [ */ -#define GLFW_KEY_BACKSLASH 92 /* \ */ -#define GLFW_KEY_RIGHT_BRACKET 93 /* ] */ -#define GLFW_KEY_GRAVE_ACCENT 96 /* ` */ -#define GLFW_KEY_WORLD_1 161 /* non-US #1 */ -#define GLFW_KEY_WORLD_2 162 /* non-US #2 */ - -/* Function keys */ -#define GLFW_KEY_ESCAPE 256 -#define GLFW_KEY_ENTER 257 -#define GLFW_KEY_TAB 258 -#define GLFW_KEY_BACKSPACE 259 -#define GLFW_KEY_INSERT 260 -#define GLFW_KEY_DELETE 261 -#define GLFW_KEY_RIGHT 262 -#define GLFW_KEY_LEFT 263 -#define GLFW_KEY_DOWN 264 -#define GLFW_KEY_UP 265 -#define GLFW_KEY_PAGE_UP 266 -#define GLFW_KEY_PAGE_DOWN 267 -#define GLFW_KEY_HOME 268 -#define GLFW_KEY_END 269 -#define GLFW_KEY_CAPS_LOCK 280 -#define GLFW_KEY_SCROLL_LOCK 281 -#define GLFW_KEY_NUM_LOCK 282 -#define GLFW_KEY_PRINT_SCREEN 283 -#define GLFW_KEY_PAUSE 284 -#define GLFW_KEY_F1 290 -#define GLFW_KEY_F2 291 -#define GLFW_KEY_F3 292 -#define GLFW_KEY_F4 293 -#define GLFW_KEY_F5 294 -#define GLFW_KEY_F6 295 -#define GLFW_KEY_F7 296 -#define GLFW_KEY_F8 297 -#define GLFW_KEY_F9 298 -#define GLFW_KEY_F10 299 -#define GLFW_KEY_F11 300 -#define GLFW_KEY_F12 301 -#define GLFW_KEY_F13 302 -#define GLFW_KEY_F14 303 -#define GLFW_KEY_F15 304 -#define GLFW_KEY_F16 305 -#define GLFW_KEY_F17 306 -#define GLFW_KEY_F18 307 -#define GLFW_KEY_F19 308 -#define GLFW_KEY_F20 309 -#define GLFW_KEY_F21 310 -#define GLFW_KEY_F22 311 -#define GLFW_KEY_F23 312 -#define GLFW_KEY_F24 313 -#define GLFW_KEY_F25 314 -#define GLFW_KEY_KP_0 320 -#define GLFW_KEY_KP_1 321 -#define GLFW_KEY_KP_2 322 -#define GLFW_KEY_KP_3 323 -#define GLFW_KEY_KP_4 324 -#define GLFW_KEY_KP_5 325 -#define GLFW_KEY_KP_6 326 -#define GLFW_KEY_KP_7 327 -#define GLFW_KEY_KP_8 328 -#define GLFW_KEY_KP_9 329 -#define GLFW_KEY_KP_DECIMAL 330 -#define GLFW_KEY_KP_DIVIDE 331 -#define GLFW_KEY_KP_MULTIPLY 332 -#define GLFW_KEY_KP_SUBTRACT 333 -#define GLFW_KEY_KP_ADD 334 -#define GLFW_KEY_KP_ENTER 335 -#define GLFW_KEY_KP_EQUAL 336 -#define GLFW_KEY_LEFT_SHIFT 340 -#define GLFW_KEY_LEFT_CONTROL 341 -#define GLFW_KEY_LEFT_ALT 342 -#define GLFW_KEY_LEFT_SUPER 343 -#define GLFW_KEY_RIGHT_SHIFT 344 -#define GLFW_KEY_RIGHT_CONTROL 345 -#define GLFW_KEY_RIGHT_ALT 346 -#define GLFW_KEY_RIGHT_SUPER 347 -#define GLFW_KEY_MENU 348 - -#define GLFW_KEY_LAST GLFW_KEY_MENU - -/*! @} */ - -/*! @defgroup mods Modifier key flags - * @brief Modifier key flags. - * - * See [key input](@ref input_key) for how these are used. - * - * @ingroup input - * @{ */ - -/*! @brief If this bit is set one or more Shift keys were held down. - * - * If this bit is set one or more Shift keys were held down. - */ -#define GLFW_MOD_SHIFT 0x0001 -/*! @brief If this bit is set one or more Control keys were held down. - * - * If this bit is set one or more Control keys were held down. - */ -#define GLFW_MOD_CONTROL 0x0002 -/*! @brief If this bit is set one or more Alt keys were held down. - * - * If this bit is set one or more Alt keys were held down. - */ -#define GLFW_MOD_ALT 0x0004 -/*! @brief If this bit is set one or more Super keys were held down. - * - * If this bit is set one or more Super keys were held down. - */ -#define GLFW_MOD_SUPER 0x0008 -/*! @brief If this bit is set the Caps Lock key is enabled. - * - * If this bit is set the Caps Lock key is enabled and the @ref - * GLFW_LOCK_KEY_MODS input mode is set. - */ -#define GLFW_MOD_CAPS_LOCK 0x0010 -/*! @brief If this bit is set the Num Lock key is enabled. - * - * If this bit is set the Num Lock key is enabled and the @ref - * GLFW_LOCK_KEY_MODS input mode is set. - */ -#define GLFW_MOD_NUM_LOCK 0x0020 - -/*! @} */ - -/*! @defgroup buttons Mouse buttons - * @brief Mouse button IDs. - * - * See [mouse button input](@ref input_mouse_button) for how these are used. - * - * @ingroup input - * @{ */ -#define GLFW_MOUSE_BUTTON_1 0 -#define GLFW_MOUSE_BUTTON_2 1 -#define GLFW_MOUSE_BUTTON_3 2 -#define GLFW_MOUSE_BUTTON_4 3 -#define GLFW_MOUSE_BUTTON_5 4 -#define GLFW_MOUSE_BUTTON_6 5 -#define GLFW_MOUSE_BUTTON_7 6 -#define GLFW_MOUSE_BUTTON_8 7 -#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8 -#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1 -#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2 -#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3 -/*! @} */ - -/*! @defgroup joysticks Joysticks - * @brief Joystick IDs. - * - * See [joystick input](@ref joystick) for how these are used. - * - * @ingroup input - * @{ */ -#define GLFW_JOYSTICK_1 0 -#define GLFW_JOYSTICK_2 1 -#define GLFW_JOYSTICK_3 2 -#define GLFW_JOYSTICK_4 3 -#define GLFW_JOYSTICK_5 4 -#define GLFW_JOYSTICK_6 5 -#define GLFW_JOYSTICK_7 6 -#define GLFW_JOYSTICK_8 7 -#define GLFW_JOYSTICK_9 8 -#define GLFW_JOYSTICK_10 9 -#define GLFW_JOYSTICK_11 10 -#define GLFW_JOYSTICK_12 11 -#define GLFW_JOYSTICK_13 12 -#define GLFW_JOYSTICK_14 13 -#define GLFW_JOYSTICK_15 14 -#define GLFW_JOYSTICK_16 15 -#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16 -/*! @} */ - -/*! @defgroup gamepad_buttons Gamepad buttons - * @brief Gamepad buttons. - * - * See @ref gamepad for how these are used. - * - * @ingroup input - * @{ */ -#define GLFW_GAMEPAD_BUTTON_A 0 -#define GLFW_GAMEPAD_BUTTON_B 1 -#define GLFW_GAMEPAD_BUTTON_X 2 -#define GLFW_GAMEPAD_BUTTON_Y 3 -#define GLFW_GAMEPAD_BUTTON_LEFT_BUMPER 4 -#define GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER 5 -#define GLFW_GAMEPAD_BUTTON_BACK 6 -#define GLFW_GAMEPAD_BUTTON_START 7 -#define GLFW_GAMEPAD_BUTTON_GUIDE 8 -#define GLFW_GAMEPAD_BUTTON_LEFT_THUMB 9 -#define GLFW_GAMEPAD_BUTTON_RIGHT_THUMB 10 -#define GLFW_GAMEPAD_BUTTON_DPAD_UP 11 -#define GLFW_GAMEPAD_BUTTON_DPAD_RIGHT 12 -#define GLFW_GAMEPAD_BUTTON_DPAD_DOWN 13 -#define GLFW_GAMEPAD_BUTTON_DPAD_LEFT 14 -#define GLFW_GAMEPAD_BUTTON_LAST GLFW_GAMEPAD_BUTTON_DPAD_LEFT - -#define GLFW_GAMEPAD_BUTTON_CROSS GLFW_GAMEPAD_BUTTON_A -#define GLFW_GAMEPAD_BUTTON_CIRCLE GLFW_GAMEPAD_BUTTON_B -#define GLFW_GAMEPAD_BUTTON_SQUARE GLFW_GAMEPAD_BUTTON_X -#define GLFW_GAMEPAD_BUTTON_TRIANGLE GLFW_GAMEPAD_BUTTON_Y -/*! @} */ - -/*! @defgroup gamepad_axes Gamepad axes - * @brief Gamepad axes. - * - * See @ref gamepad for how these are used. - * - * @ingroup input - * @{ */ -#define GLFW_GAMEPAD_AXIS_LEFT_X 0 -#define GLFW_GAMEPAD_AXIS_LEFT_Y 1 -#define GLFW_GAMEPAD_AXIS_RIGHT_X 2 -#define GLFW_GAMEPAD_AXIS_RIGHT_Y 3 -#define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER 4 -#define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER 5 -#define GLFW_GAMEPAD_AXIS_LAST GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER -/*! @} */ - -/*! @defgroup errors Error codes - * @brief Error codes. - * - * See [error handling](@ref error_handling) for how these are used. - * - * @ingroup init - * @{ */ -/*! @brief No error has occurred. - * - * No error has occurred. - * - * @analysis Yay. - */ -#define GLFW_NO_ERROR 0 -/*! @brief GLFW has not been initialized. - * - * This occurs if a GLFW function was called that must not be called unless the - * library is [initialized](@ref intro_init). - * - * @analysis Application programmer error. Initialize GLFW before calling any - * function that requires initialization. - */ -#define GLFW_NOT_INITIALIZED 0x00010001 -/*! @brief 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 @ref glfwSwapInterval. - * - * @analysis Application programmer error. Ensure a context is current before - * calling functions that require a current context. - */ -#define GLFW_NO_CURRENT_CONTEXT 0x00010002 -/*! @brief 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 @ref GLFW_RED_BITS with @ref glfwGetWindowAttrib. - * - * @analysis Application programmer error. Fix the offending call. - */ -#define GLFW_INVALID_ENUM 0x00010003 -/*! @brief 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 @ref GLFW_VERSION_UNAVAILABLE error. - * - * @analysis Application programmer error. Fix the offending call. - */ -#define GLFW_INVALID_VALUE 0x00010004 -/*! @brief A memory allocation failed. - * - * A memory allocation failed. - * - * @analysis A bug in GLFW or the underlying operating system. Report the bug - * to our [issue tracker](https://github.com/glfw/glfw/issues). - */ -#define GLFW_OUT_OF_MEMORY 0x00010005 -/*! @brief GLFW could not find support for the requested API on the system. - * - * GLFW could not find support for the requested API on the system. - * - * @analysis 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. - * - * @par - * 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. - */ -#define GLFW_API_UNAVAILABLE 0x00010006 -/*! @brief The requested OpenGL or OpenGL ES version is not available. - * - * The requested OpenGL or OpenGL ES version (including any requested context - * or framebuffer hints) is not available on this machine. - * - * @analysis 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. - * - * @par - * 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 @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions - * will exist. - */ -#define GLFW_VERSION_UNAVAILABLE 0x00010007 -/*! @brief A platform-specific error occurred that does not match any of the - * more specific categories. - * - * A platform-specific error occurred that does not match any of the more - * specific categories. - * - * @analysis 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](https://github.com/glfw/glfw/issues). - */ -#define GLFW_PLATFORM_ERROR 0x00010008 -/*! @brief The requested format is not supported or available. - * - * If emitted during window creation, the requested pixel format is not - * supported. - * - * If emitted when querying the clipboard, the contents of the clipboard could - * not be converted to the requested format. - * - * @analysis If emitted during window creation, one or more - * [hard constraints](@ref window_hints_hard) 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. - * - * @par - * If emitted when querying the clipboard, ignore the error or report it to - * the user, as appropriate. - */ -#define GLFW_FORMAT_UNAVAILABLE 0x00010009 -/*! @brief 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. - * - * @analysis Application programmer error. Fix the offending call. - */ -#define GLFW_NO_WINDOW_CONTEXT 0x0001000A -/*! @} */ - -/*! @addtogroup window - * @{ */ -/*! @brief Input focus window hint and attribute - * - * Input focus [window hint](@ref GLFW_FOCUSED_hint) or - * [window attribute](@ref GLFW_FOCUSED_attrib). - */ -#define GLFW_FOCUSED 0x00020001 -/*! @brief Window iconification window attribute - * - * Window iconification [window attribute](@ref GLFW_ICONIFIED_attrib). - */ -#define GLFW_ICONIFIED 0x00020002 -/*! @brief Window resize-ability window hint and attribute - * - * Window resize-ability [window hint](@ref GLFW_RESIZABLE_hint) and - * [window attribute](@ref GLFW_RESIZABLE_attrib). - */ -#define GLFW_RESIZABLE 0x00020003 -/*! @brief Window visibility window hint and attribute - * - * Window visibility [window hint](@ref GLFW_VISIBLE_hint) and - * [window attribute](@ref GLFW_VISIBLE_attrib). - */ -#define GLFW_VISIBLE 0x00020004 -/*! @brief Window decoration window hint and attribute - * - * Window decoration [window hint](@ref GLFW_DECORATED_hint) and - * [window attribute](@ref GLFW_DECORATED_attrib). - */ -#define GLFW_DECORATED 0x00020005 -/*! @brief Window auto-iconification window hint and attribute - * - * Window auto-iconification [window hint](@ref GLFW_AUTO_ICONIFY_hint) and - * [window attribute](@ref GLFW_AUTO_ICONIFY_attrib). - */ -#define GLFW_AUTO_ICONIFY 0x00020006 -/*! @brief Window decoration window hint and attribute - * - * Window decoration [window hint](@ref GLFW_FLOATING_hint) and - * [window attribute](@ref GLFW_FLOATING_attrib). - */ -#define GLFW_FLOATING 0x00020007 -/*! @brief Window maximization window hint and attribute - * - * Window maximization [window hint](@ref GLFW_MAXIMIZED_hint) and - * [window attribute](@ref GLFW_MAXIMIZED_attrib). - */ -#define GLFW_MAXIMIZED 0x00020008 -/*! @brief Cursor centering window hint - * - * Cursor centering [window hint](@ref GLFW_CENTER_CURSOR_hint). - */ -#define GLFW_CENTER_CURSOR 0x00020009 -/*! @brief Window framebuffer transparency hint and attribute - * - * Window framebuffer transparency - * [window hint](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint) and - * [window attribute](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib). - */ -#define GLFW_TRANSPARENT_FRAMEBUFFER 0x0002000A -/*! @brief Mouse cursor hover window attribute. - * - * Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib). - */ -#define GLFW_HOVERED 0x0002000B -/*! @brief Input focus on calling show window hint and attribute - * - * Input focus [window hint](@ref GLFW_FOCUS_ON_SHOW_hint) or - * [window attribute](@ref GLFW_FOCUS_ON_SHOW_attrib). - */ -#define GLFW_FOCUS_ON_SHOW 0x0002000C - -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_RED_BITS). - */ -#define GLFW_RED_BITS 0x00021001 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_GREEN_BITS). - */ -#define GLFW_GREEN_BITS 0x00021002 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_BLUE_BITS). - */ -#define GLFW_BLUE_BITS 0x00021003 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_ALPHA_BITS). - */ -#define GLFW_ALPHA_BITS 0x00021004 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_DEPTH_BITS). - */ -#define GLFW_DEPTH_BITS 0x00021005 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_STENCIL_BITS). - */ -#define GLFW_STENCIL_BITS 0x00021006 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_ACCUM_RED_BITS). - */ -#define GLFW_ACCUM_RED_BITS 0x00021007 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_ACCUM_GREEN_BITS). - */ -#define GLFW_ACCUM_GREEN_BITS 0x00021008 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_ACCUM_BLUE_BITS). - */ -#define GLFW_ACCUM_BLUE_BITS 0x00021009 -/*! @brief Framebuffer bit depth hint. - * - * Framebuffer bit depth [hint](@ref GLFW_ACCUM_ALPHA_BITS). - */ -#define GLFW_ACCUM_ALPHA_BITS 0x0002100A -/*! @brief Framebuffer auxiliary buffer hint. - * - * Framebuffer auxiliary buffer [hint](@ref GLFW_AUX_BUFFERS). - */ -#define GLFW_AUX_BUFFERS 0x0002100B -/*! @brief OpenGL stereoscopic rendering hint. - * - * OpenGL stereoscopic rendering [hint](@ref GLFW_STEREO). - */ -#define GLFW_STEREO 0x0002100C -/*! @brief Framebuffer MSAA samples hint. - * - * Framebuffer MSAA samples [hint](@ref GLFW_SAMPLES). - */ -#define GLFW_SAMPLES 0x0002100D -/*! @brief Framebuffer sRGB hint. - * - * Framebuffer sRGB [hint](@ref GLFW_SRGB_CAPABLE). - */ -#define GLFW_SRGB_CAPABLE 0x0002100E -/*! @brief Monitor refresh rate hint. - * - * Monitor refresh rate [hint](@ref GLFW_REFRESH_RATE). - */ -#define GLFW_REFRESH_RATE 0x0002100F -/*! @brief Framebuffer double buffering hint. - * - * Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER). - */ -#define GLFW_DOUBLEBUFFER 0x00021010 - -/*! @brief Context client API hint and attribute. - * - * Context client API [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). - */ -#define GLFW_CLIENT_API 0x00022001 -/*! @brief Context client API major version hint and attribute. - * - * Context client API major version [hint](@ref GLFW_CONTEXT_VERSION_MAJOR_hint) - * and [attribute](@ref GLFW_CONTEXT_VERSION_MAJOR_attrib). - */ -#define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 -/*! @brief Context client API minor version hint and attribute. - * - * Context client API minor version [hint](@ref GLFW_CONTEXT_VERSION_MINOR_hint) - * and [attribute](@ref GLFW_CONTEXT_VERSION_MINOR_attrib). - */ -#define GLFW_CONTEXT_VERSION_MINOR 0x00022003 -/*! @brief Context client API revision number hint and attribute. - * - * Context client API revision number - * [attribute](@ref GLFW_CONTEXT_REVISION_attrib). - */ -#define GLFW_CONTEXT_REVISION 0x00022004 -/*! @brief Context robustness hint and attribute. - * - * Context client API revision number [hint](@ref GLFW_CONTEXT_ROBUSTNESS_hint) - * and [attribute](@ref GLFW_CONTEXT_ROBUSTNESS_attrib). - */ -#define GLFW_CONTEXT_ROBUSTNESS 0x00022005 -/*! @brief OpenGL forward-compatibility hint and attribute. - * - * OpenGL forward-compatibility [hint](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) - * and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib). - */ -#define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 -/*! @brief Debug mode context hint and attribute. - * - * Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and - * [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib). - */ -#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 -/*! @brief OpenGL profile hint and attribute. - * - * OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and - * [attribute](@ref GLFW_OPENGL_PROFILE_attrib). - */ -#define GLFW_OPENGL_PROFILE 0x00022008 -/*! @brief Context flush-on-release hint and attribute. - * - * Context flush-on-release [hint](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) and - * [attribute](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib). - */ -#define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009 -/*! @brief Context error suppression hint and attribute. - * - * Context error suppression [hint](@ref GLFW_CONTEXT_NO_ERROR_hint) and - * [attribute](@ref GLFW_CONTEXT_NO_ERROR_attrib). - */ -#define GLFW_CONTEXT_NO_ERROR 0x0002200A -/*! @brief Context creation API hint and attribute. - * - * Context creation API [hint](@ref GLFW_CONTEXT_CREATION_API_hint) and - * [attribute](@ref GLFW_CONTEXT_CREATION_API_attrib). - */ -#define GLFW_CONTEXT_CREATION_API 0x0002200B -/*! @brief Window content area scaling window - * [window hint](@ref GLFW_SCALE_TO_MONITOR). - */ -#define GLFW_SCALE_TO_MONITOR 0x0002200C -/*! @brief macOS specific - * [window hint](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint). - */ -#define GLFW_COCOA_RETINA_FRAMEBUFFER 0x00023001 -/*! @brief macOS specific - * [window hint](@ref GLFW_COCOA_FRAME_NAME_hint). - */ -#define GLFW_COCOA_FRAME_NAME 0x00023002 -/*! @brief macOS specific - * [window hint](@ref GLFW_COCOA_GRAPHICS_SWITCHING_hint). - */ -#define GLFW_COCOA_GRAPHICS_SWITCHING 0x00023003 -/*! @brief X11 specific - * [window hint](@ref GLFW_X11_CLASS_NAME_hint). - */ -#define GLFW_X11_CLASS_NAME 0x00024001 -/*! @brief X11 specific - * [window hint](@ref GLFW_X11_CLASS_NAME_hint). - */ -#define GLFW_X11_INSTANCE_NAME 0x00024002 -/*! @} */ - -#define GLFW_NO_API 0 -#define GLFW_OPENGL_API 0x00030001 -#define GLFW_OPENGL_ES_API 0x00030002 - -#define GLFW_NO_ROBUSTNESS 0 -#define GLFW_NO_RESET_NOTIFICATION 0x00031001 -#define GLFW_LOSE_CONTEXT_ON_RESET 0x00031002 - -#define GLFW_OPENGL_ANY_PROFILE 0 -#define GLFW_OPENGL_CORE_PROFILE 0x00032001 -#define GLFW_OPENGL_COMPAT_PROFILE 0x00032002 - -#define GLFW_CURSOR 0x00033001 -#define GLFW_STICKY_KEYS 0x00033002 -#define GLFW_STICKY_MOUSE_BUTTONS 0x00033003 -#define GLFW_LOCK_KEY_MODS 0x00033004 -#define GLFW_RAW_MOUSE_MOTION 0x00033005 - -#define GLFW_CURSOR_NORMAL 0x00034001 -#define GLFW_CURSOR_HIDDEN 0x00034002 -#define GLFW_CURSOR_DISABLED 0x00034003 - -#define GLFW_ANY_RELEASE_BEHAVIOR 0 -#define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001 -#define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002 - -#define GLFW_NATIVE_CONTEXT_API 0x00036001 -#define GLFW_EGL_CONTEXT_API 0x00036002 -#define GLFW_OSMESA_CONTEXT_API 0x00036003 - -/*! @defgroup shapes Standard cursor shapes - * @brief Standard system cursor shapes. - * - * See [standard cursor creation](@ref cursor_standard) for how these are used. - * - * @ingroup input - * @{ */ - -/*! @brief The regular arrow cursor shape. - * - * The regular arrow cursor. - */ -#define GLFW_ARROW_CURSOR 0x00036001 -/*! @brief The text input I-beam cursor shape. - * - * The text input I-beam cursor shape. - */ -#define GLFW_IBEAM_CURSOR 0x00036002 -/*! @brief The crosshair shape. - * - * The crosshair shape. - */ -#define GLFW_CROSSHAIR_CURSOR 0x00036003 -/*! @brief The hand shape. - * - * The hand shape. - */ -#define GLFW_HAND_CURSOR 0x00036004 -/*! @brief The horizontal resize arrow shape. - * - * The horizontal resize arrow shape. - */ -#define GLFW_HRESIZE_CURSOR 0x00036005 -/*! @brief The vertical resize arrow shape. - * - * The vertical resize arrow shape. - */ -#define GLFW_VRESIZE_CURSOR 0x00036006 -/*! @} */ - -#define GLFW_CONNECTED 0x00040001 -#define GLFW_DISCONNECTED 0x00040002 - -/*! @addtogroup init - * @{ */ -/*! @brief Joystick hat buttons init hint. - * - * Joystick hat buttons [init hint](@ref GLFW_JOYSTICK_HAT_BUTTONS). - */ -#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001 -/*! @brief macOS specific init hint. - * - * macOS specific [init hint](@ref GLFW_COCOA_CHDIR_RESOURCES_hint). - */ -#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001 -/*! @brief macOS specific init hint. - * - * macOS specific [init hint](@ref GLFW_COCOA_MENUBAR_hint). - */ -#define GLFW_COCOA_MENUBAR 0x00051002 -/*! @} */ - -#define GLFW_DONT_CARE -1 - - -/************************************************************************* - * GLFW API types - *************************************************************************/ - -/*! @brief Client API function pointer type. - * - * Generic function pointer used for returning client API function pointers - * without forcing a cast from a regular pointer. - * - * @sa @ref context_glext - * @sa @ref glfwGetProcAddress - * - * @since Added in version 3.0. - * - * @ingroup context - */ -typedef void (*GLFWglproc)(void); - -/*! @brief Vulkan API function pointer type. - * - * Generic function pointer used for returning Vulkan API function pointers - * without forcing a cast from a regular pointer. - * - * @sa @ref vulkan_proc - * @sa @ref glfwGetInstanceProcAddress - * - * @since Added in version 3.2. - * - * @ingroup vulkan - */ -typedef void (*GLFWvkproc)(void); - -/*! @brief Opaque monitor object. - * - * Opaque monitor object. - * - * @see @ref monitor_object - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -typedef struct GLFWmonitor GLFWmonitor; - -/*! @brief Opaque window object. - * - * Opaque window object. - * - * @see @ref window_object - * - * @since Added in version 3.0. - * - * @ingroup window - */ -typedef struct GLFWwindow GLFWwindow; - -/*! @brief Opaque cursor object. - * - * Opaque cursor object. - * - * @see @ref cursor_object - * - * @since Added in version 3.1. - * - * @ingroup input - */ -typedef struct GLFWcursor GLFWcursor; - -/*! @brief The function pointer type for memory allocation callbacks. - * - * This is the function pointer type for memory allocation callbacks. A memory - * allocation callback function has the following signature: - * @code - * void* function_name(size_t size, void* user) - * @endcode - * - * This function must return either a memory block at least `size` bytes long, - * or `NULL` if allocation failed. Note that not all parts of GLFW handle allocation - * failures gracefully yet. - * - * This function may be called during @ref glfwInit but before the library is - * flagged as initialized, as well as during @ref glfwTerminate after the - * library is no longer flagged as initialized. - * - * Any memory allocated by this function will be deallocated during library - * termination or earlier. - * - * The size will always be greater than zero. Allocations of size zero are filtered out - * before reaching the custom allocator. - * - * @param[in] size The minimum size, in bytes, of the memory block. - * @param[in] user The user-defined pointer from the allocator. - * @return The address of the newly allocated memory block, or `NULL` if an - * error occurred. - * - * @pointer_lifetime The returned memory block must be valid at least until it - * is deallocated. - * - * @reentrancy This function should not call any GLFW function. - * - * @thread_safety This function may be called from any thread that calls GLFW functions. - * - * @sa @ref init_allocator - * @sa @ref GLFWallocator - * - * @since Added in version 3.4. - * - * @ingroup init - */ -typedef void* (* GLFWallocatefun)(size_t size, void* user); - -/*! @brief The function pointer type for memory reallocation callbacks. - * - * This is the function pointer type for memory reallocation callbacks. - * A memory reallocation callback function has the following signature: - * @code - * void* function_name(void* block, size_t size, void* user) - * @endcode - * - * This function must return a memory block at least `size` bytes long, or - * `NULL` if allocation failed. Note that not all parts of GLFW handle allocation - * failures gracefully yet. - * - * This function may be called during @ref glfwInit but before the library is - * flagged as initialized, as well as during @ref glfwTerminate after the - * library is no longer flagged as initialized. - * - * Any memory allocated by this function will be deallocated during library - * termination or earlier. - * - * The block address will never be `NULL` and the size will always be greater than zero. - * Reallocations of a block to size zero are converted into deallocations. Reallocations - * of `NULL` to a non-zero size are converted into regular allocations. - * - * @param[in] block The address of the memory block to reallocate. - * @param[in] size The new minimum size, in bytes, of the memory block. - * @param[in] user The user-defined pointer from the allocator. - * @return The address of the newly allocated or resized memory block, or - * `NULL` if an error occurred. - * - * @pointer_lifetime The returned memory block must be valid at least until it - * is deallocated. - * - * @reentrancy This function should not call any GLFW function. - * - * @thread_safety This function may be called from any thread that calls GLFW functions. - * - * @sa @ref init_allocator - * @sa @ref GLFWallocator - * - * @since Added in version 3.4. - * - * @ingroup init - */ -typedef void* (* GLFWreallocatefun)(void* block, size_t size, void* user); - -/*! @brief The function pointer type for memory deallocation callbacks. - * - * This is the function pointer type for memory deallocation callbacks. - * A memory deallocation callback function has the following signature: - * @code - * void function_name(void* block, void* user) - * @endcode - * - * This function may deallocate the specified memory block. This memory block - * will have been allocated with the same allocator. - * - * This function may be called during @ref glfwInit but before the library is - * flagged as initialized, as well as during @ref glfwTerminate after the - * library is no longer flagged as initialized. - * - * The block address will never be `NULL`. Deallocations of `NULL` are filtered out - * before reaching the custom allocator. - * - * @param[in] block The address of the memory block to deallocate. - * @param[in] user The user-defined pointer from the allocator. - * - * @pointer_lifetime The specified memory block will not be accessed by GLFW - * after this function is called. - * - * @reentrancy This function should not call any GLFW function. - * - * @thread_safety This function may be called from any thread that calls GLFW functions. - * - * @sa @ref init_allocator - * @sa @ref GLFWallocator - * - * @since Added in version 3.4. - * - * @ingroup init - */ -typedef void (* GLFWdeallocatefun)(void* block, void* user); - -/*! @brief The function pointer type for error callbacks. - * - * This is the function pointer type for error callbacks. An error callback - * function has the following signature: - * @code - * void callback_name(int error_code, const char* description) - * @endcode - * - * @param[in] error_code An [error code](@ref errors). Future releases may add - * more error codes. - * @param[in] description A UTF-8 encoded string describing the error. - * - * @pointer_lifetime The error description string is valid until the callback - * function returns. - * - * @sa @ref error_handling - * @sa @ref glfwSetErrorCallback - * - * @since Added in version 3.0. - * - * @ingroup init - */ -typedef void (* GLFWerrorfun)(int,const char*); - -/*! @brief The function pointer type for window position callbacks. - * - * This is the function pointer type for window position callbacks. A window - * position callback function has the following signature: - * @code - * void callback_name(GLFWwindow* window, int xpos, int ypos) - * @endcode - * - * @param[in] window The window that was moved. - * @param[in] xpos The new x-coordinate, in screen coordinates, of the - * upper-left corner of the content area of the window. - * @param[in] ypos The new y-coordinate, in screen coordinates, of the - * upper-left corner of the content area of the window. - * - * @sa @ref window_pos - * @sa @ref glfwSetWindowPosCallback - * - * @since Added in version 3.0. - * - * @ingroup window - */ -typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); - -/*! @brief The function pointer type for window size callbacks. - * - * This is the function pointer type for window size callbacks. A window size - * callback function has the following signature: - * @code - * void callback_name(GLFWwindow* window, int width, int height) - * @endcode - * - * @param[in] window The window that was resized. - * @param[in] width The new width, in screen coordinates, of the window. - * @param[in] height The new height, in screen coordinates, of the window. - * - * @sa @ref window_size - * @sa @ref glfwSetWindowSizeCallback - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); - -/*! @brief The function pointer type for window close callbacks. - * - * This is the function pointer type for window close callbacks. A window - * close callback function has the following signature: - * @code - * void function_name(GLFWwindow* window) - * @endcode - * - * @param[in] window The window that the user attempted to close. - * - * @sa @ref window_close - * @sa @ref glfwSetWindowCloseCallback - * - * @since Added in version 2.5. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -typedef void (* GLFWwindowclosefun)(GLFWwindow*); - -/*! @brief The function pointer type for window content refresh callbacks. - * - * This is the function pointer type for window content refresh callbacks. - * A window content refresh callback function has the following signature: - * @code - * void function_name(GLFWwindow* window); - * @endcode - * - * @param[in] window The window whose content needs to be refreshed. - * - * @sa @ref window_refresh - * @sa @ref glfwSetWindowRefreshCallback - * - * @since Added in version 2.5. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); - -/*! @brief The function pointer type for window focus callbacks. - * - * This is the function pointer type for window focus callbacks. A window - * focus callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, int focused) - * @endcode - * - * @param[in] window The window that gained or lost input focus. - * @param[in] focused `GLFW_TRUE` if the window was given input focus, or - * `GLFW_FALSE` if it lost it. - * - * @sa @ref window_focus - * @sa @ref glfwSetWindowFocusCallback - * - * @since Added in version 3.0. - * - * @ingroup window - */ -typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); - -/*! @brief The function pointer type for window iconify callbacks. - * - * This is the function pointer type for window iconify callbacks. A window - * iconify callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, int iconified) - * @endcode - * - * @param[in] window The window that was iconified or restored. - * @param[in] iconified `GLFW_TRUE` if the window was iconified, or - * `GLFW_FALSE` if it was restored. - * - * @sa @ref window_iconify - * @sa @ref glfwSetWindowIconifyCallback - * - * @since Added in version 3.0. - * - * @ingroup window - */ -typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); - -/*! @brief The function pointer type for window maximize callbacks. - * - * This is the function pointer type for window maximize callbacks. A window - * maximize callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, int maximized) - * @endcode - * - * @param[in] window The window that was maximized or restored. - * @param[in] maximized `GLFW_TRUE` if the window was maximized, or - * `GLFW_FALSE` if it was restored. - * - * @sa @ref window_maximize - * @sa glfwSetWindowMaximizeCallback - * - * @since Added in version 3.3. - * - * @ingroup window - */ -typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); - -/*! @brief The function pointer type for framebuffer size callbacks. - * - * This is the function pointer type for framebuffer size callbacks. - * A framebuffer size callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, int width, int height) - * @endcode - * - * @param[in] window The window whose framebuffer was resized. - * @param[in] width The new width, in pixels, of the framebuffer. - * @param[in] height The new height, in pixels, of the framebuffer. - * - * @sa @ref window_fbsize - * @sa @ref glfwSetFramebufferSizeCallback - * - * @since Added in version 3.0. - * - * @ingroup window - */ -typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); - -/*! @brief The function pointer type for window content scale callbacks. - * - * This is the function pointer type for window content scale callbacks. - * A window content scale callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, float xscale, float yscale) - * @endcode - * - * @param[in] window The window whose content scale changed. - * @param[in] xscale The new x-axis content scale of the window. - * @param[in] yscale The new y-axis content scale of the window. - * - * @sa @ref window_scale - * @sa @ref glfwSetWindowContentScaleCallback - * - * @since Added in version 3.3. - * - * @ingroup window - */ -typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); - -/*! @brief The function pointer type for mouse button callbacks. - * - * This is the function pointer type for mouse button callback functions. - * A mouse button callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, int button, int action, int mods) - * @endcode - * - * @param[in] window The window that received the event. - * @param[in] button The [mouse button](@ref buttons) that was pressed or - * released. - * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. Future releases - * may add more actions. - * @param[in] mods Bit field describing which [modifier keys](@ref mods) were - * held down. - * - * @sa @ref input_mouse_button - * @sa @ref glfwSetMouseButtonCallback - * - * @since Added in version 1.0. - * @glfw3 Added window handle and modifier mask parameters. - * - * @ingroup input - */ -typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); - -/*! @brief The function pointer type for cursor position callbacks. - * - * This is the function pointer type for cursor position callbacks. A cursor - * position callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, double xpos, double ypos); - * @endcode - * - * @param[in] window The window that received the event. - * @param[in] xpos The new cursor x-coordinate, relative to the left edge of - * the content area. - * @param[in] ypos The new cursor y-coordinate, relative to the top edge of the - * content area. - * - * @sa @ref cursor_pos - * @sa @ref glfwSetCursorPosCallback - * - * @since Added in version 3.0. Replaces `GLFWmouseposfun`. - * - * @ingroup input - */ -typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); - -/*! @brief The function pointer type for cursor enter/leave callbacks. - * - * This is the function pointer type for cursor enter/leave callbacks. - * A cursor enter/leave callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, int entered) - * @endcode - * - * @param[in] window The window that received the event. - * @param[in] entered `GLFW_TRUE` if the cursor entered the window's content - * area, or `GLFW_FALSE` if it left it. - * - * @sa @ref cursor_enter - * @sa @ref glfwSetCursorEnterCallback - * - * @since Added in version 3.0. - * - * @ingroup input - */ -typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); - -/*! @brief The function pointer type for scroll callbacks. - * - * This is the function pointer type for scroll callbacks. A scroll callback - * function has the following signature: - * @code - * void function_name(GLFWwindow* window, double xoffset, double yoffset) - * @endcode - * - * @param[in] window The window that received the event. - * @param[in] xoffset The scroll offset along the x-axis. - * @param[in] yoffset The scroll offset along the y-axis. - * - * @sa @ref scrolling - * @sa @ref glfwSetScrollCallback - * - * @since Added in version 3.0. Replaces `GLFWmousewheelfun`. - * - * @ingroup input - */ -typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); - -/*! @brief The function pointer type for keyboard key callbacks. - * - * This is the function pointer type for keyboard key callbacks. A keyboard - * key callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods) - * @endcode - * - * @param[in] window The window that received the event. - * @param[in] key The [keyboard key](@ref keys) that was pressed or released. - * @param[in] scancode The system-specific scancode of the key. - * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. Future - * releases may add more actions. - * @param[in] mods Bit field describing which [modifier keys](@ref mods) were - * held down. - * - * @sa @ref input_key - * @sa @ref glfwSetKeyCallback - * - * @since Added in version 1.0. - * @glfw3 Added window handle, scancode and modifier mask parameters. - * - * @ingroup input - */ -typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); - -/*! @brief The function pointer type for Unicode character callbacks. - * - * This is the function pointer type for Unicode character callbacks. - * A Unicode character callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, unsigned int codepoint) - * @endcode - * - * @param[in] window The window that received the event. - * @param[in] codepoint The Unicode code point of the character. - * - * @sa @ref input_char - * @sa @ref glfwSetCharCallback - * - * @since Added in version 2.4. - * @glfw3 Added window handle parameter. - * - * @ingroup input - */ -typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); - -/*! @brief The function pointer type for Unicode character with modifiers - * callbacks. - * - * This is the function pointer type for Unicode character with modifiers - * callbacks. It is called for each input character, regardless of what - * modifier keys are held down. A Unicode character with modifiers callback - * function has the following signature: - * @code - * void function_name(GLFWwindow* window, unsigned int codepoint, int mods) - * @endcode - * - * @param[in] window The window that received the event. - * @param[in] codepoint The Unicode code point of the character. - * @param[in] mods Bit field describing which [modifier keys](@ref mods) were - * held down. - * - * @sa @ref input_char - * @sa @ref glfwSetCharModsCallback - * - * @deprecated Scheduled for removal in version 4.0. - * - * @since Added in version 3.1. - * - * @ingroup input - */ -typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); - -/*! @brief The function pointer type for path drop callbacks. - * - * This is the function pointer type for path drop callbacks. A path drop - * callback function has the following signature: - * @code - * void function_name(GLFWwindow* window, int path_count, const char* paths[]) - * @endcode - * - * @param[in] window The window that received the event. - * @param[in] path_count The number of dropped paths. - * @param[in] paths The UTF-8 encoded file and/or directory path names. - * - * @pointer_lifetime The path array and its strings are valid until the - * callback function returns. - * - * @sa @ref path_drop - * @sa @ref glfwSetDropCallback - * - * @since Added in version 3.1. - * - * @ingroup input - */ -typedef void (* GLFWdropfun)(GLFWwindow*,int,const char*[]); - -/*! @brief The function pointer type for monitor configuration callbacks. - * - * This is the function pointer type for monitor configuration callbacks. - * A monitor callback function has the following signature: - * @code - * void function_name(GLFWmonitor* monitor, int event) - * @endcode - * - * @param[in] monitor The monitor that was connected or disconnected. - * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future - * releases may add more events. - * - * @sa @ref monitor_event - * @sa @ref glfwSetMonitorCallback - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); - -/*! @brief The function pointer type for joystick configuration callbacks. - * - * This is the function pointer type for joystick configuration callbacks. - * A joystick configuration callback function has the following signature: - * @code - * void function_name(int jid, int event) - * @endcode - * - * @param[in] jid The joystick that was connected or disconnected. - * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future - * releases may add more events. - * - * @sa @ref joystick_event - * @sa @ref glfwSetJoystickCallback - * - * @since Added in version 3.2. - * - * @ingroup input - */ -typedef void (* GLFWjoystickfun)(int,int); - -/*! @brief Video mode type. - * - * This describes a single video mode. - * - * @sa @ref monitor_modes - * @sa @ref glfwGetVideoMode - * @sa @ref glfwGetVideoModes - * - * @since Added in version 1.0. - * @glfw3 Added refresh rate member. - * - * @ingroup monitor - */ -typedef struct GLFWvidmode -{ - /*! The width, in screen coordinates, of the video mode. - */ - int width; - /*! The height, in screen coordinates, of the video mode. - */ - int height; - /*! The bit depth of the red channel of the video mode. - */ - int redBits; - /*! The bit depth of the green channel of the video mode. - */ - int greenBits; - /*! The bit depth of the blue channel of the video mode. - */ - int blueBits; - /*! The refresh rate, in Hz, of the video mode. - */ - int refreshRate; -} GLFWvidmode; - -/*! @brief Gamma ramp. - * - * This describes the gamma ramp for a monitor. - * - * @sa @ref monitor_gamma - * @sa @ref glfwGetGammaRamp - * @sa @ref glfwSetGammaRamp - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -typedef struct GLFWgammaramp -{ - /*! An array of value describing the response of the red channel. - */ - unsigned short* red; - /*! An array of value describing the response of the green channel. - */ - unsigned short* green; - /*! An array of value describing the response of the blue channel. - */ - unsigned short* blue; - /*! The number of elements in each array. - */ - unsigned int size; -} GLFWgammaramp; - -/*! @brief Image data. - * - * This describes a single 2D image. See the documentation for each related - * function what the expected pixel format is. - * - * @sa @ref cursor_custom - * @sa @ref window_icon - * - * @since Added in version 2.1. - * @glfw3 Removed format and bytes-per-pixel members. - * - * @ingroup window - */ -typedef struct GLFWimage -{ - /*! The width, in pixels, of this image. - */ - int width; - /*! The height, in pixels, of this image. - */ - int height; - /*! The pixel data of this image, arranged left-to-right, top-to-bottom. - */ - unsigned char* pixels; -} GLFWimage; - -/*! @brief Gamepad input state - * - * This describes the input state of a gamepad. - * - * @sa @ref gamepad - * @sa @ref glfwGetGamepadState - * - * @since Added in version 3.3. - * - * @ingroup input - */ -typedef struct GLFWgamepadstate -{ - /*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS` - * or `GLFW_RELEASE`. - */ - unsigned char buttons[15]; - /*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0 - * to 1.0 inclusive. - */ - float axes[6]; -} GLFWgamepadstate; - -/*! @brief - * - * @sa @ref init_allocator - * @sa @ref glfwInitAllocator - * - * @since Added in version 3.4. - * - * @ingroup init - */ -typedef struct GLFWallocator -{ - GLFWallocatefun allocate; - GLFWreallocatefun reallocate; - GLFWdeallocatefun deallocate; - void* user; -} GLFWallocator; - - -/************************************************************************* - * GLFW API functions - *************************************************************************/ - -/*! @brief Initializes the GLFW library. - * - * This function 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 @ref glfwTerminate before returning. If it - * succeeds, you should call @ref glfwTerminate before the application exits. - * - * Additional calls to this function after successful initialization but before - * termination will return `GLFW_TRUE` immediately. - * - * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. - * - * @remark @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 @ref - * GLFW_COCOA_CHDIR_RESOURCES init hint. - * - * @remark @x11 This function will set the `LC_CTYPE` category of the - * application locale according to the current environment if that category is - * still "C". This is because the "C" locale breaks Unicode text input. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref intro_init - * @sa @ref glfwTerminate - * - * @since Added in version 1.0. - * - * @ingroup init - */ -GLFWAPI int glfwInit(void); - -/*! @brief Terminates the GLFW library. - * - * This function 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 @ref glfwInit 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 @ref glfwInit before it returns - * failure. - * - * This function has no effect if GLFW is not initialized. - * - * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. - * - * @remark This function may be called before @ref glfwInit. - * - * @warning The contexts of any remaining windows must not be current on any - * other thread when this function is called. - * - * @reentrancy This function must not be called from a callback. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref intro_init - * @sa @ref glfwInit - * - * @since Added in version 1.0. - * - * @ingroup init - */ -GLFWAPI void glfwTerminate(void); - -/*! @brief Sets the specified init hint to the desired value. - * - * This function 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 ignore them. - * Setting these hints requires no platform specific headers or functions. - * - * @param[in] hint The [init hint](@ref init_hints) to set. - * @param[in] value The new value of the init hint. - * - * @errors Possible errors include @ref GLFW_INVALID_ENUM and @ref - * GLFW_INVALID_VALUE. - * - * @remarks This function may be called before @ref glfwInit. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa init_hints - * @sa glfwInit - * - * @since Added in version 3.3. - * - * @ingroup init - */ -GLFWAPI void glfwInitHint(int hint, int value); - -/*! @brief Sets the init allocator to the desired value. - * - * To use the default allocator, call this function with a `NULL` argument. - * - * If you specify an allocator struct, every member must be a valid function - * pointer. If any member is `NULL`, this function emits @ref - * GLFW_INVALID_VALUE and the init allocator is unchanged. - * - * @param[in] allocator The allocator to use at the next initialization, or - * `NULL` to use the default one. - * - * @errors Possible errors include @ref GLFW_INVALID_VALUE. - * - * @pointer_lifetime The specified allocator is copied before this function - * returns. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref init_allocator - * @sa @ref glfwInit - * - * @since Added in version 3.4. - * - * @ingroup init - */ -GLFWAPI void glfwInitAllocator(const GLFWallocator* allocator); - -/*! @brief Retrieves the version of the GLFW library. - * - * This function 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. - * - * Any or all of the version arguments may be `NULL`. - * - * @param[out] major Where to store the major version number, or `NULL`. - * @param[out] minor Where to store the minor version number, or `NULL`. - * @param[out] rev Where to store the revision number, or `NULL`. - * - * @errors None. - * - * @remark This function may be called before @ref glfwInit. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref intro_version - * @sa @ref glfwGetVersionString - * - * @since Added in version 1.0. - * - * @ingroup init - */ -GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev); - -/*! @brief Returns a string describing the compile-time configuration. - * - * This function returns the compile-time generated - * [version string](@ref intro_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 `glGetString`. - * - * __Do not use the version string__ to parse the GLFW library version. The - * @ref glfwGetVersion function provides the version of the running library - * binary in numerical format. - * - * @return The ASCII encoded GLFW version string. - * - * @errors None. - * - * @remark This function may be called before @ref glfwInit. - * - * @pointer_lifetime The returned string is static and compile-time generated. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref intro_version - * @sa @ref glfwGetVersion - * - * @since Added in version 3.0. - * - * @ingroup init - */ -GLFWAPI const char* glfwGetVersionString(void); - -/*! @brief Returns and clears the last error for the calling thread. - * - * This function returns and clears the [error code](@ref errors) 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 @ref GLFW_NO_ERROR (zero) and the description pointer is - * set to `NULL`. - * - * @param[in] description Where to store the error description pointer, or `NULL`. - * @return The last error code for the calling thread, or @ref GLFW_NO_ERROR - * (zero). - * - * @errors None. - * - * @pointer_lifetime 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. - * - * @remark This function may be called before @ref glfwInit. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref error_handling - * @sa @ref glfwSetErrorCallback - * - * @since Added in version 3.3. - * - * @ingroup init - */ -GLFWAPI int glfwGetError(const char** description); - -/*! @brief Sets the error callback. - * - * This function 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 @ref - * glfwGetError 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. - * - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set. - * - * @callback_signature - * @code - * void callback_name(int error_code, const char* description) - * @endcode - * For more information about the callback parameters, see the - * [callback pointer type](@ref GLFWerrorfun). - * - * @errors None. - * - * @remark This function may be called before @ref glfwInit. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref error_handling - * @sa @ref glfwGetError - * - * @since Added in version 3.0. - * - * @ingroup init - */ -GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback); - -/*! @brief Returns the currently selected platform. - * - * This function returns the platform that was selected during initialization. The - * returned value will be one of `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, - * `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`. - * - * @return The currently selected platform, or zero if an error occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref platform - * @sa @ref glfwPlatformSupported - * - * @since Added in version 3.4. - * - * @ingroup init - */ -GLFWAPI int glfwGetPlatform(void); - -/*! @brief Returns whether the library includes support for the specified platform. - * - * This function returns whether the library was compiled with support for the specified - * platform. The platform must be one of `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, - * `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`. - * - * @param[in] platform The platform to query. - * @return `GLFW_TRUE` if the platform is supported, or `GLFW_FALSE` otherwise. - * - * @errors Possible errors include @ref GLFW_INVALID_ENUM. - * - * @remark This function may be called before @ref glfwInit. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref platform - * @sa @ref glfwGetPlatform - * - * @since Added in version 3.4. - * - * @ingroup init - */ -GLFWAPI int glfwPlatformSupported(int platform); - -/*! @brief Returns the currently connected monitors. - * - * This function 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 `NULL`. - * - * @param[out] count Where to store the number of monitors in the returned - * array. This is set to zero if an error occurred. - * @return An array of monitor handles, or `NULL` if no monitors were found or - * if an [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_monitors - * @sa @ref monitor_event - * @sa @ref glfwGetPrimaryMonitor - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI GLFWmonitor** glfwGetMonitors(int* count); - -/*! @brief Returns the primary monitor. - * - * This function returns the primary monitor. This is usually the monitor - * where elements like the task bar or global menu bar are located. - * - * @return The primary monitor, or `NULL` if no monitors were found or if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @remark The primary monitor is always first in the array returned by @ref - * glfwGetMonitors. - * - * @sa @ref monitor_monitors - * @sa @ref glfwGetMonitors - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); - -/*! @brief Returns the position of the monitor's viewport on the virtual screen. - * - * This function returns the position, in screen coordinates, of the upper-left - * corner of the specified monitor. - * - * Any or all of the position arguments may be `NULL`. If an error occurs, all - * non-`NULL` position arguments will be set to zero. - * - * @param[in] monitor The monitor to query. - * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`. - * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_properties - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); - -/*! @brief 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 `NULL`. If an error - * occurs, all non-`NULL` position and size arguments will be set to zero. - * - * @param[in] monitor The monitor to query. - * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`. - * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`. - * @param[out] width Where to store the monitor width, or `NULL`. - * @param[out] height Where to store the monitor height, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_workarea - * - * @since Added in version 3.3. - * - * @ingroup monitor - */ -GLFWAPI void glfwGetMonitorWorkarea(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height); - -/*! @brief Returns the physical size of the monitor. - * - * This function 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](https://en.wikipedia.org/wiki/Extended_display_identification_data) - * data is incorrect or because the driver does not report it accurately. - * - * Any or all of the size arguments may be `NULL`. If an error occurs, all - * non-`NULL` size arguments will be set to zero. - * - * @param[in] monitor The monitor to query. - * @param[out] widthMM Where to store the width, in millimetres, of the - * monitor's display area, or `NULL`. - * @param[out] heightMM Where to store the height, in millimetres, of the - * monitor's display area, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @remark @win32 calculates the returned physical size from the - * current resolution and system DPI instead of querying the monitor EDID data. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_properties - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM); - -/*! @brief 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. - * - * @param[in] monitor The monitor to query. - * @param[out] xscale Where to store the x-axis content scale, or `NULL`. - * @param[out] yscale Where to store the y-axis content scale, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_scale - * @sa @ref glfwGetWindowContentScale - * - * @since Added in version 3.3. - * - * @ingroup monitor - */ -GLFWAPI void glfwGetMonitorContentScale(GLFWmonitor* monitor, float* xscale, float* yscale); - -/*! @brief Returns the name of the specified monitor. - * - * This function 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. - * - * @param[in] monitor The monitor to query. - * @return The UTF-8 encoded name of the monitor, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_properties - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor); - -/*! @brief 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 `NULL`. - * - * This function may be called from the monitor callback, even for a monitor - * that is being disconnected. - * - * @param[in] monitor The monitor whose pointer to set. - * @param[in] pointer The new value. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @sa @ref monitor_userptr - * @sa @ref glfwGetMonitorUserPointer - * - * @since Added in version 3.3. - * - * @ingroup monitor - */ -GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor* monitor, void* pointer); - -/*! @brief 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 `NULL`. - * - * This function may be called from the monitor callback, even for a monitor - * that is being disconnected. - * - * @param[in] monitor The monitor whose pointer to return. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @sa @ref monitor_userptr - * @sa @ref glfwSetMonitorUserPointer - * - * @since Added in version 3.3. - * - * @ingroup monitor - */ -GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor); - -/*! @brief Sets the monitor configuration callback. - * - * This function 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. - * - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWmonitor* monitor, int event) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWmonitorfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_event - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); - -/*! @brief Returns the available video modes for the specified monitor. - * - * This function 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), then by resolution area (the - * product of width and height), then resolution width and finally by refresh - * rate. - * - * @param[in] monitor The monitor to query. - * @param[out] count Where to store the number of video modes in the returned - * array. This is set to zero if an error occurred. - * @return An array of video modes, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_modes - * @sa @ref glfwGetVideoMode - * - * @since Added in version 1.0. - * @glfw3 Changed to return an array of modes for a specific monitor. - * - * @ingroup monitor - */ -GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count); - -/*! @brief Returns the current mode of the specified monitor. - * - * This function 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. - * - * @param[in] monitor The monitor to query. - * @return The current mode of the monitor, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_modes - * @sa @ref glfwGetVideoModes - * - * @since Added in version 3.0. Replaces `glfwGetDesktopMode`. - * - * @ingroup monitor - */ -GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); - -/*! @brief 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 @ref glfwSetGammaRamp 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 @ref - * GLFW_SRGB_CAPABLE hint. - * - * @param[in] monitor The monitor whose gamma ramp to set. - * @param[in] gamma The desired exponent. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. - * - * @remark @wayland Gamma handling is a privileged protocol, this function - * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_gamma - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); - -/*! @brief Returns the current gamma ramp for the specified monitor. - * - * This function returns the current gamma ramp of the specified monitor. - * - * @param[in] monitor The monitor to query. - * @return The current gamma ramp, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @wayland Gamma handling is a privileged protocol, this function - * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR while - * returning `NULL`. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_gamma - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); - -/*! @brief 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 @ref glfwTerminate. - * - * 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 @ref - * GLFW_SRGB_CAPABLE hint. - * - * @param[in] monitor The monitor whose gamma ramp to set. - * @param[in] ramp The gamma ramp to use. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark The size of the specified gamma ramp should match the size of the - * current ramp for that monitor. - * - * @remark @win32 The gamma ramp size must be 256. - * - * @remark @wayland Gamma handling is a privileged protocol, this function - * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The specified gamma ramp is copied before this function - * returns. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref monitor_gamma - * - * @since Added in version 3.0. - * - * @ingroup monitor - */ -GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp); - -/*! @brief Resets all window hints to their default values. - * - * This function resets all window hints to their - * [default values](@ref window_hints_values). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_hints - * @sa @ref glfwWindowHint - * @sa @ref glfwWindowHintString - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI void glfwDefaultWindowHints(void); - -/*! @brief Sets the specified window hint to the desired value. - * - * This function sets hints for the next call to @ref glfwCreateWindow. The - * hints, once set, retain their values until changed by a call to this - * function or @ref glfwDefaultWindowHints, or until the library is terminated. - * - * Only integer value hints can be set with this function. String value hints - * are set with @ref glfwWindowHintString. - * - * 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 @ref glfwCreateWindow. - * - * 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. - * - * @param[in] hint The [window hint](@ref window_hints) to set. - * @param[in] value The new value of the window hint. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_ENUM. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_hints - * @sa @ref glfwWindowHintString - * @sa @ref glfwDefaultWindowHints - * - * @since Added in version 3.0. Replaces `glfwOpenWindowHint`. - * - * @ingroup window - */ -GLFWAPI void glfwWindowHint(int hint, int value); - -/*! @brief Sets the specified window hint to the desired value. - * - * This function sets hints for the next call to @ref glfwCreateWindow. The - * hints, once set, retain their values until changed by a call to this - * function or @ref glfwDefaultWindowHints, or until the library is terminated. - * - * Only string type hints can be set with this function. Integer value hints - * are set with @ref glfwWindowHint. - * - * 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 @ref glfwCreateWindow. - * - * 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. - * - * @param[in] hint The [window hint](@ref window_hints) to set. - * @param[in] value The new value of the window hint. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_ENUM. - * - * @pointer_lifetime The specified string is copied before this function - * returns. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_hints - * @sa @ref glfwWindowHint - * @sa @ref glfwDefaultWindowHints - * - * @since Added in version 3.3. - * - * @ingroup window - */ -GLFWAPI void glfwWindowHintString(int hint, const char* value); - -/*! @brief Creates a window and its associated context. - * - * This function 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](@ref 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](@ref context_current). For information about the `share` - * parameter, see @ref context_sharing. - * - * The created window, framebuffer and context may differ from what you - * requested, as not all parameters and hints are - * [hard constraints](@ref window_hints_hard). This includes the size of the - * window, especially for full screen windows. To query the actual attributes - * of the created window, framebuffer and context, see @ref - * glfwGetWindowAttrib, @ref glfwGetWindowSize and @ref glfwGetFramebufferSize. - * - * 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 @ref monitor_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 @ref window_windowed_full_screen. - * - * Once you have created the window, you can switch it between windowed and - * full screen mode with @ref glfwSetWindowMonitor. This will not affect its - * OpenGL or OpenGL ES context. - * - * 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 [GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window - * hint, set its [position](@ref window_pos) and then [show](@ref window_hide) - * 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](@ref window_size) after creation. - * - * The [swap interval](@ref buffer_swap) is not set during window creation and - * the initial value may vary depending on driver settings and defaults. - * - * @param[in] width The desired width, in screen coordinates, of the window. - * This must be greater than zero. - * @param[in] height The desired height, in screen coordinates, of the window. - * This must be greater than zero. - * @param[in] title The initial, UTF-8 encoded window title. - * @param[in] monitor The monitor to use for full screen mode, or `NULL` for - * windowed mode. - * @param[in] share The window whose context to share resources with, or `NULL` - * to not share resources. - * @return The handle of the created window, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref - * GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @win32 Window creation will fail if the Microsoft GDI software - * OpenGL implementation is the only one available. - * - * @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it - * will be set as the initial icon for the window. If no such icon is present, - * the `IDI_APPLICATION` icon will be used instead. To set a different icon, - * see @ref glfwSetWindowIcon. - * - * @remark @win32 The context to share resources with must not be current on - * any other thread. - * - * @remark @macos 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 - * [GLFW_OPENGL_FORWARD_COMPAT](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) and - * [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint) hints accordingly. - * OpenGL 3.0 and 3.1 contexts are not supported at all on macOS. - * - * @remark @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](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) - * in the Mac Developer Library. - * - * @remark @macos The first time a window is created the menu bar is created. - * If GLFW finds a `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 @ref GLFW_COCOA_MENUBAR init hint. - * - * @remark @macos On OS X 10.10 and later the window frame will not be rendered - * at full resolution on Retina displays unless the - * [GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint) - * hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the - * application bundle's `Info.plist`. For more information, see - * [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html) - * in the Mac Developer Library. The GLFW test and example programs use - * a custom `Info.plist` template for this, which can be found as - * `CMake/MacOSXBundleInfo.plist.in` in the source tree. - * - * @remark @macos When activating frame autosaving with - * [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified - * window size and position may be overridden by previously saved values. - * - * @remark @x11 Some window managers will not respect the placement of - * initially hidden windows. - * - * @remark @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. - * - * @remark @x11 The class part of the `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 `RESOURCE_NAME` environment variable, if - * present and not empty, or fall back to the window title. Set the - * [GLFW_X11_CLASS_NAME](@ref GLFW_X11_CLASS_NAME_hint) and - * [GLFW_X11_INSTANCE_NAME](@ref GLFW_X11_INSTANCE_NAME_hint) window hints to - * override this. - * - * @remark @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 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. - * - * @remark @wayland A full screen window will not attempt to change the mode, - * no matter what the requested size or refresh rate. - * - * @remark @wayland Screensaver inhibition requires the idle-inhibit protocol - * to be implemented in the user's compositor. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_creation - * @sa @ref glfwDestroyWindow - * - * @since Added in version 3.0. Replaces `glfwOpenWindow`. - * - * @ingroup window - */ -GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share); - -/*! @brief Destroys the specified window and its context. - * - * This function 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. - * - * @param[in] window The window to destroy. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @note The context of the specified window must not be current on any other - * thread when this function is called. - * - * @reentrancy This function must not be called from a callback. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_creation - * @sa @ref glfwCreateWindow - * - * @since Added in version 3.0. Replaces `glfwCloseWindow`. - * - * @ingroup window - */ -GLFWAPI void glfwDestroyWindow(GLFWwindow* window); - -/*! @brief Checks the close flag of the specified window. - * - * This function returns the value of the close flag of the specified window. - * - * @param[in] window The window to query. - * @return The value of the close flag. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @sa @ref window_close - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI int glfwWindowShouldClose(GLFWwindow* window); - -/*! @brief Sets the close flag of the specified window. - * - * This function 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. - * - * @param[in] window The window whose flag to change. - * @param[in] value The new value. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @sa @ref window_close - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value); - -/*! @brief Sets the title of the specified window. - * - * This function sets the window title, encoded as UTF-8, of the specified - * window. - * - * @param[in] window The window whose title to change. - * @param[in] title The UTF-8 encoded window title. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @macos The window title will not be updated until the next time you - * process events. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_title - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title); - -/*! @brief 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. - * - * @param[in] window The window whose icon to set. - * @param[in] count The number of images in the specified array, or zero to - * revert to the default window icon. - * @param[in] images The images to create the icon from. This is ignored if - * count is zero. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The specified image data is copied before this function - * returns. - * - * @remark @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](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) - * in the Mac Developer Library. - * - * @remark @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 @ref GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_icon - * - * @since Added in version 3.2. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images); - -/*! @brief Retrieves the position of the content area of the specified window. - * - * This function 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 `NULL`. If an error occurs, all - * non-`NULL` position arguments will be set to zero. - * - * @param[in] window The window to query. - * @param[out] xpos Where to store the x-coordinate of the upper-left corner of - * the content area, or `NULL`. - * @param[out] ypos Where to store the y-coordinate of the upper-left corner of - * the content area, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @wayland There is no way for an application to retrieve the global - * position of its windows, this function will always emit @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_pos - * @sa @ref glfwSetWindowPos - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos); - -/*! @brief Sets the position of the content area of the specified window. - * - * This function 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. - * - * @param[in] window The window to query. - * @param[in] xpos The x-coordinate of the upper-left corner of the content area. - * @param[in] ypos The y-coordinate of the upper-left corner of the content area. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @wayland There is no way for an application to set the global - * position of its windows, this function will always emit @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_pos - * @sa @ref glfwGetWindowPos - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); - -/*! @brief Retrieves the size of the content area of the specified window. - * - * This function 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 @ref glfwGetFramebufferSize. - * - * Any or all of the size arguments may be `NULL`. If an error occurs, all - * non-`NULL` size arguments will be set to zero. - * - * @param[in] window The window whose size to retrieve. - * @param[out] width Where to store the width, in screen coordinates, of the - * content area, or `NULL`. - * @param[out] height Where to store the height, in screen coordinates, of the - * content area, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_size - * @sa @ref glfwSetWindowSize - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height); - -/*! @brief Sets the size limits of the specified window. - * - * This function sets the size limits of the content area of the specified - * window. If the window is full screen, the size limits only take effect - * 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. - * - * @param[in] window The window to set limits for. - * @param[in] minwidth The minimum width, in screen coordinates, of the content - * area, or `GLFW_DONT_CARE`. - * @param[in] minheight The minimum height, in screen coordinates, of the - * content area, or `GLFW_DONT_CARE`. - * @param[in] maxwidth The maximum width, in screen coordinates, of the content - * area, or `GLFW_DONT_CARE`. - * @param[in] maxheight The maximum height, in screen coordinates, of the - * content area, or `GLFW_DONT_CARE`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. - * - * @remark If you set size limits and an aspect ratio that conflict, the - * results are undefined. - * - * @remark @wayland The size limits will not be applied until the window is - * actually resized, either by the user or by the compositor. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_sizelimits - * @sa @ref glfwSetWindowAspectRatio - * - * @since Added in version 3.2. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight); - -/*! @brief Sets the aspect ratio of the specified window. - * - * This function 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 `GLFW_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. - * - * @param[in] window The window to set limits for. - * @param[in] numer The numerator of the desired aspect ratio, or - * `GLFW_DONT_CARE`. - * @param[in] denom The denominator of the desired aspect ratio, or - * `GLFW_DONT_CARE`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. - * - * @remark If you set size limits and an aspect ratio that conflict, the - * results are undefined. - * - * @remark @wayland The aspect ratio will not be applied until the window is - * actually resized, either by the user or by the compositor. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_sizelimits - * @sa @ref glfwSetWindowSizeLimits - * - * @since Added in version 3.2. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom); - -/*! @brief Sets the size of the content area of the specified window. - * - * This function sets the size, in screen coordinates, 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 @ref glfwSetWindowMonitor. - * - * The window manager may put limits on what sizes are allowed. GLFW cannot - * and should not override these limits. - * - * @param[in] window The window to resize. - * @param[in] width The desired width, in screen coordinates, of the window - * content area. - * @param[in] height The desired height, in screen coordinates, of the window - * content area. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @wayland A full screen window will not attempt to change the mode, - * no matter what the requested size. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_size - * @sa @ref glfwGetWindowSize - * @sa @ref glfwSetWindowMonitor - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height); - -/*! @brief Retrieves the size of the framebuffer of the specified window. - * - * This function 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 @ref glfwGetWindowSize. - * - * Any or all of the size arguments may be `NULL`. If an error occurs, all - * non-`NULL` size arguments will be set to zero. - * - * @param[in] window The window whose framebuffer to query. - * @param[out] width Where to store the width, in pixels, of the framebuffer, - * or `NULL`. - * @param[out] height Where to store the height, in pixels, of the framebuffer, - * or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_fbsize - * @sa @ref glfwSetFramebufferSizeCallback - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height); - -/*! @brief Retrieves the size of the frame of the window. - * - * This function 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](@ref window_hints_wnd) 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 `NULL`. If an error occurs, all - * non-`NULL` size arguments will be set to zero. - * - * @param[in] window The window whose frame size to query. - * @param[out] left Where to store the size, in screen coordinates, of the left - * edge of the window frame, or `NULL`. - * @param[out] top Where to store the size, in screen coordinates, of the top - * edge of the window frame, or `NULL`. - * @param[out] right Where to store the size, in screen coordinates, of the - * right edge of the window frame, or `NULL`. - * @param[out] bottom Where to store the size, in screen coordinates, of the - * bottom edge of the window frame, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_size - * - * @since Added in version 3.1. - * - * @ingroup window - */ -GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom); - -/*! @brief 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 monitors can have its own content scale, the window - * content scale will depend on which monitor the system considers the window - * to be on. - * - * @param[in] window The window to query. - * @param[out] xscale Where to store the x-axis content scale, or `NULL`. - * @param[out] yscale Where to store the y-axis content scale, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_scale - * @sa @ref glfwSetWindowContentScaleCallback - * @sa @ref glfwGetMonitorContentScale - * - * @since Added in version 3.3. - * - * @ingroup window - */ -GLFWAPI void glfwGetWindowContentScale(GLFWwindow* window, float* xscale, float* yscale); - -/*! @brief 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. - * - * @param[in] window The window to query. - * @return The opacity value of the specified window. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_transparency - * @sa @ref glfwSetWindowOpacity - * - * @since Added in version 3.3. - * - * @ingroup window - */ -GLFWAPI float glfwGetWindowOpacity(GLFWwindow* window); - -/*! @brief 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. - * - * @param[in] window The window to set the opacity for. - * @param[in] opacity The desired opacity of the specified window. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_transparency - * @sa @ref glfwGetWindowOpacity - * - * @since Added in version 3.3. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowOpacity(GLFWwindow* window, float opacity); - -/*! @brief Iconifies the specified window. - * - * This function 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. - * - * @param[in] window The window to iconify. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @wayland There is no concept of iconification in wl_shell, this - * function will emit @ref GLFW_PLATFORM_ERROR when using this deprecated - * protocol. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_iconify - * @sa @ref glfwRestoreWindow - * @sa @ref glfwMaximizeWindow - * - * @since Added in version 2.1. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -GLFWAPI void glfwIconifyWindow(GLFWwindow* window); - -/*! @brief Restores the specified window. - * - * This function 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. - * - * @param[in] window The window to restore. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_iconify - * @sa @ref glfwIconifyWindow - * @sa @ref glfwMaximizeWindow - * - * @since Added in version 2.1. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -GLFWAPI void glfwRestoreWindow(GLFWwindow* window); - -/*! @brief Maximizes the specified window. - * - * This function 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. - * - * @param[in] window The window to maximize. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_iconify - * @sa @ref glfwIconifyWindow - * @sa @ref glfwRestoreWindow - * - * @since Added in GLFW 3.2. - * - * @ingroup window - */ -GLFWAPI void glfwMaximizeWindow(GLFWwindow* window); - -/*! @brief Makes the specified window visible. - * - * This function 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 [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint - * to change this behavior for all newly created windows, or change the - * behavior for an existing window with @ref glfwSetWindowAttrib. - * - * @param[in] window The window to make visible. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_hide - * @sa @ref glfwHideWindow - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI void glfwShowWindow(GLFWwindow* window); - -/*! @brief Hides the specified window. - * - * This function 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. - * - * @param[in] window The window to hide. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_hide - * @sa @ref glfwShowWindow - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI void glfwHideWindow(GLFWwindow* window); - -/*! @brief Brings the specified window to front and sets input focus. - * - * This function 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 [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to - * disable this behavior. - * - * Also by default, windowed mode windows are focused when shown - * with @ref glfwShowWindow. Set the - * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_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 - * [attention requests](@ref window_attention). - * - * @param[in] window The window to give input focus. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @wayland It is not possible for an application to bring its windows - * to front, this function will always emit @ref GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_focus - * @sa @ref window_attention - * - * @since Added in version 3.2. - * - * @ingroup window - */ -GLFWAPI void glfwFocusWindow(GLFWwindow* window); - -/*! @brief 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. - * - * @param[in] window The window to request attention to. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @macos Attention is requested to the application as a whole, not the - * specific window. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_attention - * - * @since Added in version 3.3. - * - * @ingroup window - */ -GLFWAPI void glfwRequestWindowAttention(GLFWwindow* window); - -/*! @brief Returns the monitor that the window uses for full screen mode. - * - * This function returns the handle of the monitor that the specified window is - * in full screen on. - * - * @param[in] window The window to query. - * @return The monitor, or `NULL` if the window is in windowed mode or an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_monitor - * @sa @ref glfwSetWindowMonitor - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window); - -/*! @brief 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 `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 `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 @ref glfwSetWindowSize. - * - * 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. - * - * @param[in] window The window whose monitor, size or video mode to set. - * @param[in] monitor The desired monitor, or `NULL` to set windowed mode. - * @param[in] xpos The desired x-coordinate of the upper-left corner of the - * content area. - * @param[in] ypos The desired y-coordinate of the upper-left corner of the - * content area. - * @param[in] width The desired with, in screen coordinates, of the content - * area or video mode. - * @param[in] height The desired height, in screen coordinates, of the content - * area or video mode. - * @param[in] refreshRate The desired refresh rate, in Hz, of the video mode, - * or `GLFW_DONT_CARE`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark The OpenGL or OpenGL ES context will not be destroyed or otherwise - * affected by any resizing or mode switching, although you may need to update - * your viewport if the framebuffer size has changed. - * - * @remark @wayland The desired window position is ignored, as there is no way - * for an application to set this property. - * - * @remark @wayland Setting the window to full screen will not attempt to - * change the mode, no matter what the requested size or refresh rate. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_monitor - * @sa @ref window_full_screen - * @sa @ref glfwGetWindowMonitor - * @sa @ref glfwSetWindowSize - * - * @since Added in version 3.2. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); - -/*! @brief Returns an attribute of the specified window. - * - * This function returns the value of an attribute of the specified window or - * its OpenGL or OpenGL ES context. - * - * @param[in] window The window to query. - * @param[in] attrib The [window attribute](@ref window_attribs) whose value to - * return. - * @return The value of the attribute, or zero if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @remark Framebuffer related hints are not window attributes. See @ref - * window_attribs_fb for more information. - * - * @remark 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](@ref intro_init). - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_attribs - * @sa @ref glfwSetWindowAttrib - * - * @since Added in version 3.0. Replaces `glfwGetWindowParam` and - * `glfwGetGLVersion`. - * - * @ingroup window - */ -GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); - -/*! @brief Sets an attribute of the specified window. - * - * This function sets the value of an attribute of the specified window. - * - * The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib), - * [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib), - * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib), - * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and - * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib). - * - * 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. - * - * @param[in] window The window to set the attribute for. - * @param[in] attrib A supported window attribute. - * @param[in] value `GLFW_TRUE` or `GLFW_FALSE`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. - * - * @remark Calling @ref glfwGetWindowAttrib will always return the latest - * value, even if that value is ignored by the current mode of the window. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_attribs - * @sa @ref glfwGetWindowAttrib - * - * @since Added in version 3.3. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowAttrib(GLFWwindow* window, int attrib, int value); - -/*! @brief Sets the user pointer of the specified window. - * - * This function sets the user-defined pointer of the specified window. The - * current value is retained until the window is destroyed. The initial value - * is `NULL`. - * - * @param[in] window The window whose pointer to set. - * @param[in] pointer The new value. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @sa @ref window_userptr - * @sa @ref glfwGetWindowUserPointer - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer); - -/*! @brief Returns the user pointer of the specified window. - * - * This function returns the current value of the user-defined pointer of the - * specified window. The initial value is `NULL`. - * - * @param[in] window The window whose pointer to return. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @sa @ref window_userptr - * @sa @ref glfwSetWindowUserPointer - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); - -/*! @brief Sets the position callback for the specified window. - * - * This function 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. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int xpos, int ypos) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWwindowposfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @remark @wayland This callback will never be called, as there is no way for - * an application to know its global position. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_pos - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun callback); - -/*! @brief Sets the size callback for the specified window. - * - * This function 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. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int width, int height) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWwindowsizefun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_size - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter and return value. - * - * @ingroup window - */ -GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun callback); - -/*! @brief Sets the close callback for the specified window. - * - * This function 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 @ref glfwSetWindowShouldClose. - * - * The close callback is not triggered by @ref glfwDestroyWindow. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWwindowclosefun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @remark @macos Selecting Quit from the application menu will trigger the - * close callback for all windows. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_close - * - * @since Added in version 2.5. - * @glfw3 Added window handle parameter and return value. - * - * @ingroup window - */ -GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun callback); - -/*! @brief Sets the refresh callback for the specified window. - * - * This function 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, Aqua or Wayland, where - * the window contents are saved off-screen, this callback may be called only - * very infrequently or never at all. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window); - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWwindowrefreshfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_refresh - * - * @since Added in version 2.5. - * @glfw3 Added window handle parameter and return value. - * - * @ingroup window - */ -GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun callback); - -/*! @brief Sets the focus callback for the specified window. - * - * This function 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 @ref glfwSetKeyCallback - * and @ref glfwSetMouseButtonCallback. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int focused) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWwindowfocusfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_focus - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun callback); - -/*! @brief Sets the iconify callback for the specified window. - * - * This function sets the iconification callback of the specified window, which - * is called when the window is iconified or restored. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int iconified) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWwindowiconifyfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @remark @wayland The wl_shell protocol has no concept of iconification, - * this callback will never be called when using this deprecated protocol. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_iconify - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun callback); - -/*! @brief Sets the maximize callback for the specified window. - * - * This function sets the maximization callback of the specified window, which - * is called when the window is maximized or restored. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int maximized) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWwindowmaximizefun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_maximize - * - * @since Added in version 3.3. - * - * @ingroup window - */ -GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun callback); - -/*! @brief Sets the framebuffer resize callback for the specified window. - * - * This function sets the framebuffer resize callback of the specified window, - * which is called when the framebuffer of the specified window is resized. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int width, int height) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWframebuffersizefun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_fbsize - * - * @since Added in version 3.0. - * - * @ingroup window - */ -GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun callback); - -/*! @brief Sets the window content scale callback for the specified window. - * - * This function sets the window content scale callback of the specified window, - * which is called when the content scale of the specified window changes. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, float xscale, float yscale) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWwindowcontentscalefun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref window_scale - * @sa @ref glfwGetWindowContentScale - * - * @since Added in version 3.3. - * - * @ingroup window - */ -GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun callback); - -/*! @brief 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](@ref window_refresh) to redraw the contents of - * your window when necessary during such operations. - * - * Do not assume that callbacks you set will _only_ be called in response to - * event processing functions like this one. While it is necessary to poll for - * events, window systems that require GLFW to register callbacks of its own - * can pass events to GLFW in response to many window system function calls. - * GLFW will pass those events on to the application callbacks before - * returning. - * - * Event processing is not required for joystick input to work. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @reentrancy This function must not be called from a callback. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref events - * @sa @ref glfwWaitEvents - * @sa @ref glfwWaitEventsTimeout - * - * @since Added in version 1.0. - * - * @ingroup window - */ -GLFWAPI void glfwPollEvents(void); - -/*! @brief 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 @ref glfwPollEvents, 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](@ref window_refresh) to redraw the contents of - * your window when necessary during such operations. - * - * Do not assume that callbacks you set will _only_ be called in response to - * event processing functions like this one. While it is necessary to poll for - * events, window systems that require GLFW to register callbacks of its own - * can pass events to GLFW in response to many window system function calls. - * GLFW will pass those events on to the application callbacks before - * returning. - * - * Event processing is not required for joystick input to work. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @reentrancy This function must not be called from a callback. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref events - * @sa @ref glfwPollEvents - * @sa @ref glfwWaitEventsTimeout - * - * @since Added in version 2.5. - * - * @ingroup window - */ -GLFWAPI void glfwWaitEvents(void); - -/*! @brief 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 @ref - * glfwPollEvents, 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](@ref window_refresh) to redraw the contents of - * your window when necessary during such operations. - * - * Do not assume that callbacks you set will _only_ be called in response to - * event processing functions like this one. While it is necessary to poll for - * events, window systems that require GLFW to register callbacks of its own - * can pass events to GLFW in response to many window system function calls. - * GLFW will pass those events on to the application callbacks before - * returning. - * - * Event processing is not required for joystick input to work. - * - * @param[in] timeout The maximum amount of time, in seconds, to wait. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. - * - * @reentrancy This function must not be called from a callback. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref events - * @sa @ref glfwPollEvents - * @sa @ref glfwWaitEvents - * - * @since Added in version 3.2. - * - * @ingroup window - */ -GLFWAPI void glfwWaitEventsTimeout(double timeout); - -/*! @brief Posts an empty event to the event queue. - * - * This function posts an empty event from the current thread to the event - * queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref events - * @sa @ref glfwWaitEvents - * @sa @ref glfwWaitEventsTimeout - * - * @since Added in version 3.1. - * - * @ingroup window - */ -GLFWAPI void glfwPostEmptyEvent(void); - -/*! @brief Returns the value of an input option for the specified window. - * - * This function returns the value of an input option for the specified window. - * The mode must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS, - * @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or - * @ref GLFW_RAW_MOUSE_MOTION. - * - * @param[in] window The window to query. - * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`, - * `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or - * `GLFW_RAW_MOUSE_MOTION`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_ENUM. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref glfwSetInputMode - * - * @since Added in version 3.0. - * - * @ingroup input - */ -GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode); - -/*! @brief Sets an input option for the specified window. - * - * This function sets an input mode option for the specified window. The mode - * must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS, - * @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or - * @ref GLFW_RAW_MOUSE_MOTION. - * - * If the mode is `GLFW_CURSOR`, the value must be one of the following cursor - * modes: - * - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally. - * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the - * content area of the window but does not restrict the cursor from leaving. - * - `GLFW_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 mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to - * enable sticky keys, or `GLFW_FALSE` to disable it. If sticky keys are - * enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_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 mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either - * `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it. - * If sticky mouse buttons are enabled, a mouse button press will ensure that - * @ref glfwGetMouseButton returns `GLFW_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 mode is `GLFW_LOCK_KEY_MODS`, the value must be either `GLFW_TRUE` to - * enable lock key modifier bits, or `GLFW_FALSE` to disable them. If enabled, - * callbacks that receive modifier bits will also have the @ref - * GLFW_MOD_CAPS_LOCK bit set when the event was generated with Caps Lock on, - * and the @ref GLFW_MOD_NUM_LOCK bit when Num Lock was on. - * - * If the mode is `GLFW_RAW_MOUSE_MOTION`, the value must be either `GLFW_TRUE` - * to enable raw (unscaled and unaccelerated) mouse motion when the cursor is - * disabled, or `GLFW_FALSE` to disable it. If raw motion is not supported, - * attempting to set this will emit @ref GLFW_PLATFORM_ERROR. Call @ref - * glfwRawMouseMotionSupported to check for support. - * - * @param[in] window The window whose input mode to set. - * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`, - * `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or - * `GLFW_RAW_MOUSE_MOTION`. - * @param[in] value The new value of the specified input mode. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref glfwGetInputMode - * - * @since Added in version 3.0. Replaces `glfwEnable` and `glfwDisable`. - * - * @ingroup input - */ -GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value); - -/** - * For FCL, set injector callback. - */ -GLFWAPI FCLinjectorfun glfwSetInjectorCallback(FCLinjectorfun callback); - -/** - * For FCL, set type of what player's cursor point to - * @param type Hit result type - */ -GLFWAPI void glfwSetHitResultType(int type); - -/*! @brief 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, @ref GLFW_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. - * - * @return `GLFW_TRUE` if raw mouse motion is supported on the current machine, - * or `GLFW_FALSE` otherwise. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref raw_mouse_motion - * @sa @ref glfwSetInputMode - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI int glfwRawMouseMotionSupported(void); - -/*! @brief 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](@ref input_char). You will - * break text input for many languages even if it happens to work for yours. - * - * If the key is `GLFW_KEY_UNKNOWN`, the scancode is used to identify the key, - * otherwise the scancode is ignored. If you specify a non-printable key, or - * `GLFW_KEY_UNKNOWN` and a scancode that maps to a non-printable key, this - * function returns `NULL` but does not emit an error. - * - * This behavior allows you to always pass in the arguments in the - * [key callback](@ref input_key) without modification. - * - * The printable keys are: - * - `GLFW_KEY_APOSTROPHE` - * - `GLFW_KEY_COMMA` - * - `GLFW_KEY_MINUS` - * - `GLFW_KEY_PERIOD` - * - `GLFW_KEY_SLASH` - * - `GLFW_KEY_SEMICOLON` - * - `GLFW_KEY_EQUAL` - * - `GLFW_KEY_LEFT_BRACKET` - * - `GLFW_KEY_RIGHT_BRACKET` - * - `GLFW_KEY_BACKSLASH` - * - `GLFW_KEY_WORLD_1` - * - `GLFW_KEY_WORLD_2` - * - `GLFW_KEY_0` to `GLFW_KEY_9` - * - `GLFW_KEY_A` to `GLFW_KEY_Z` - * - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9` - * - `GLFW_KEY_KP_DECIMAL` - * - `GLFW_KEY_KP_DIVIDE` - * - `GLFW_KEY_KP_MULTIPLY` - * - `GLFW_KEY_KP_SUBTRACT` - * - `GLFW_KEY_KP_ADD` - * - `GLFW_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. - * - * @param[in] key The key to query, or `GLFW_KEY_UNKNOWN`. - * @param[in] scancode The scancode of the key to query. - * @return The UTF-8 encoded, layout-specific name of the key, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark The contents of the returned string may change when a keyboard - * layout change event is received. - * - * @pointer_lifetime The returned string is allocated and freed by GLFW. You - * should not free it yourself. It is valid until the library is terminated. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref input_key_name - * - * @since Added in version 3.2. - * - * @ingroup input - */ -GLFWAPI const char* glfwGetKeyName(int key, int scancode); - -/*! @brief Returns the platform-specific scancode of the specified key. - * - * This function returns the platform-specific scancode of the specified key. - * - * If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this - * method will return `-1`. - * - * @param[in] key Any [named key](@ref keys). - * @return The platform-specific scancode for the key, or `-1` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref input_key - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI int glfwGetKeyScancode(int key); - -/*! @brief Returns the last reported state of a keyboard key for the specified - * window. - * - * This function returns the last state reported for the specified key to the - * specified window. The returned state is one of `GLFW_PRESS` or - * `GLFW_RELEASE`. The higher-level action `GLFW_REPEAT` is only reported to - * the key callback. - * - * If the @ref GLFW_STICKY_KEYS input mode is enabled, this function returns - * `GLFW_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](@ref keys) - * 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](@ref mods) are not key tokens and cannot be - * used with this function. - * - * __Do not use this function__ to implement [text input](@ref input_char). - * - * @param[in] window The desired window. - * @param[in] key The desired [keyboard key](@ref keys). `GLFW_KEY_UNKNOWN` is - * not a valid key for this function. - * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_ENUM. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref input_key - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter. - * - * @ingroup input - */ -GLFWAPI int glfwGetKey(GLFWwindow* window, int key); - -/*! @brief Returns the last reported state of a mouse button for the specified - * window. - * - * This function returns the last state reported for the specified mouse button - * to the specified window. The returned state is one of `GLFW_PRESS` or - * `GLFW_RELEASE`. - * - * If the @ref GLFW_STICKY_MOUSE_BUTTONS input mode is enabled, this function - * returns `GLFW_PRESS` the first time you call it for a mouse button that was - * pressed, even if that mouse button has already been released. - * - * @param[in] window The desired window. - * @param[in] button The desired [mouse button](@ref buttons). - * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_ENUM. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref input_mouse_button - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter. - * - * @ingroup input - */ -GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); - -/*! @brief Retrieves the position of the cursor relative to the content area of - * the window. - * - * This function 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 `GLFW_CURSOR_DISABLED`) then the cursor - * position is unbounded and limited only by the minimum and maximum values of - * a `double`. - * - * The coordinate can be converted to their integer equivalents with the - * `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 `NULL`. If an error occurs, all - * non-`NULL` position arguments will be set to zero. - * - * @param[in] window The desired window. - * @param[out] xpos Where to store the cursor x-coordinate, relative to the - * left edge of the content area, or `NULL`. - * @param[out] ypos Where to store the cursor y-coordinate, relative to the to - * top edge of the content area, or `NULL`. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref cursor_pos - * @sa @ref glfwSetCursorPos - * - * @since Added in version 3.0. Replaces `glfwGetMousePos`. - * - * @ingroup input - */ -GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); - -/*! @brief Sets the position of the cursor, relative to the content area of the - * window. - * - * This function 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 `GLFW_CURSOR_DISABLED` cursor mode that hides the - * cursor, transparently re-centers it and provides unconstrained cursor - * motion. See @ref glfwSetInputMode for more information. - * - * If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is - * unconstrained and limited only by the minimum and maximum values of - * a `double`. - * - * @param[in] window The desired window. - * @param[in] xpos The desired x-coordinate, relative to the left edge of the - * content area. - * @param[in] ypos The desired y-coordinate, relative to the top edge of the - * content area. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @remark @wayland This function will only work when the cursor mode is - * `GLFW_CURSOR_DISABLED`, otherwise it will do nothing. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref cursor_pos - * @sa @ref glfwGetCursorPos - * - * @since Added in version 3.0. Replaces `glfwSetMousePos`. - * - * @ingroup input - */ -GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); - -/*! @brief Creates a custom cursor. - * - * Creates a new custom cursor image that can be set for a window with @ref - * glfwSetCursor. The cursor can be destroyed with @ref glfwDestroyCursor. - * Any remaining cursors are destroyed by @ref glfwTerminate. - * - * 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. - * - * @param[in] image The desired cursor image. - * @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot. - * @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot. - * @return The handle of the created cursor, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The specified image data is copied before this function - * returns. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref cursor_object - * @sa @ref glfwDestroyCursor - * @sa @ref glfwCreateStandardCursor - * - * @since Added in version 3.1. - * - * @ingroup input - */ -GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot); - -/*! @brief Creates a cursor with a standard shape. - * - * Returns a cursor with a [standard shape](@ref shapes), that can be set for - * a window with @ref glfwSetCursor. - * - * @param[in] shape One of the [standard shapes](@ref shapes). - * @return A new cursor ready to use or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref cursor_object - * @sa @ref glfwCreateCursor - * - * @since Added in version 3.1. - * - * @ingroup input - */ -GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape); - -/*! @brief Destroys a cursor. - * - * This function destroys a cursor previously created with @ref - * glfwCreateCursor. Any remaining cursors will be destroyed by @ref - * glfwTerminate. - * - * If the specified cursor is current for any window, that window will be - * reverted to the default cursor. This does not affect the cursor mode. - * - * @param[in] cursor The cursor object to destroy. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @reentrancy This function must not be called from a callback. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref cursor_object - * @sa @ref glfwCreateCursor - * - * @since Added in version 3.1. - * - * @ingroup input - */ -GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor); - -/*! @brief Sets the cursor for the window. - * - * This function 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](@ref cursor_mode) of the window is - * `GLFW_CURSOR_NORMAL`. - * - * On some platforms, the set cursor may not be visible unless the window also - * has input focus. - * - * @param[in] window The window to set the cursor for. - * @param[in] cursor The cursor to set, or `NULL` to switch back to the default - * arrow cursor. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref cursor_object - * - * @since Added in version 3.1. - * - * @ingroup input - */ -GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); - -/*! @brief Sets the key callback. - * - * This function 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](@ref keys) named after their values in the standard US keyboard - * layout. If you want to input text, use the - * [character callback](@ref glfwSetCharCallback) 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](@ref glfwSetWindowFocusCallback) 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 `key` set to `GLFW_KEY_UNKNOWN`, their - * state is not saved and so it cannot be queried with @ref glfwGetKey. - * - * Sometimes GLFW needs to generate synthetic key events, in which case the - * scancode may be zero. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new key callback, or `NULL` to remove the currently - * set callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWkeyfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref input_key - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter and return value. - * - * @ingroup input - */ -GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun callback); - -/*! @brief Sets the Unicode character callback. - * - * This function 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 the - * [key callback](@ref glfwSetKeyCallback) 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. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, unsigned int codepoint) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWcharfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref input_char - * - * @since Added in version 2.4. - * @glfw3 Added window handle parameter and return value. - * - * @ingroup input - */ -GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun callback); - -/*! @brief Sets the Unicode character with modifiers callback. - * - * This function 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 the - * [character callback](@ref glfwSetCharCallback). 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 the - * [key callback](@ref glfwSetKeyCallback) instead. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or an - * [error](@ref error_handling) occurred. - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, unsigned int codepoint, int mods) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWcharmodsfun). - * - * @deprecated Scheduled for removal in version 4.0. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref input_char - * - * @since Added in version 3.1. - * - * @ingroup input - */ -GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun callback); - -/*! @brief Sets the mouse button callback. - * - * This function 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](@ref glfwSetWindowFocusCallback) has been called. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int button, int action, int mods) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWmousebuttonfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref input_mouse_button - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter and return value. - * - * @ingroup input - */ -GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun callback); - -/*! @brief Sets the cursor position callback. - * - * This function 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. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, double xpos, double ypos); - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWcursorposfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref cursor_pos - * - * @since Added in version 3.0. Replaces `glfwSetMousePosCallback`. - * - * @ingroup input - */ -GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun callback); - -/*! @brief Sets the cursor enter/leave callback. - * - * This function 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. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int entered) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWcursorenterfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref cursor_enter - * - * @since Added in version 3.0. - * - * @ingroup input - */ -GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun callback); - -/*! @brief Sets the scroll callback. - * - * This function sets the scroll callback of the specified window, which is - * called when a scrolling device is used, such as a mouse wheel or scrolling - * area of a touchpad. - * - * The scroll callback receives all scrolling input, like that from a mouse - * wheel or a touchpad scrolling area. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new scroll callback, or `NULL` to remove the - * currently set callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, double xoffset, double yoffset) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWscrollfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref scrolling - * - * @since Added in version 3.0. Replaces `glfwSetMouseWheelCallback`. - * - * @ingroup input - */ -GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun callback); - -/*! @brief Sets the path drop callback. - * - * This function sets the path drop callback of the specified window, which is - * called when one or more dragged paths 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. - * - * @param[in] window The window whose callback to set. - * @param[in] callback The new file drop callback, or `NULL` to remove the - * currently set callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(GLFWwindow* window, int path_count, const char* paths[]) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWdropfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @remark @wayland File drop is currently unimplemented. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref path_drop - * - * @since Added in version 3.1. - * - * @ingroup input - */ -GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun callback); - -/*! @brief Returns whether the specified joystick is present. - * - * This function returns whether the specified joystick is present. - * - * There is no need to call this function before other functions that accept - * a joystick ID, as they all check for presence before performing any other - * work. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref joystick - * - * @since Added in version 3.0. Replaces `glfwGetJoystickParam`. - * - * @ingroup input - */ -GLFWAPI int glfwJoystickPresent(int jid); - -/*! @brief Returns the values of all axes of the specified joystick. - * - * This function 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 `NULL` - * but will not generate an error. This can be used instead of first calling - * @ref glfwJoystickPresent. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @param[out] count Where to store the number of axis values in the returned - * array. This is set to zero if the joystick is not present or an error - * occurred. - * @return An array of axis values, or `NULL` if the joystick is not present or - * an [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The returned array 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref joystick_axis - * - * @since Added in version 3.0. Replaces `glfwGetJoystickPos`. - * - * @ingroup input - */ -GLFWAPI const float* glfwGetJoystickAxes(int jid, int* count); - -/*! @brief Returns the state of all buttons of the specified joystick. - * - * This function returns the state of all buttons of the specified joystick. - * Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`. - * - * For backward compatibility with earlier versions that did not have @ref - * glfwGetJoystickHats, the button array also includes all hats, each - * represented as four buttons. The hats are in the same order as returned by - * __glfwGetJoystickHats__ and are in the order _up_, _right_, _down_ and - * _left_. To disable these extra buttons, set the @ref - * GLFW_JOYSTICK_HAT_BUTTONS init hint before initialization. - * - * If the specified joystick is not present this function will return `NULL` - * but will not generate an error. This can be used instead of first calling - * @ref glfwJoystickPresent. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @param[out] count Where to store the number of button states in the returned - * array. This is set to zero if the joystick is not present or an error - * occurred. - * @return An array of button states, or `NULL` if the joystick is not present - * or an [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The returned array 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref joystick_button - * - * @since Added in version 2.2. - * @glfw3 Changed to return a dynamic array. - * - * @ingroup input - */ -GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count); - -/*! @brief 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. - * - * @code - * if (hats[2] & GLFW_HAT_RIGHT) - * { - * // State of hat 2 could be right-up, right or right-down - * } - * @endcode - * - * If the specified joystick is not present this function will return `NULL` - * but will not generate an error. This can be used instead of first calling - * @ref glfwJoystickPresent. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @param[out] count Where to store the number of hat states in the returned - * array. This is set to zero if the joystick is not present or an error - * occurred. - * @return An array of hat states, or `NULL` if the joystick is not present - * or an [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref joystick_hat - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count); - -/*! @brief Returns the name of the specified joystick. - * - * This function returns the name, encoded as UTF-8, of the specified joystick. - * The returned string is allocated and freed by GLFW. You should not free it - * yourself. - * - * If the specified joystick is not present this function will return `NULL` - * but will not generate an error. This can be used instead of first calling - * @ref glfwJoystickPresent. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick - * is not present or an [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref joystick_name - * - * @since Added in version 3.0. - * - * @ingroup input - */ -GLFWAPI const char* glfwGetJoystickName(int jid); - -/*! @brief Returns the SDL compatible GUID of the specified joystick. - * - * This function returns the SDL compatible GUID, as a UTF-8 encoded - * hexadecimal string, of the specified joystick. The returned string is - * allocated and freed by GLFW. You should not free it yourself. - * - * 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. - * - * If the specified joystick is not present this function will return `NULL` - * but will not generate an error. This can be used instead of first calling - * @ref glfwJoystickPresent. - * - * 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. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @return The UTF-8 encoded GUID of the joystick, or `NULL` if the joystick - * is not present or an [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref gamepad - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI const char* glfwGetJoystickGUID(int jid); - -/*! @brief 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 `NULL`. - * - * This function may be called from the joystick callback, even for a joystick - * that is being disconnected. - * - * @param[in] jid The joystick whose pointer to set. - * @param[in] pointer The new value. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @sa @ref joystick_userptr - * @sa @ref glfwGetJoystickUserPointer - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI void glfwSetJoystickUserPointer(int jid, void* pointer); - -/*! @brief 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 `NULL`. - * - * This function may be called from the joystick callback, even for a joystick - * that is being disconnected. - * - * @param[in] jid The joystick whose pointer to return. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @sa @ref joystick_userptr - * @sa @ref glfwSetJoystickUserPointer - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI void* glfwGetJoystickUserPointer(int jid); - -/*! @brief Returns whether the specified joystick has a gamepad mapping. - * - * This function 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 `GLFW_FALSE` but will not generate an error. Call - * @ref glfwJoystickPresent to check if a joystick is present regardless of - * whether it has a mapping. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @return `GLFW_TRUE` if a joystick is both present and has a gamepad mapping, - * or `GLFW_FALSE` otherwise. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_ENUM. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref gamepad - * @sa @ref glfwGetGamepadState - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI int glfwJoystickIsGamepad(int jid); - -/*! @brief Sets the joystick configuration callback. - * - * This function 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](@ref events) - * 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. - * - * @param[in] callback The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @callback_signature - * @code - * void function_name(int jid, int event) - * @endcode - * For more information about the callback parameters, see the - * [function pointer type](@ref GLFWjoystickfun). - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref joystick_event - * - * @since Added in version 3.2. - * - * @ingroup input - */ -GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback); - -/*! @brief 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 `gamecontrollerdb.txt` - * source file including empty lines and comments. - * - * See @ref 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. - * - * @param[in] string The string containing the gamepad mappings. - * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_VALUE. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref gamepad - * @sa @ref glfwJoystickIsGamepad - * @sa @ref glfwGetGamepadName - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI int glfwUpdateGamepadMappings(const char* string); - -/*! @brief Returns the human-readable gamepad name for the specified joystick. - * - * This function 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 `NULL` but will not generate an error. Call - * @ref glfwJoystickPresent to check whether it is present regardless of - * whether it has a mapping. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @return The UTF-8 encoded name of the gamepad, or `NULL` if the - * joystick is not present, does not have a mapping or an - * [error](@ref error_handling) occurred. - * - * @pointer_lifetime 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. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref gamepad - * @sa @ref glfwJoystickIsGamepad - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI const char* glfwGetGamepadName(int jid); - -/*! @brief Retrieves the state of the specified joystick remapped as a gamepad. - * - * This function 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 `GLFW_FALSE` but will not generate an error. Call - * @ref glfwJoystickPresent 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 @ref - * GLFWgamepadstate. Unavailable buttons and axes will always report - * `GLFW_RELEASE` and 0.0 respectively. - * - * @param[in] jid The [joystick](@ref joysticks) to query. - * @param[out] state The gamepad input state of the joystick. - * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if no joystick is - * connected, it has no gamepad mapping or an [error](@ref error_handling) - * occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_ENUM. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref gamepad - * @sa @ref glfwUpdateGamepadMappings - * @sa @ref glfwJoystickIsGamepad - * - * @since Added in version 3.3. - * - * @ingroup input - */ -GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state); - -/*! @brief Sets the clipboard to the specified string. - * - * This function sets the system clipboard to the specified, UTF-8 encoded - * string. - * - * @param[in] window Deprecated. Any valid window or `NULL`. - * @param[in] string A UTF-8 encoded string. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The specified string is copied before this function - * returns. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref clipboard - * @sa @ref glfwGetClipboardString - * - * @since Added in version 3.0. - * - * @ingroup input - */ -GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); - -/*! @brief Returns the contents of the clipboard as a string. - * - * This function 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, `NULL` is returned and a @ref - * GLFW_FORMAT_UNAVAILABLE error is generated. - * - * @param[in] window Deprecated. Any valid window or `NULL`. - * @return The contents of the clipboard as a UTF-8 encoded string, or `NULL` - * if an [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The returned string is allocated and freed by GLFW. You - * should not free it yourself. It is valid until the next call to @ref - * glfwGetClipboardString or @ref glfwSetClipboardString, or until the library - * is terminated. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref clipboard - * @sa @ref glfwSetClipboardString - * - * @since Added in version 3.0. - * - * @ingroup input - */ -GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); - -/*! @brief Returns the GLFW time. - * - * This function returns the current GLFW time, in seconds. Unless the time - * has been set using @ref glfwSetTime it measures time elapsed since GLFW was - * initialized. - * - * This function and @ref glfwSetTime are helper functions on top of @ref - * glfwGetTimerFrequency and @ref glfwGetTimerValue. - * - * 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. - * - * @return The current time, in seconds, or zero if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. Reading and - * writing of the internal base time is not atomic, so it needs to be - * externally synchronized with calls to @ref glfwSetTime. - * - * @sa @ref time - * - * @since Added in version 1.0. - * - * @ingroup input - */ -GLFWAPI double glfwGetTime(void); - -/*! @brief Sets the GLFW time. - * - * This function sets the current GLFW time, in seconds. The value must be - * a positive finite number less than or equal to 18446744073.0, which is - * approximately 584.5 years. - * - * This function and @ref glfwGetTime are helper functions on top of @ref - * glfwGetTimerFrequency and @ref glfwGetTimerValue. - * - * @param[in] time The new value, in seconds. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_INVALID_VALUE. - * - * @remark The upper limit of GLFW time 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. - * - * @thread_safety This function may be called from any thread. Reading and - * writing of the internal base time is not atomic, so it needs to be - * externally synchronized with calls to @ref glfwGetTime. - * - * @sa @ref time - * - * @since Added in version 2.2. - * - * @ingroup input - */ -GLFWAPI void glfwSetTime(double time); - -/*! @brief Returns the current value of the raw timer. - * - * This function returns the current value of the raw timer, measured in - * 1 / frequency seconds. To get the frequency, call @ref - * glfwGetTimerFrequency. - * - * @return The value of the timer, or zero if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref time - * @sa @ref glfwGetTimerFrequency - * - * @since Added in version 3.2. - * - * @ingroup input - */ -GLFWAPI uint64_t glfwGetTimerValue(void); - -/*! @brief Returns the frequency, in Hz, of the raw timer. - * - * This function returns the frequency, in Hz, of the raw timer. - * - * @return The frequency of the timer, in Hz, or zero if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref time - * @sa @ref glfwGetTimerValue - * - * @since Added in version 3.2. - * - * @ingroup input - */ -GLFWAPI uint64_t glfwGetTimerFrequency(void); - -/*! - * This function is to get OSMesa width - */ -GLFWAPI int glfwGetOSMesaWidth(); - -/*! - * This function is to get OSMesa height - */ -GLFWAPI int glfwGetOSMesaHeight(); - -/*! - * This function is to get OSMesa Current Context - */ -GLFWAPI void* glfwGetOSMesaCurrentContext(); - -/*! - * This function is to get Graphic Buffers Addr - */ -GLFWAPI long glfwGetGraphicBuffersAddr(GLFWwindow* window); - -/*! @brief Makes the context of the specified window current for the calling - * thread. - * - * This function 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 - * [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) - * hint. - * - * The specified window must have an OpenGL or OpenGL ES context. Specifying - * a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT - * error. - * - * @param[in] window The window whose context to make current, or `NULL` to - * detach the current context. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref context_current - * @sa @ref glfwGetCurrentContext - * - * @since Added in version 3.0. - * - * @ingroup context - */ -GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window); - -/*! @brief Returns the window whose context is current on the calling thread. - * - * This function returns the window whose OpenGL or OpenGL ES context is - * current on the calling thread. - * - * @return The window whose context is current, or `NULL` if no window's - * context is current. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref context_current - * @sa @ref glfwMakeContextCurrent - * - * @since Added in version 3.0. - * - * @ingroup context - */ -GLFWAPI GLFWwindow* glfwGetCurrentContext(void); - -/*! @brief Swaps the front and back buffers of the specified window. - * - * This function 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 @ref GLFW_NO_WINDOW_CONTEXT - * error. - * - * This function does not apply to Vulkan. If you are rendering with Vulkan, - * see `vkQueuePresentKHR` instead. - * - * @param[in] window The window whose buffers to swap. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR. - * - * @remark __EGL:__ The context of the specified window must be current on the - * calling thread. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref buffer_swap - * @sa @ref glfwSwapInterval - * - * @since Added in version 1.0. - * @glfw3 Added window handle parameter. - * - * @ingroup window - */ -GLFWAPI void glfwSwapBuffers(GLFWwindow* window); - -/*! @brief Sets the swap interval for the current context. - * - * This function sets the swap interval for the current OpenGL or OpenGL ES - * context, i.e. the number of screen updates to wait from the time @ref - * glfwSwapBuffers 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 @ref - * glfwExtensionSupported. - * - * A context must be current on the calling thread. Calling this function - * without a current context will cause a @ref GLFW_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. - * - * @param[in] interval The minimum number of screen updates to wait for - * until the buffers are swapped by @ref glfwSwapBuffers. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR. - * - * @remark This function is not called during context 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. - * - * @remark 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. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref buffer_swap - * @sa @ref glfwSwapBuffers - * - * @since Added in version 1.0. - * - * @ingroup context - */ -GLFWAPI void glfwSwapInterval(int interval); - -/*! @brief Returns whether the specified extension is available. - * - * This function returns whether the specified - * [API extension](@ref context_glext) 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 @ref GLFW_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 @ref - * glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties` - * and `vkEnumerateDeviceExtensionProperties` instead. - * - * @param[in] extension The ASCII encoded name of the extension. - * @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE` - * otherwise. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_NO_CURRENT_CONTEXT, @ref GLFW_INVALID_VALUE and @ref - * GLFW_PLATFORM_ERROR. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref context_glext - * @sa @ref glfwGetProcAddress - * - * @since Added in version 1.0. - * - * @ingroup context - */ -GLFWAPI int glfwExtensionSupported(const char* extension); - -/*! @brief Returns the address of the specified function for the current - * context. - * - * This function returns the address of the specified OpenGL or OpenGL ES - * [core or extension function](@ref context_glext), 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 @ref GLFW_NO_CURRENT_CONTEXT error. - * - * This function does not apply to Vulkan. If you are rendering with Vulkan, - * see @ref glfwGetInstanceProcAddress, `vkGetInstanceProcAddr` and - * `vkGetDeviceProcAddr` instead. - * - * @param[in] procname The ASCII encoded name of the function. - * @return The address of the function, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR. - * - * @remark The address of a given function is not guaranteed to be the same - * between contexts. - * - * @remark This function may return a non-`NULL` address despite the - * associated version or extension not being available. Always check the - * context version or extension string first. - * - * @pointer_lifetime The returned function pointer is valid until the context - * is destroyed or the library is terminated. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref context_glext - * @sa @ref glfwExtensionSupported - * - * @since Added in version 1.0. - * - * @ingroup context - */ -GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname); - -/*! @brief Returns whether the Vulkan loader and an ICD have been found. - * - * This function returns whether the Vulkan loader and any minimally functional - * ICD have been found. - * - * The availability of a Vulkan loader and even an ICD does not by itself - * guarantee that surface creation or even instance creation is possible. - * For example, on Fermi systems Nvidia will install an ICD that provides no - * actual Vulkan support. Call @ref glfwGetRequiredInstanceExtensions to check - * whether the extensions necessary for Vulkan surface creation are available - * and @ref glfwGetPhysicalDevicePresentationSupport to check whether a queue - * family of a physical device supports image presentation. - * - * @return `GLFW_TRUE` if Vulkan is minimally available, or `GLFW_FALSE` - * otherwise. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref vulkan_support - * - * @since Added in version 3.2. - * - * @ingroup vulkan - */ -GLFWAPI int glfwVulkanSupported(void); - -/*! @brief Returns the Vulkan instance extensions required by GLFW. - * - * This function returns an array of names of Vulkan instance extensions required - * by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the - * list will always contain `VK_KHR_surface`, so if you don't require any - * additional extensions you can pass this list directly to the - * `VkInstanceCreateInfo` struct. - * - * If Vulkan is not available on the machine, this function returns `NULL` and - * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported - * to check whether Vulkan is at least minimally available. - * - * If Vulkan is available but no set of extensions allowing window surface - * creation was found, this function returns `NULL`. You may still use Vulkan - * for off-screen rendering and compute work. - * - * @param[out] count Where to store the number of extensions in the returned - * array. This is set to zero if an error occurred. - * @return An array of ASCII encoded extension names, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_API_UNAVAILABLE. - * - * @remark Additional extensions may be required by future versions of GLFW. - * You should check if any extensions you wish to enable are already in the - * returned array, as it is an error to specify an extension more than once in - * the `VkInstanceCreateInfo` struct. - * - * @remark @macos GLFW currently supports both the `VK_MVK_macos_surface` and - * the newer `VK_EXT_metal_surface` extensions. - * - * @pointer_lifetime The returned array is allocated and freed by GLFW. You - * should not free it yourself. It is guaranteed to be valid only until the - * library is terminated. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref vulkan_ext - * @sa @ref glfwCreateWindowSurface - * - * @since Added in version 3.2. - * - * @ingroup vulkan - */ -GLFWAPI const char** glfwGetRequiredInstanceExtensions(uint32_t* count); - -#if defined(VK_VERSION_1_0) - -/*! @brief Returns the address of the specified Vulkan instance function. - * - * This function returns the address of the specified Vulkan core or extension - * function for the specified instance. If instance is set to `NULL` it can - * return any function exported from the Vulkan loader, including at least the - * following functions: - * - * - `vkEnumerateInstanceExtensionProperties` - * - `vkEnumerateInstanceLayerProperties` - * - `vkCreateInstance` - * - `vkGetInstanceProcAddr` - * - * If Vulkan is not available on the machine, this function returns `NULL` and - * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported - * to check whether Vulkan is at least minimally available. - * - * This function is equivalent to calling `vkGetInstanceProcAddr` with - * a platform-specific query of the Vulkan loader as a fallback. - * - * @param[in] instance The Vulkan instance to query, or `NULL` to retrieve - * functions related to instance creation. - * @param[in] procname The ASCII encoded name of the function. - * @return The address of the function, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_API_UNAVAILABLE. - * - * @pointer_lifetime The returned function pointer is valid until the library - * is terminated. - * - * @thread_safety This function may be called from any thread. - * - * @sa @ref vulkan_proc - * - * @since Added in version 3.2. - * - * @ingroup vulkan - */ -GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* procname); - -/*! @brief Returns whether the specified queue family can present images. - * - * This function returns whether the specified queue family of the specified - * physical device supports presentation to the platform GLFW was built for. - * - * If Vulkan or the required window surface creation instance extensions are - * not available on the machine, or if the specified instance was not created - * with the required extensions, this function returns `GLFW_FALSE` and - * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported - * to check whether Vulkan is at least minimally available and @ref - * glfwGetRequiredInstanceExtensions to check what instance extensions are - * required. - * - * @param[in] instance The instance that the physical device belongs to. - * @param[in] device The physical device that the queue family belongs to. - * @param[in] queuefamily The index of the queue family to query. - * @return `GLFW_TRUE` if the queue family supports presentation, or - * `GLFW_FALSE` otherwise. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR. - * - * @remark @macos This function currently always returns `GLFW_TRUE`, as the - * `VK_MVK_macos_surface` and `VK_EXT_metal_surface` extensions do not provide - * a `vkGetPhysicalDevice*PresentationSupport` type function. - * - * @thread_safety This function may be called from any thread. For - * synchronization details of Vulkan objects, see the Vulkan specification. - * - * @sa @ref vulkan_present - * - * @since Added in version 3.2. - * - * @ingroup vulkan - */ -GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); - -/*! @brief Creates a Vulkan surface for the specified window. - * - * This function creates a Vulkan surface for the specified window. - * - * If the Vulkan loader or at least one minimally functional ICD were not found, - * this function returns `VK_ERROR_INITIALIZATION_FAILED` and generates a @ref - * GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported to check whether - * Vulkan is at least minimally available. - * - * If the required window surface creation instance extensions are not - * available or if the specified instance was not created with these extensions - * enabled, this function returns `VK_ERROR_EXTENSION_NOT_PRESENT` and - * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref - * glfwGetRequiredInstanceExtensions to check what instance extensions are - * required. - * - * The window surface cannot be shared with another API so the window must - * have been created with the [client api hint](@ref GLFW_CLIENT_API_attrib) - * set to `GLFW_NO_API` otherwise it generates a @ref GLFW_INVALID_VALUE error - * and returns `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`. - * - * The window surface must be destroyed before the specified Vulkan instance. - * It is the responsibility of the caller to destroy the window surface. GLFW - * does not destroy it for you. Call `vkDestroySurfaceKHR` to destroy the - * surface. - * - * @param[in] instance The Vulkan instance to create the surface in. - * @param[in] window The window to create the surface for. - * @param[in] allocator The allocator to use, or `NULL` to use the default - * allocator. - * @param[out] surface Where to store the handle of the surface. This is set - * to `VK_NULL_HANDLE` if an error occurred. - * @return `VK_SUCCESS` if successful, or a Vulkan error code if an - * [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref - * GLFW_API_UNAVAILABLE, @ref GLFW_PLATFORM_ERROR and @ref GLFW_INVALID_VALUE - * - * @remark If an error occurs before the creation call is made, GLFW returns - * the Vulkan error code most appropriate for the error. Appropriate use of - * @ref glfwVulkanSupported and @ref glfwGetRequiredInstanceExtensions should - * eliminate almost all occurrences of these errors. - * - * @remark @macos This function currently only supports the - * `VK_MVK_macos_surface` extension from MoltenVK. - * - * @remark @macos This function creates and sets a `CAMetalLayer` instance for - * the window content view, which is required for MoltenVK to function. - * - * @thread_safety This function may be called from any thread. For - * synchronization details of Vulkan objects, see the Vulkan specification. - * - * @sa @ref vulkan_surface - * @sa @ref glfwGetRequiredInstanceExtensions - * - * @since Added in version 3.2. - * - * @ingroup vulkan - */ -GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); - -#endif /*VK_VERSION_1_0*/ - - -/************************************************************************* - * Global definition cleanup - *************************************************************************/ - -/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ - -#ifdef GLFW_WINGDIAPI_DEFINED - #undef WINGDIAPI - #undef GLFW_WINGDIAPI_DEFINED -#endif - -#ifdef GLFW_CALLBACK_DEFINED - #undef CALLBACK - #undef GLFW_CALLBACK_DEFINED -#endif - -/* Some OpenGL related headers need GLAPIENTRY, but it is unconditionally - * defined by some gl.h variants (OpenBSD) so define it after if needed. - */ -#ifndef GLAPIENTRY - #define GLAPIENTRY APIENTRY -#endif - -/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ - - -#ifdef __cplusplus -} -#endif - -#endif /* _glfw3_h_ */ - diff --git a/FCLauncher/src/main/jni/glfw/include/glfw3native.h b/FCLauncher/src/main/jni/glfw/include/glfw3native.h deleted file mode 100644 index d887b94f..00000000 --- a/FCLauncher/src/main/jni/glfw/include/glfw3native.h +++ /dev/null @@ -1,541 +0,0 @@ -/************************************************************************* - * GLFW 3.3 - www.glfw.org - * A library for OpenGL, window and input - *------------------------------------------------------------------------ - * Copyright (c) 2002-2006 Marcus Geelnard - * Copyright (c) 2006-2018 Camilla Löwy - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would - * be appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not - * be misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source - * distribution. - * - *************************************************************************/ - -#ifndef _glfw3_native_h_ -#define _glfw3_native_h_ - -#ifdef __cplusplus -extern "C" { -#endif - - -/************************************************************************* - * Doxygen documentation - *************************************************************************/ - -/*! @file glfw3native.h - * @brief The header of the native access functions. - * - * This is the header file of the native access functions. See @ref native for - * more information. - */ -/*! @defgroup native Native access - * @brief Functions related to accessing native handles. - * - * **By using the native access functions you assert that you know what you're - * doing and how to fix problems caused by using them. If you don't, you - * shouldn't be using them.** - * - * Before the inclusion of @ref glfw3native.h, you may define zero or more - * window system API macro and zero or more context creation API macros. - * - * The chosen backends must match those the library was compiled for. Failure - * to do this will cause a link-time error. - * - * The available window API macros are: - * * `GLFW_EXPOSE_NATIVE_WIN32` - * * `GLFW_EXPOSE_NATIVE_COCOA` - * * `GLFW_EXPOSE_NATIVE_X11` - * * `GLFW_EXPOSE_NATIVE_WAYLAND` - * - * The available context API macros are: - * * `GLFW_EXPOSE_NATIVE_WGL` - * * `GLFW_EXPOSE_NATIVE_NSGL` - * * `GLFW_EXPOSE_NATIVE_GLX` - * * `GLFW_EXPOSE_NATIVE_EGL` - * * `GLFW_EXPOSE_NATIVE_OSMESA` - * - * These macros select which of the native access functions that are declared - * and which platform-specific headers to include. It is then up your (by - * definition platform-specific) code to handle which of these should be - * defined. - */ - - -/************************************************************************* - * System headers and types - *************************************************************************/ - -#if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL) - // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for - // example to allow applications to correctly declare a GL_KHR_debug callback) - // but windows.h assumes no one will define APIENTRY before it does - #if defined(GLFW_APIENTRY_DEFINED) - #undef APIENTRY - #undef GLFW_APIENTRY_DEFINED - #endif - #include -#elif defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL) - #if defined(__OBJC__) - #import - #else - #include - typedef void* id; - #endif -#elif defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX) - #include - #include -#elif defined(GLFW_EXPOSE_NATIVE_WAYLAND) - #include -#endif - -#if defined(GLFW_EXPOSE_NATIVE_WGL) - /* WGL is declared by windows.h */ -#endif -#if defined(GLFW_EXPOSE_NATIVE_NSGL) - /* NSGL is declared by Cocoa.h */ -#endif -#if defined(GLFW_EXPOSE_NATIVE_GLX) - #include -#endif -#if defined(GLFW_EXPOSE_NATIVE_EGL) - #include -#endif -#if defined(GLFW_EXPOSE_NATIVE_OSMESA) - #include -#endif - - -/************************************************************************* - * Functions - *************************************************************************/ - -#if defined(GLFW_EXPOSE_NATIVE_WIN32) -/*! @brief Returns the adapter device name of the specified monitor. - * - * @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`) - * of the specified monitor, or `NULL` if an [error](@ref error_handling) - * occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.1. - * - * @ingroup native - */ -GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor); - -/*! @brief Returns the display device name of the specified monitor. - * - * @return The UTF-8 encoded display device name (for example - * `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.1. - * - * @ingroup native - */ -GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor); - -/*! @brief Returns the `HWND` of the specified window. - * - * @return The `HWND` of the specified window, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @remark The `HDC` associated with the window can be queried with the - * [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc) - * function. - * @code - * HDC dc = GetDC(glfwGetWin32Window(window)); - * @endcode - * This DC is private and does not need to be released. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window); -#endif - -#if defined(GLFW_EXPOSE_NATIVE_WGL) -/*! @brief Returns the `HGLRC` of the specified window. - * - * @return The `HGLRC` of the specified window, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @remark The `HDC` associated with the window can be queried with the - * [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc) - * function. - * @code - * HDC dc = GetDC(glfwGetWin32Window(window)); - * @endcode - * This DC is private and does not need to be released. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window); -#endif - -#if defined(GLFW_EXPOSE_NATIVE_COCOA) -/*! @brief Returns the `CGDirectDisplayID` of the specified monitor. - * - * @return The `CGDirectDisplayID` of the specified monitor, or - * `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.1. - * - * @ingroup native - */ -GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor); - -/*! @brief Returns the `NSWindow` of the specified window. - * - * @return The `NSWindow` of the specified window, or `nil` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window); -#endif - -#if defined(GLFW_EXPOSE_NATIVE_NSGL) -/*! @brief Returns the `NSOpenGLContext` of the specified window. - * - * @return The `NSOpenGLContext` of the specified window, or `nil` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI id glfwGetNSGLContext(GLFWwindow* window); -#endif - -#if defined(GLFW_EXPOSE_NATIVE_X11) -/*! @brief Returns the `Display` used by GLFW. - * - * @return The `Display` used by GLFW, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI Display* glfwGetX11Display(void); - -/*! @brief Returns the `RRCrtc` of the specified monitor. - * - * @return The `RRCrtc` of the specified monitor, or `None` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.1. - * - * @ingroup native - */ -GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor); - -/*! @brief Returns the `RROutput` of the specified monitor. - * - * @return The `RROutput` of the specified monitor, or `None` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.1. - * - * @ingroup native - */ -GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor); - -/*! @brief Returns the `Window` of the specified window. - * - * @return The `Window` of the specified window, or `None` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI Window glfwGetX11Window(GLFWwindow* window); - -/*! @brief Sets the current primary selection to the specified string. - * - * @param[in] string A UTF-8 encoded string. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The specified string is copied before this function - * returns. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref clipboard - * @sa glfwGetX11SelectionString - * @sa glfwSetClipboardString - * - * @since Added in version 3.3. - * - * @ingroup native - */ -GLFWAPI void glfwSetX11SelectionString(const char* string); - -/*! @brief Returns the contents of the current primary selection as a string. - * - * If the selection is empty or if its contents cannot be converted, `NULL` - * is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated. - * - * @return The contents of the selection as a UTF-8 encoded string, or `NULL` - * if an [error](@ref error_handling) occurred. - * - * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref - * GLFW_PLATFORM_ERROR. - * - * @pointer_lifetime The returned string is allocated and freed by GLFW. You - * should not free it yourself. It is valid until the next call to @ref - * glfwGetX11SelectionString or @ref glfwSetX11SelectionString, or until the - * library is terminated. - * - * @thread_safety This function must only be called from the main thread. - * - * @sa @ref clipboard - * @sa glfwSetX11SelectionString - * @sa glfwGetClipboardString - * - * @since Added in version 3.3. - * - * @ingroup native - */ -GLFWAPI const char* glfwGetX11SelectionString(void); -#endif - -#if defined(GLFW_EXPOSE_NATIVE_GLX) -/*! @brief Returns the `GLXContext` of the specified window. - * - * @return The `GLXContext` of the specified window, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window); - -/*! @brief Returns the `GLXWindow` of the specified window. - * - * @return The `GLXWindow` of the specified window, or `None` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.2. - * - * @ingroup native - */ -GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window); -#endif - -#if defined(GLFW_EXPOSE_NATIVE_WAYLAND) -/*! @brief Returns the `struct wl_display*` used by GLFW. - * - * @return The `struct wl_display*` used by GLFW, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.2. - * - * @ingroup native - */ -GLFWAPI struct wl_display* glfwGetWaylandDisplay(void); - -/*! @brief Returns the `struct wl_output*` of the specified monitor. - * - * @return The `struct wl_output*` of the specified monitor, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.2. - * - * @ingroup native - */ -GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor); - -/*! @brief Returns the main `struct wl_surface*` of the specified window. - * - * @return The main `struct wl_surface*` of the specified window, or `NULL` if - * an [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.2. - * - * @ingroup native - */ -GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window); -#endif - -#if defined(GLFW_EXPOSE_NATIVE_EGL) -/*! @brief Returns the `EGLDisplay` used by GLFW. - * - * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI EGLDisplay glfwGetEGLDisplay(void); - -/*! @brief Returns the `EGLContext` of the specified window. - * - * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window); - -/*! @brief Returns the `EGLSurface` of the specified window. - * - * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.0. - * - * @ingroup native - */ -GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window); -#endif - -#if defined(GLFW_EXPOSE_NATIVE_OSMESA) -/*! @brief Retrieves the color buffer associated with the specified window. - * - * @param[in] window The window whose color buffer to retrieve. - * @param[out] width Where to store the width of the color buffer, or `NULL`. - * @param[out] height Where to store the height of the color buffer, or `NULL`. - * @param[out] format Where to store the OSMesa pixel format of the color - * buffer, or `NULL`. - * @param[out] buffer Where to store the address of the color buffer, or - * `NULL`. - * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.3. - * - * @ingroup native - */ -GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer); - -/*! @brief Retrieves the depth buffer associated with the specified window. - * - * @param[in] window The window whose depth buffer to retrieve. - * @param[out] width Where to store the width of the depth buffer, or `NULL`. - * @param[out] height Where to store the height of the depth buffer, or `NULL`. - * @param[out] bytesPerValue Where to store the number of bytes per depth - * buffer element, or `NULL`. - * @param[out] buffer Where to store the address of the depth buffer, or - * `NULL`. - * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.3. - * - * @ingroup native - */ -GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer); - -/*! @brief Returns the `OSMesaContext` of the specified window. - * - * @return The `OSMesaContext` of the specified window, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @thread_safety This function may be called from any thread. Access is not - * synchronized. - * - * @since Added in version 3.3. - * - * @ingroup native - */ -GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _glfw3_native_h_ */ - diff --git a/FCLauncher/src/main/jni/glfw/include/glfw_config.h b/FCLauncher/src/main/jni/glfw/include/glfw_config.h deleted file mode 100644 index fab4784f..00000000 --- a/FCLauncher/src/main/jni/glfw/include/glfw_config.h +++ /dev/null @@ -1,62 +0,0 @@ -//======================================================================== -// GLFW 3.3 - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2010-2016 Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// As glfw_config.h.in, this file is used by CMake to produce the -// glfw_config.h configuration header file. If you are adding a feature -// requiring conditional compilation, this is where to add the macro. -//======================================================================== -// As glfw_config.h, this file defines compile-time option macros for a -// specific platform and development environment. If you are using the -// GLFW CMake files, modify glfw_config.h.in instead of this file. If you -// are using your own build system, make this file define the appropriate -// macros in whatever way is suitable. -//======================================================================== - -// Define this to 1 if building GLFW for X11 -#define _GLFW_X11 -// Define this to 1 if building GLFW for Win32 -#define _GLFW_WIN32 -// Define this to 1 if building GLFW for Cocoa -#define _GLFW_COCOA -// Define this to 1 if building GLFW for Wayland -#define _GLFW_WAYLAND -// Define this to 1 if building GLFW for Boat -#define _GLFW_FCL -// Define this to 1 if building GLFW for OSMesa -#define _GLFW_OSMESA - -// Define this to 1 if building as a shared library / dynamic library / DLL -#define _GLFW_BUILD_DLL -// Define this to 1 to use Vulkan loader linked statically into application -#define _GLFW_VULKAN_STATIC - -// Define this to 1 to force use of high-performance GPU on hybrid systems -#define _GLFW_USE_HYBRID_HPG - -// Define this to 1 if xkbcommon supports the compose key -#define HAVE_XKBCOMMON_COMPOSE_H -// Define this to 1 if the libc supports memfd_create() -#define HAVE_MEMFD_CREATE - diff --git a/FCLauncher/src/main/jni/glfw/include/internal.h b/FCLauncher/src/main/jni/glfw/include/internal.h deleted file mode 100644 index a797d2e1..00000000 --- a/FCLauncher/src/main/jni/glfw/include/internal.h +++ /dev/null @@ -1,772 +0,0 @@ -//======================================================================== -// GLFW 3.3 - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2002-2006 Marcus Geelnard -// Copyright (c) 2006-2019 Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -#ifndef INTERNAL_H -#define INTERNAL_H - -#pragma once - -#if defined(_GLFW_USE_CONFIG_H) - #include -#endif - -#if defined(GLFW_INCLUDE_GLCOREARB) || \ - defined(GLFW_INCLUDE_ES1) || \ - defined(GLFW_INCLUDE_ES2) || \ - defined(GLFW_INCLUDE_ES3) || \ - defined(GLFW_INCLUDE_ES31) || \ - defined(GLFW_INCLUDE_ES32) || \ - defined(GLFW_INCLUDE_NONE) || \ - defined(GLFW_INCLUDE_GLEXT) || \ - defined(GLFW_INCLUDE_GLU) || \ - defined(GLFW_INCLUDE_VULKAN) || \ - defined(GLFW_DLL) -#endif - -#define GLFW_INCLUDE_NONE -#include -#include "gl/gl.h" - -#define _GLFW_INSERT_FIRST 0 -#define _GLFW_INSERT_LAST 1 - -#define _GLFW_POLL_PRESENCE 0 -#define _GLFW_POLL_AXES 1 -#define _GLFW_POLL_BUTTONS 2 -#define _GLFW_POLL_ALL (_GLFW_POLL_AXES | _GLFW_POLL_BUTTONS) - -#define _GLFW_MESSAGE_SIZE 1024 - -typedef int GLFWbool; - -typedef struct _GLFWerror _GLFWerror; -typedef struct _GLFWinitconfig _GLFWinitconfig; -typedef struct _GLFWwndconfig _GLFWwndconfig; -typedef struct _GLFWctxconfig _GLFWctxconfig; -typedef struct _GLFWfbconfig _GLFWfbconfig; -typedef struct _GLFWcontext _GLFWcontext; -typedef struct _GLFWwindow _GLFWwindow; -typedef struct _GLFWlibrary _GLFWlibrary; -typedef struct _GLFWmonitor _GLFWmonitor; -typedef struct _GLFWcursor _GLFWcursor; -typedef struct _GLFWmapelement _GLFWmapelement; -typedef struct _GLFWmapping _GLFWmapping; -typedef struct _GLFWjoystick _GLFWjoystick; -typedef struct _GLFWtls _GLFWtls; -typedef struct _GLFWmutex _GLFWmutex; - -typedef void (* _GLFWmakecontextcurrentfun)(_GLFWwindow*); -typedef void (* _GLFWswapbuffersfun)(_GLFWwindow*); -typedef void (* _GLFWswapintervalfun)(int); -typedef int (* _GLFWextensionsupportedfun)(const char*); -typedef GLFWglproc (* _GLFWgetprocaddressfun)(const char*); -typedef void (* _GLFWdestroycontextfun)(_GLFWwindow*); - -#define GL_VERSION 0x1f02 -#define GL_NONE 0 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_EXTENSIONS 0x1f03 -#define GL_NUM_EXTENSIONS 0x821d -#define GL_CONTEXT_FLAGS 0x821e -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 -#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82fb -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82fc -#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 - -typedef int GLint; -typedef unsigned int GLuint; -typedef unsigned int GLenum; -typedef unsigned int GLbitfield; -typedef unsigned char GLubyte; - -typedef void (APIENTRY * PFNGLCLEARPROC)(GLbitfield); -typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGPROC)(GLenum); -typedef void (APIENTRY * PFNGLGETINTEGERVPROC)(GLenum,GLint*); -typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint); -typedef void (APIENTRY * PFNGLFINISH) (void); -typedef void (APIENTRY * PFNGLCLEARCOLOR) (GLclampf,GLclampf,GLclampf,GLclampf); -typedef void (APIENTRY * PFNGLCLEAR) (GLbitfield); -typedef void (APIENTRY * PFNGLREADPIXELS) (GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,void*); - -#define VK_NULL_HANDLE 0 - -typedef void* VkInstance; -typedef void* VkPhysicalDevice; -typedef uint64_t VkSurfaceKHR; -typedef uint32_t VkFlags; -typedef uint32_t VkBool32; - -typedef enum VkStructureType -{ - VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, - VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, - VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, - VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, - VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, - VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, - VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000, - VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF -} VkStructureType; - -typedef enum VkResult -{ - VK_SUCCESS = 0, - VK_NOT_READY = 1, - VK_TIMEOUT = 2, - VK_EVENT_SET = 3, - VK_EVENT_RESET = 4, - VK_INCOMPLETE = 5, - VK_ERROR_OUT_OF_HOST_MEMORY = -1, - VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, - VK_ERROR_INITIALIZATION_FAILED = -3, - VK_ERROR_DEVICE_LOST = -4, - VK_ERROR_MEMORY_MAP_FAILED = -5, - VK_ERROR_LAYER_NOT_PRESENT = -6, - VK_ERROR_EXTENSION_NOT_PRESENT = -7, - VK_ERROR_FEATURE_NOT_PRESENT = -8, - VK_ERROR_INCOMPATIBLE_DRIVER = -9, - VK_ERROR_TOO_MANY_OBJECTS = -10, - VK_ERROR_FORMAT_NOT_SUPPORTED = -11, - VK_ERROR_SURFACE_LOST_KHR = -1000000000, - VK_SUBOPTIMAL_KHR = 1000001003, - VK_ERROR_OUT_OF_DATE_KHR = -1000001004, - VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, - VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, - VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, - VK_RESULT_MAX_ENUM = 0x7FFFFFFF -} VkResult; - -typedef struct VkAllocationCallbacks VkAllocationCallbacks; - -typedef struct VkExtensionProperties -{ - char extensionName[256]; - uint32_t specVersion; -} VkExtensionProperties; - -typedef void (APIENTRY * PFN_vkVoidFunction)(void); - -#if defined(_GLFW_VULKAN_STATIC) - PFN_vkVoidFunction vkGetInstanceProcAddr(VkInstance,const char*); - VkResult vkEnumerateInstanceExtensionProperties(const char*,uint32_t*,VkExtensionProperties*); -#else - typedef PFN_vkVoidFunction (APIENTRY * PFN_vkGetInstanceProcAddr)(VkInstance,const char*); - typedef VkResult (APIENTRY * PFN_vkEnumerateInstanceExtensionProperties)(const char*,uint32_t*,VkExtensionProperties*); - #define vkEnumerateInstanceExtensionProperties _glfw.vk.EnumerateInstanceExtensionProperties - #define vkGetInstanceProcAddr _glfw.vk.GetInstanceProcAddr -#endif - -#include "fcl_platform.h" - -// Constructs a version number string from the public header macros -#define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r -#define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r) -#define _GLFW_VERSION_NUMBER _GLFW_MAKE_VERSION(GLFW_VERSION_MAJOR, \ - GLFW_VERSION_MINOR, \ - GLFW_VERSION_REVISION) - -// Checks for whether the library has been initialized -#define _GLFW_REQUIRE_INIT() \ - if (!_glfw.initialized) \ - { \ - _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \ - return; \ - } -#define _GLFW_REQUIRE_INIT_OR_RETURN(x) \ - if (!_glfw.initialized) \ - { \ - _glfwInputError(GLFW_NOT_INITIALIZED, NULL); \ - return x; \ - } - -// Swaps the provided pointers -#define _GLFW_SWAP_POINTERS(x, y) \ - { \ - void* t; \ - t = x; \ - x = y; \ - y = t; \ - } - -// Per-thread error structure -// -struct _GLFWerror -{ - _GLFWerror* next; - int code; - char description[_GLFW_MESSAGE_SIZE]; -}; - -// Initialization configuration -// -// Parameters relating to the initialization of the library -// -struct _GLFWinitconfig -{ - GLFWbool hatButtons; - struct { - GLFWbool menubar; - GLFWbool chdir; - } ns; -}; - -// Window configuration -// -// Parameters relating to the creation of the window but not directly related -// to the framebuffer. This is used to pass window creation parameters from -// shared code to the platform API. -// -struct _GLFWwndconfig -{ - int width; - int height; - const char* title; - GLFWbool resizable; - GLFWbool visible; - GLFWbool decorated; - GLFWbool focused; - GLFWbool autoIconify; - GLFWbool floating; - GLFWbool maximized; - GLFWbool centerCursor; - GLFWbool focusOnShow; - GLFWbool scaleToMonitor; - struct { - GLFWbool retina; - char frameName[256]; - } ns; - struct { - char className[256]; - char instanceName[256]; - } x11; -}; - -// Context configuration -// -// Parameters relating to the creation of the context but not directly related -// to the framebuffer. This is used to pass context creation parameters from -// shared code to the platform API. -// -struct _GLFWctxconfig -{ - int client; - int source; - int major; - int minor; - GLFWbool forward; - GLFWbool debug; - GLFWbool noerror; - int profile; - int robustness; - int release; - _GLFWwindow* share; - struct { - GLFWbool offline; - } nsgl; -}; - -// Framebuffer configuration -// -// This describes buffers and their sizes. It also contains -// a platform-specific ID used to map back to the backend API object. -// -// It is used to pass framebuffer parameters from shared code to the platform -// API and also to enumerate and select available framebuffer configs. -// -struct _GLFWfbconfig -{ - int redBits; - int greenBits; - int blueBits; - int alphaBits; - int depthBits; - int stencilBits; - int accumRedBits; - int accumGreenBits; - int accumBlueBits; - int accumAlphaBits; - int auxBuffers; - GLFWbool stereo; - int samples; - GLFWbool sRGB; - GLFWbool doublebuffer; - GLFWbool transparent; - uintptr_t handle; -}; - -// Context structure -// -struct _GLFWcontext -{ - int client; - int source; - int major, minor, revision; - GLFWbool forward, debug, noerror; - int profile; - int robustness; - int release; - - PFNGLGETSTRINGIPROC GetStringi; - PFNGLGETINTEGERVPROC GetIntegerv; - PFNGLGETSTRINGPROC GetString; - PFNGLFINISH Finish; - PFNGLCLEARCOLOR ClearColor; - PFNGLCLEAR Clear; - PFNGLREADPIXELS ReadPixels; - - _GLFWmakecontextcurrentfun makeCurrent; - _GLFWswapbuffersfun swapBuffers; - _GLFWswapintervalfun swapInterval; - _GLFWextensionsupportedfun extensionSupported; - _GLFWgetprocaddressfun getProcAddress; - _GLFWdestroycontextfun destroy; - - // This is defined in the context API's context.h - _GLFW_PLATFORM_CONTEXT_STATE; - // This is defined in egl_context.h - _GLFW_EGL_CONTEXT_STATE; - // This is defined in osmesa_context.h - _GLFW_OSMESA_CONTEXT_STATE; - -}; - -// Window and context structure -// -struct _GLFWwindow -{ - struct _GLFWwindow* next; - - // Window settings and state - GLFWbool resizable; - GLFWbool decorated; - GLFWbool autoIconify; - GLFWbool floating; - GLFWbool focusOnShow; - GLFWbool shouldClose; - void* userPointer; - GLFWbool doublebuffer; - GLFWvidmode videoMode; - _GLFWmonitor* monitor; - _GLFWcursor* cursor; - - int minwidth, minheight; - int maxwidth, maxheight; - int numer, denom; - - GLFWbool stickyKeys; - GLFWbool stickyMouseButtons; - GLFWbool lockKeyMods; - int cursorMode; - char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1]; - char keys[GLFW_KEY_LAST + 1]; - // Virtual cursor position when cursor is disabled - double virtualCursorPosX, virtualCursorPosY; - GLFWbool rawMouseMotion; - - _GLFWcontext context; - - struct { - GLFWwindowposfun pos; - GLFWwindowsizefun size; - GLFWwindowclosefun close; - GLFWwindowrefreshfun refresh; - GLFWwindowfocusfun focus; - GLFWwindowiconifyfun iconify; - GLFWwindowmaximizefun maximize; - GLFWframebuffersizefun fbsize; - GLFWwindowcontentscalefun scale; - GLFWmousebuttonfun mouseButton; - GLFWcursorposfun cursorPos; - GLFWcursorenterfun cursorEnter; - GLFWscrollfun scroll; - GLFWkeyfun key; - GLFWcharfun character; - GLFWcharmodsfun charmods; - GLFWdropfun drop; - } callbacks; - - // This is defined in the window API's platform.h - _GLFW_PLATFORM_WINDOW_STATE; - -}; - -// Monitor structure -// -struct _GLFWmonitor -{ - char name[128]; - void* userPointer; - - // Physical dimensions in millimeters. - int widthMM, heightMM; - - // The window whose video mode is current on this monitor - _GLFWwindow* window; - - GLFWvidmode* modes; - int modeCount; - GLFWvidmode currentMode; - - GLFWgammaramp originalRamp; - GLFWgammaramp currentRamp; - - // This is defined in the window API's platform.h - _GLFW_PLATFORM_MONITOR_STATE; - -}; - -// Cursor structure -// -struct _GLFWcursor -{ - _GLFWcursor* next; - - // This is defined in the window API's platform.h - _GLFW_PLATFORM_CURSOR_STATE; -}; - -// Gamepad mapping element structure -// -struct _GLFWmapelement -{ - uint8_t type; - uint8_t index; - int8_t axisScale; - int8_t axisOffset; -}; - -// Gamepad mapping structure -// -struct _GLFWmapping -{ - char name[128]; - char guid[33]; - _GLFWmapelement buttons[15]; - _GLFWmapelement axes[6]; -}; - -// Joystick structure -// -struct _GLFWjoystick -{ - GLFWbool present; - float* axes; - int axisCount; - unsigned char* buttons; - int buttonCount; - unsigned char* hats; - int hatCount; - char name[128]; - void* userPointer; - char guid[33]; - _GLFWmapping* mapping; - -}; - -// Thread local storage structure -// -struct _GLFWtls -{ - // This is defined in the platform's thread.h - _GLFW_PLATFORM_TLS_STATE; -}; - -// Mutex structure -// -struct _GLFWmutex -{ - // This is defined in the platform's thread.h - _GLFW_PLATFORM_MUTEX_STATE; -}; - -// Library global data -// -struct _GLFWlibrary -{ - GLFWbool initialized; - - struct { - _GLFWinitconfig init; - _GLFWfbconfig framebuffer; - _GLFWwndconfig window; - _GLFWctxconfig context; - int refreshRate; - } hints; - - _GLFWerror* errorListHead; - _GLFWcursor* cursorListHead; - _GLFWwindow* windowListHead; - - _GLFWmonitor** monitors; - int monitorCount; - - _GLFWjoystick joysticks[GLFW_JOYSTICK_LAST + 1]; - _GLFWmapping* mappings; - int mappingCount; - - _GLFWtls errorSlot; - _GLFWtls contextSlot; - _GLFWmutex errorLock; - - struct { - uint64_t offset; - // This is defined in the platform's time.h - _GLFW_PLATFORM_LIBRARY_TIMER_STATE; - } timer; - - struct { - GLFWbool available; - void* handle; - char* extensions[2]; -#if !defined(_GLFW_VULKAN_STATIC) - PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties; - PFN_vkGetInstanceProcAddr GetInstanceProcAddr; -#endif - GLFWbool KHR_surface; - - GLFWbool KHR_android_surface; - } vk; - - struct { - GLFWmonitorfun monitor; - GLFWjoystickfun joystick; - } callbacks; - - // This is defined in the window API's platform.h - _GLFW_PLATFORM_LIBRARY_WINDOW_STATE; - // This is defined in the context API's context.h - _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE; - // This is defined in egl_context.h - _GLFW_EGL_LIBRARY_CONTEXT_STATE; - // This is defined in osmesa_context.h - _GLFW_OSMESA_LIBRARY_CONTEXT_STATE; - -}; - -// Global state shared between compilation units of GLFW -// -extern _GLFWlibrary _glfw; - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -int _glfwPlatformInit(void); -void _glfwPlatformTerminate(void); -const char* _glfwPlatformGetVersionString(void); - -void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos); -void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos); -void _glfwPlatformSetInjectorCallback(FCLinjectorfun callback); -void _glfwPlatformSetHitResultType(int type); -void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode); -void _glfwPlatformSetRawMouseMotion(_GLFWwindow *window, GLFWbool enabled); -GLFWbool _glfwPlatformRawMouseMotionSupported(void); -int _glfwPlatformCreateCursor(_GLFWcursor* cursor, - const GLFWimage* image, int xhot, int yhot); -int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape); -void _glfwPlatformDestroyCursor(_GLFWcursor* cursor); -void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor); - -const char* _glfwPlatformGetScancodeName(int scancode); -int _glfwPlatformGetKeyScancode(int key); - -void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor); -void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos); -void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, - float* xscale, float* yscale); -void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height); -GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count); -void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode); -GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp); -void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp); - -void _glfwPlatformSetClipboardString(const char* string); -const char* _glfwPlatformGetClipboardString(void); - -int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode); -void _glfwPlatformUpdateGamepadGUID(char* guid); - -uint64_t _glfwPlatformGetTimerValue(void); -uint64_t _glfwPlatformGetTimerFrequency(void); - -int _glfwPlatformCreateWindow(_GLFWwindow* window, - const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); -void _glfwPlatformDestroyWindow(_GLFWwindow* window); -void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title); -void _glfwPlatformSetWindowIcon(_GLFWwindow* window, - int count, const GLFWimage* images); -void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos); -void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos); -void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height); -void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height); -void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window, - int minwidth, int minheight, - int maxwidth, int maxheight); -void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int numer, int denom); -void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height); -void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, - int* left, int* top, - int* right, int* bottom); -void _glfwPlatformGetWindowContentScale(_GLFWwindow* window, - float* xscale, float* yscale); -void _glfwPlatformIconifyWindow(_GLFWwindow* window); -void _glfwPlatformRestoreWindow(_GLFWwindow* window); -void _glfwPlatformMaximizeWindow(_GLFWwindow* window); -void _glfwPlatformShowWindow(_GLFWwindow* window); -void _glfwPlatformHideWindow(_GLFWwindow* window); -void _glfwPlatformRequestWindowAttention(_GLFWwindow* window); -void _glfwPlatformFocusWindow(_GLFWwindow* window); -void _glfwPlatformSetWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor, - int xpos, int ypos, int width, int height, - int refreshRate); -int _glfwPlatformWindowFocused(_GLFWwindow* window); -int _glfwPlatformWindowIconified(_GLFWwindow* window); -int _glfwPlatformWindowVisible(_GLFWwindow* window); -int _glfwPlatformWindowMaximized(_GLFWwindow* window); -int _glfwPlatformWindowHovered(_GLFWwindow* window); -int _glfwPlatformFramebufferTransparent(_GLFWwindow* window); -float _glfwPlatformGetWindowOpacity(_GLFWwindow* window); -void _glfwPlatformSetWindowResizable(_GLFWwindow* window, GLFWbool enabled); -void _glfwPlatformSetWindowDecorated(_GLFWwindow* window, GLFWbool enabled); -void _glfwPlatformSetWindowFloating(_GLFWwindow* window, GLFWbool enabled); -void _glfwPlatformSetWindowOpacity(_GLFWwindow* window, float opacity); - -void _glfwPlatformPollEvents(void); -void _glfwPlatformWaitEvents(void); -void _glfwPlatformWaitEventsTimeout(double timeout); -void _glfwPlatformPostEmptyEvent(void); - -void _glfwPlatformGetRequiredInstanceExtensions(char** extensions); -int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, - VkPhysicalDevice device, - uint32_t queuefamily); -VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, - _GLFWwindow* window, - const VkAllocationCallbacks* allocator, - VkSurfaceKHR* surface); - -GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls); -void _glfwPlatformDestroyTls(_GLFWtls* tls); -void* _glfwPlatformGetTls(_GLFWtls* tls); -void _glfwPlatformSetTls(_GLFWtls* tls, void* value); - -GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex); -void _glfwPlatformDestroyMutex(_GLFWmutex* mutex); -void _glfwPlatformLockMutex(_GLFWmutex* mutex); -void _glfwPlatformUnlockMutex(_GLFWmutex* mutex); - - -////////////////////////////////////////////////////////////////////////// -////// GLFW event API ////// -////////////////////////////////////////////////////////////////////////// - -void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused); -void _glfwInputWindowPos(_GLFWwindow* window, int xpos, int ypos); -void _glfwInputWindowSize(_GLFWwindow* window, int width, int height); -void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height); -void _glfwInputWindowContentScale(_GLFWwindow* window, - float xscale, float yscale); -void _glfwInputWindowIconify(_GLFWwindow* window, GLFWbool iconified); -void _glfwInputWindowMaximize(_GLFWwindow* window, GLFWbool maximized); -void _glfwInputWindowDamage(_GLFWwindow* window); -void _glfwInputWindowCloseRequest(_GLFWwindow* window); -void _glfwInputWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor); - -void _glfwInputKey(_GLFWwindow* window, - int key, int scancode, int action, int mods); -void _glfwInputChar(_GLFWwindow* window, - unsigned int codepoint, int mods, GLFWbool plain); -void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset); -void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods); -void _glfwInputCursorPos(_GLFWwindow* window, double xpos, double ypos); -void _glfwInputCursorEnter(_GLFWwindow* window, GLFWbool entered); -void _glfwInputDrop(_GLFWwindow* window, int count, const char** names); -void _glfwInputJoystick(_GLFWjoystick* js, int event); -void _glfwInputJoystickAxis(_GLFWjoystick* js, int axis, float value); -void _glfwInputJoystickButton(_GLFWjoystick* js, int button, char value); -void _glfwInputJoystickHat(_GLFWjoystick* js, int hat, char value); - -void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement); -void _glfwInputMonitorWindow(_GLFWmonitor* monitor, _GLFWwindow* window); - -#if defined(__GNUC__) -void _glfwInputError(int code, const char* format, ...) - __attribute__((format(printf, 2, 3))); -#else -void _glfwInputError(int code, const char* format, ...); -#endif - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWbool _glfwStringInExtensionString(const char* string, const char* extensions); -const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, - const _GLFWfbconfig* alternatives, - unsigned int count); -GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig); -GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig); - -const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor, - const GLFWvidmode* desired); -int _glfwCompareVideoModes(const GLFWvidmode* first, const GLFWvidmode* second); -_GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM); -void _glfwFreeMonitor(_GLFWmonitor* monitor); -void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size); -void _glfwFreeGammaArrays(GLFWgammaramp* ramp); -void _glfwSplitBPP(int bpp, int* red, int* green, int* blue); - -_GLFWjoystick* _glfwAllocJoystick(const char* name, - const char* guid, - int axisCount, - int buttonCount, - int hatCount); -void _glfwFreeJoystick(_GLFWjoystick* js); -void _glfwCenterCursorInContentArea(_GLFWwindow* window); - -GLFWbool _glfwInitVulkan(int mode); -void _glfwTerminateVulkan(void); -const char* _glfwGetVulkanResultString(VkResult result); - -char* _glfw_strdup(const char* source); -float _glfw_fminf(float a, float b); -float _glfw_fmaxf(float a, float b); - -#endif \ No newline at end of file diff --git a/FCLauncher/src/main/jni/glfw/include/osmesa_context.h b/FCLauncher/src/main/jni/glfw/include/osmesa_context.h deleted file mode 100644 index 6e39a749..00000000 --- a/FCLauncher/src/main/jni/glfw/include/osmesa_context.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#define OSMESA_RGBA 0x1908 -#define OSMESA_FORMAT 0x22 -#define OSMESA_DEPTH_BITS 0x30 -#define OSMESA_STENCIL_BITS 0x31 -#define OSMESA_ACCUM_BITS 0x32 -#define OSMESA_PROFILE 0x33 -#define OSMESA_CORE_PROFILE 0x34 -#define OSMESA_COMPAT_PROFILE 0x35 -#define OSMESA_CONTEXT_MAJOR_VERSION 0x36 -#define OSMESA_CONTEXT_MINOR_VERSION 0x37 - -#define OSMESA_ROW_LENGTH 0x10 -#define OSMESA_Y_UP 0x11 - -typedef void* OSMesaContext; -typedef void (*OSMESAproc)(void); - -typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContext)(GLenum,OSMesaContext); -typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaGetCurrentContext)(void); -typedef void (GLAPIENTRY * PFN_OSMesaDestroyContext)(OSMesaContext); -typedef void (GLAPIENTRY * PFN_OSMesaPixelStore)(GLint,GLint); -typedef int (GLAPIENTRY * PFN_OSMesaMakeCurrent)(OSMesaContext,void*,int,int,int); -typedef int (GLAPIENTRY * PFN_OSMesaGetColorBuffer)(OSMesaContext,int*,int*,int*,void**); -typedef int (GLAPIENTRY * PFN_OSMesaGetDepthBuffer)(OSMesaContext,int*,int*,int*,void**); -typedef GLFWglproc (GLAPIENTRY * PFN_OSMesaGetProcAddress)(const char*); -#define OSMesaCreateContext _glfw.osmesa.CreateContext -#define OSMesaGetCurrentContext _glfw.osmesa.GetCurrentContext -#define OSMesaDestroyContext _glfw.osmesa.DestroyContext -#define OSMesaPixelStore _glfw.osmesa.PixelStore -#define OSMesaMakeCurrent _glfw.osmesa.MakeCurrent -#define OSMesaGetColorBuffer _glfw.osmesa.GetColorBuffer -#define OSMesaGetDepthBuffer _glfw.osmesa.GetDepthBuffer -#define OSMesaGetProcAddress _glfw.osmesa.GetProcAddress - -#define _GLFW_OSMESA_CONTEXT_STATE _GLFWcontextOSMesa osmesa -#define _GLFW_OSMESA_LIBRARY_CONTEXT_STATE _GLFWlibraryOSMesa osmesa - - -// OSMesa-specific per-context data -// -typedef struct _GLFWcontextOSMesa -{ - OSMesaContext handle; - int width; - int height; - void* buffer; - -} _GLFWcontextOSMesa; - -// OSMesa-specific global data -// -typedef struct _GLFWlibraryOSMesa -{ - void* handle; - - PFN_OSMesaCreateContext CreateContext; - PFN_OSMesaGetCurrentContext GetCurrentContext; - PFN_OSMesaDestroyContext DestroyContext; - PFN_OSMesaPixelStore PixelStore; - PFN_OSMesaMakeCurrent MakeCurrent; - PFN_OSMesaGetColorBuffer GetColorBuffer; - PFN_OSMesaGetDepthBuffer GetDepthBuffer; - PFN_OSMesaGetProcAddress GetProcAddress; - -} _GLFWlibraryOSMesa; - - -GLFWbool _glfwInitOSMesa(void); -void _glfwTerminateOSMesa(void); -GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); - diff --git a/FCLauncher/src/main/jni/glfw/include/platform.h b/FCLauncher/src/main/jni/glfw/include/platform.h deleted file mode 100644 index 924e9af1..00000000 --- a/FCLauncher/src/main/jni/glfw/include/platform.h +++ /dev/null @@ -1,198 +0,0 @@ -//======================================================================== -// GLFW 3.4 - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2002-2006 Marcus Geelnard -// Copyright (c) 2006-2018 Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#if defined(GLFW_BUILD_WIN32_TIMER) || \ - defined(GLFW_BUILD_WIN32_MODULE) || \ - defined(GLFW_BUILD_WIN32_THREAD) || \ - defined(GLFW_BUILD_COCOA_TIMER) || \ - defined(GLFW_BUILD_POSIX_TIMER) || \ - defined(GLFW_BUILD_POSIX_MODULE) || \ - defined(GLFW_BUILD_POSIX_THREAD) || \ - defined(GLFW_BUILD_POSIX_POLL) || \ - defined(GLFW_BUILD_LINUX_JOYSTICK) -#error "You must not define these; define zero or more _GLFW_ macros instead" -#endif - -#if defined(_GLFW_WIN32) -#include "win32_platform.h" -#else -#define GLFW_WIN32_WINDOW_STATE -#define GLFW_WIN32_MONITOR_STATE -#define GLFW_WIN32_CURSOR_STATE -#define GLFW_WIN32_LIBRARY_WINDOW_STATE -#define GLFW_WGL_CONTEXT_STATE -#define GLFW_WGL_LIBRARY_CONTEXT_STATE -#endif - -#if defined(_GLFW_COCOA) -#include "cocoa_platform.h" -#else -#define GLFW_COCOA_WINDOW_STATE -#define GLFW_COCOA_MONITOR_STATE -#define GLFW_COCOA_CURSOR_STATE -#define GLFW_COCOA_LIBRARY_WINDOW_STATE -#define GLFW_NSGL_CONTEXT_STATE -#define GLFW_NSGL_LIBRARY_CONTEXT_STATE -#endif - -#if defined(_GLFW_WAYLAND) -#include "wl_platform.h" -#else -#define GLFW_WAYLAND_WINDOW_STATE -#define GLFW_WAYLAND_MONITOR_STATE -#define GLFW_WAYLAND_CURSOR_STATE -#define GLFW_WAYLAND_LIBRARY_WINDOW_STATE -#endif - -#if defined(_GLFW_X11) -#include "x11_platform.h" -#else -#define GLFW_X11_WINDOW_STATE -#define GLFW_X11_MONITOR_STATE -#define GLFW_X11_CURSOR_STATE -#define GLFW_X11_LIBRARY_WINDOW_STATE -#define GLFW_GLX_CONTEXT_STATE -#define GLFW_GLX_LIBRARY_CONTEXT_STATE -#endif - -#if defined(_GLFW_WIN32) -#include "win32_joystick.h" -#else -#define GLFW_WIN32_JOYSTICK_STATE -#define GLFW_WIN32_LIBRARY_JOYSTICK_STATE -#endif - -#if defined(_GLFW_COCOA) -#include "cocoa_joystick.h" -#else -#define GLFW_COCOA_JOYSTICK_STATE -#define GLFW_COCOA_LIBRARY_JOYSTICK_STATE -#endif - -#if (defined(_GLFW_X11) || defined(_GLFW_WAYLAND)) && defined(__linux__) -#define GLFW_BUILD_LINUX_JOYSTICK -#endif - -#if defined(GLFW_BUILD_LINUX_JOYSTICK) -#include "linux_joystick.h" -#else -#define GLFW_LINUX_JOYSTICK_STATE -#define GLFW_LINUX_LIBRARY_JOYSTICK_STATE -#endif - -#define GLFW_PLATFORM_WINDOW_STATE \ - GLFW_WIN32_WINDOW_STATE \ - GLFW_COCOA_WINDOW_STATE \ - GLFW_WAYLAND_WINDOW_STATE \ - GLFW_X11_WINDOW_STATE \ - GLFW_NULL_WINDOW_STATE \ - -#define GLFW_PLATFORM_MONITOR_STATE \ - GLFW_WIN32_MONITOR_STATE \ - GLFW_COCOA_MONITOR_STATE \ - GLFW_WAYLAND_MONITOR_STATE \ - GLFW_X11_MONITOR_STATE \ - GLFW_NULL_MONITOR_STATE \ - -#define GLFW_PLATFORM_CURSOR_STATE \ - GLFW_WIN32_CURSOR_STATE \ - GLFW_COCOA_CURSOR_STATE \ - GLFW_WAYLAND_CURSOR_STATE \ - GLFW_X11_CURSOR_STATE \ - GLFW_NULL_CURSOR_STATE \ - -#define GLFW_PLATFORM_JOYSTICK_STATE \ - GLFW_WIN32_JOYSTICK_STATE \ - GLFW_COCOA_JOYSTICK_STATE \ - GLFW_LINUX_JOYSTICK_STATE - -#define GLFW_PLATFORM_LIBRARY_WINDOW_STATE \ - GLFW_WIN32_LIBRARY_WINDOW_STATE \ - GLFW_COCOA_LIBRARY_WINDOW_STATE \ - GLFW_WAYLAND_LIBRARY_WINDOW_STATE \ - GLFW_X11_LIBRARY_WINDOW_STATE \ - GLFW_NULL_LIBRARY_WINDOW_STATE \ - -#define GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ - GLFW_WIN32_LIBRARY_JOYSTICK_STATE \ - GLFW_COCOA_LIBRARY_JOYSTICK_STATE \ - GLFW_LINUX_LIBRARY_JOYSTICK_STATE - -#define GLFW_PLATFORM_CONTEXT_STATE \ - GLFW_WGL_CONTEXT_STATE \ - GLFW_NSGL_CONTEXT_STATE \ - GLFW_GLX_CONTEXT_STATE - -#define GLFW_PLATFORM_LIBRARY_CONTEXT_STATE \ - GLFW_WGL_LIBRARY_CONTEXT_STATE \ - GLFW_NSGL_LIBRARY_CONTEXT_STATE \ - GLFW_GLX_LIBRARY_CONTEXT_STATE - -#if defined(_WIN32) -#define GLFW_BUILD_WIN32_THREAD -#else -#define GLFW_BUILD_POSIX_THREAD -#endif - -#if defined(GLFW_BUILD_WIN32_THREAD) -#include "win32_thread.h" - #define GLFW_PLATFORM_TLS_STATE GLFW_WIN32_TLS_STATE - #define GLFW_PLATFORM_MUTEX_STATE GLFW_WIN32_MUTEX_STATE -#elif defined(GLFW_BUILD_POSIX_THREAD) -#include "posix_thread.h" -#define GLFW_PLATFORM_TLS_STATE GLFW_POSIX_TLS_STATE -#define GLFW_PLATFORM_MUTEX_STATE GLFW_POSIX_MUTEX_STATE -#endif - -#if defined(_WIN32) -#define GLFW_BUILD_WIN32_TIMER -#elif defined(__APPLE__) -#define GLFW_BUILD_COCOA_TIMER -#else -#define GLFW_BUILD_POSIX_TIMER -#endif - -#if defined(GLFW_BUILD_WIN32_TIMER) -#include "win32_time.h" - #define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_WIN32_LIBRARY_TIMER_STATE -#elif defined(GLFW_BUILD_COCOA_TIMER) -#include "cocoa_time.h" - #define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_COCOA_LIBRARY_TIMER_STATE -#elif defined(GLFW_BUILD_POSIX_TIMER) -#include "posix_time.h" -#define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_POSIX_LIBRARY_TIMER_STATE -#endif - -#if defined(_WIN32) -#define GLFW_BUILD_WIN32_MODULE -#else -#define GLFW_BUILD_POSIX_MODULE -#endif - -#if defined(_GLFW_WAYLAND) || defined(_GLFW_X11) -#define GLFW_BUILD_POSIX_POLL -#endif \ No newline at end of file diff --git a/FCLauncher/src/main/jni/glfw/include/posix_thread.h b/FCLauncher/src/main/jni/glfw/include/posix_thread.h deleted file mode 100644 index 035fabdb..00000000 --- a/FCLauncher/src/main/jni/glfw/include/posix_thread.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#define _GLFW_PLATFORM_TLS_STATE _GLFWtlsPOSIX posix -#define _GLFW_PLATFORM_MUTEX_STATE _GLFWmutexPOSIX posix - - -// POSIX-specific thread local storage data -// -typedef struct _GLFWtlsPOSIX -{ - GLFWbool allocated; - pthread_key_t key; - -} _GLFWtlsPOSIX; - -// POSIX-specific mutex data -// -typedef struct _GLFWmutexPOSIX -{ - GLFWbool allocated; - pthread_mutex_t handle; - -} _GLFWmutexPOSIX; - diff --git a/FCLauncher/src/main/jni/glfw/include/posix_time.h b/FCLauncher/src/main/jni/glfw/include/posix_time.h deleted file mode 100644 index 504e3aac..00000000 --- a/FCLauncher/src/main/jni/glfw/include/posix_time.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#define _GLFW_PLATFORM_LIBRARY_TIMER_STATE _GLFWtimerPOSIX posix - -#include -#include - - -// POSIX-specific global timer data -// -typedef struct _GLFWtimerPOSIX -{ - GLFWbool monotonic; - uint64_t frequency; - -} _GLFWtimerPOSIX; - - -void _glfwInitTimerPOSIX(void); - diff --git a/FCLauncher/src/main/jni/glfw/init.c b/FCLauncher/src/main/jni/glfw/init.c deleted file mode 100644 index b0dc6cec..00000000 --- a/FCLauncher/src/main/jni/glfw/init.c +++ /dev/null @@ -1,294 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#include -#include -#include -#include -#include - - -// The global variables below comprise all mutable global data in GLFW -// -// Any other global variable is a bug - -// Global state shared between compilation units of GLFW -// -_GLFWlibrary _glfw = { GLFW_FALSE }; - -// These are outside of _glfw so they can be used before initialization and -// after termination -// -static _GLFWerror _glfwMainThreadError; -static GLFWerrorfun _glfwErrorCallback; -static GLFWallocator _glfwInitAllocator; -static _GLFWinitconfig _glfwInitHints = -{ - GLFW_TRUE, // hat buttons - { - GLFW_TRUE, // macOS menu bar - GLFW_TRUE // macOS bundle chdir - } -}; - -// Terminate the library -// -static void terminate(void) -{ - int i; - - memset(&_glfw.callbacks, 0, sizeof(_glfw.callbacks)); - - while (_glfw.windowListHead) - glfwDestroyWindow((GLFWwindow*) _glfw.windowListHead); - - while (_glfw.cursorListHead) - glfwDestroyCursor((GLFWcursor*) _glfw.cursorListHead); - - for (i = 0; i < _glfw.monitorCount; i++) - { - _GLFWmonitor* monitor = _glfw.monitors[i]; - if (monitor->originalRamp.size) - _glfwPlatformSetGammaRamp(monitor, &monitor->originalRamp); - _glfwFreeMonitor(monitor); - } - - free(_glfw.monitors); - _glfw.monitors = NULL; - _glfw.monitorCount = 0; - - free(_glfw.mappings); - _glfw.mappings = NULL; - _glfw.mappingCount = 0; - - _glfwTerminateVulkan(); - _glfwPlatformTerminate(); - - _glfw.initialized = GLFW_FALSE; - - while (_glfw.errorListHead) - { - _GLFWerror* error = _glfw.errorListHead; - _glfw.errorListHead = error->next; - free(error); - } - - _glfwPlatformDestroyTls(&_glfw.contextSlot); - _glfwPlatformDestroyTls(&_glfw.errorSlot); - _glfwPlatformDestroyMutex(&_glfw.errorLock); - - memset(&_glfw, 0, sizeof(_glfw)); -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -char* _glfw_strdup(const char* source) -{ - const size_t length = strlen(source); - char* result = calloc(length + 1, 1); - strcpy(result, source); - return result; -} - -float _glfw_fminf(float a, float b) -{ - if (a != a) - return b; - else if (b != b) - return a; - else if (a < b) - return a; - else - return b; -} - -float _glfw_fmaxf(float a, float b) -{ - if (a != a) - return b; - else if (b != b) - return a; - else if (a > b) - return a; - else - return b; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW event API ////// -////////////////////////////////////////////////////////////////////////// - -// Notifies shared code of an error -// -void _glfwInputError(int code, const char* format, ...) -{ - _GLFWerror* error; - char description[_GLFW_MESSAGE_SIZE]; - - if (format) - { - va_list vl; - - va_start(vl, format); - vsnprintf(description, sizeof(description), format, vl); - va_end(vl); - - description[sizeof(description) - 1] = '\0'; - } - else - { - if (code == GLFW_NOT_INITIALIZED) - strcpy(description, "The GLFW library is not initialized"); - else if (code == GLFW_NO_CURRENT_CONTEXT) - strcpy(description, "There is no current context"); - else if (code == GLFW_INVALID_ENUM) - strcpy(description, "Invalid argument for enum parameter"); - else if (code == GLFW_INVALID_VALUE) - strcpy(description, "Invalid value for parameter"); - else if (code == GLFW_OUT_OF_MEMORY) - strcpy(description, "Out of memory"); - else if (code == GLFW_API_UNAVAILABLE) - strcpy(description, "The requested API is unavailable"); - else if (code == GLFW_VERSION_UNAVAILABLE) - strcpy(description, "The requested API version is unavailable"); - else if (code == GLFW_PLATFORM_ERROR) - strcpy(description, "A platform-specific error occurred"); - else if (code == GLFW_FORMAT_UNAVAILABLE) - strcpy(description, "The requested format is unavailable"); - else if (code == GLFW_NO_WINDOW_CONTEXT) - strcpy(description, "The specified window has no context"); - else - strcpy(description, "ERROR: UNKNOWN GLFW ERROR"); - } - - if (_glfw.initialized) - { - error = _glfwPlatformGetTls(&_glfw.errorSlot); - if (!error) - { - error = calloc(1, sizeof(_GLFWerror)); - _glfwPlatformSetTls(&_glfw.errorSlot, error); - _glfwPlatformLockMutex(&_glfw.errorLock); - error->next = _glfw.errorListHead; - _glfw.errorListHead = error; - _glfwPlatformUnlockMutex(&_glfw.errorLock); - } - } - else - error = &_glfwMainThreadError; - - error->code = code; - strcpy(error->description, description); - - if (_glfwErrorCallback) - _glfwErrorCallback(code, description); -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW public API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI int glfwInit(void) -{ - if (_glfw.initialized) - return GLFW_TRUE; - - memset(&_glfw, 0, sizeof(_glfw)); - _glfw.hints.init = _glfwInitHints; - - if (!_glfwPlatformInit()) - { - terminate(); - return GLFW_FALSE; - } - - if (!_glfwPlatformCreateMutex(&_glfw.errorLock) || - !_glfwPlatformCreateTls(&_glfw.errorSlot) || - !_glfwPlatformCreateTls(&_glfw.contextSlot)) - { - terminate(); - return GLFW_FALSE; - } - - _glfwPlatformSetTls(&_glfw.errorSlot, &_glfwMainThreadError); - - _glfw.initialized = GLFW_TRUE; - _glfw.timer.offset = _glfwPlatformGetTimerValue(); - - glfwDefaultWindowHints(); - - return GLFW_TRUE; -} - -GLFWAPI void glfwTerminate(void) -{ - if (!_glfw.initialized) - return; - - terminate(); -} - -GLFWAPI void glfwInitHint(int hint, int value) -{ -} - -GLFWAPI void glfwInitAllocator(const GLFWallocator* allocator) -{ - if (allocator) - { - if (allocator->allocate && allocator->reallocate && allocator->deallocate) - _glfwInitAllocator = *allocator; - else - _glfwInputError(GLFW_INVALID_VALUE, "Missing function in allocator"); - } - else - memset(&_glfwInitAllocator, 0, sizeof(GLFWallocator)); -} - -GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev) -{ - if (major != NULL) - *major = GLFW_VERSION_MAJOR; - if (minor != NULL) - *minor = GLFW_VERSION_MINOR; - if (rev != NULL) - *rev = GLFW_VERSION_REVISION; -} - -GLFWAPI int glfwGetError(const char** description) -{ - _GLFWerror* error; - int code = GLFW_NO_ERROR; - - if (description) - *description = NULL; - - if (_glfw.initialized) - error = _glfwPlatformGetTls(&_glfw.errorSlot); - else - error = &_glfwMainThreadError; - - if (error) - { - code = error->code; - error->code = GLFW_NO_ERROR; - if (description && code) - *description = error->description; - } - - return code; -} - -GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun) -{ - _GLFW_SWAP_POINTERS(_glfwErrorCallback, cbfun); - return cbfun; -} diff --git a/FCLauncher/src/main/jni/glfw/input.c b/FCLauncher/src/main/jni/glfw/input.c deleted file mode 100644 index 3e4a7048..00000000 --- a/FCLauncher/src/main/jni/glfw/input.c +++ /dev/null @@ -1,600 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#include -#include -#include -#include -#include - -// Internal key state used for sticky keys -#define _GLFW_STICK 3 - -////////////////////////////////////////////////////////////////////////// -////// GLFW event API ////// -////////////////////////////////////////////////////////////////////////// - -// Notifies shared code of a physical key event -// -void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key >= 0 && key <= GLFW_KEY_LAST) - { - GLFWbool repeated = GLFW_FALSE; - - if (action == GLFW_RELEASE && window->keys[key] == GLFW_RELEASE) - return; - - if (action == GLFW_PRESS && window->keys[key] == GLFW_PRESS) - repeated = GLFW_TRUE; - - if (action == GLFW_RELEASE && window->stickyKeys) - window->keys[key] = _GLFW_STICK; - else - window->keys[key] = (char) action; - - if (repeated) - action = GLFW_REPEAT; - } - - if (!window->lockKeyMods) - mods &= ~(GLFW_MOD_CAPS_LOCK | GLFW_MOD_NUM_LOCK); - - if (window->callbacks.key) - window->callbacks.key((GLFWwindow*) window, key, scancode, action, mods); -} - -// Notifies shared code of a Unicode codepoint input event -// The 'plain' parameter determines whether to emit a regular character event -// -void _glfwInputChar(_GLFWwindow* window, unsigned int codepoint, int mods, GLFWbool plain) -{ - if (codepoint < 32 || (codepoint > 126 && codepoint < 160)) - return; - - if (!window->lockKeyMods) - mods &= ~(GLFW_MOD_CAPS_LOCK | GLFW_MOD_NUM_LOCK); - - if (window->callbacks.charmods) - window->callbacks.charmods((GLFWwindow*) window, codepoint, mods); - - if (plain) - { - if (window->callbacks.character) - window->callbacks.character((GLFWwindow*) window, codepoint); - } -} - -// Notifies shared code of a scroll event -// -void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset) -{ - if (window->callbacks.scroll) - window->callbacks.scroll((GLFWwindow*) window, xoffset, yoffset); -} - -// Notifies shared code of a mouse button click event -// -void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods) -{ - if (button < 0 || button > GLFW_MOUSE_BUTTON_LAST) - return; - - if (!window->lockKeyMods) - mods &= ~(GLFW_MOD_CAPS_LOCK | GLFW_MOD_NUM_LOCK); - - if (action == GLFW_RELEASE && window->stickyMouseButtons) - window->mouseButtons[button] = _GLFW_STICK; - else - window->mouseButtons[button] = (char) action; - - if (window->callbacks.mouseButton) - window->callbacks.mouseButton((GLFWwindow*) window, button, action, mods); -} - -// Notifies shared code of a cursor motion event -// The position is specified in content area relative screen coordinates -// -void _glfwInputCursorPos(_GLFWwindow* window, double xpos, double ypos) -{ - if (window->virtualCursorPosX == xpos && window->virtualCursorPosY == ypos) - return; - - window->virtualCursorPosX = xpos; - window->virtualCursorPosY = ypos; - - if (window->callbacks.cursorPos) - window->callbacks.cursorPos((GLFWwindow*) window, xpos, ypos); -} - -// Notifies shared code of a cursor enter/leave event -// -void _glfwInputCursorEnter(_GLFWwindow* window, GLFWbool entered) -{ - if (window->callbacks.cursorEnter) - window->callbacks.cursorEnter((GLFWwindow*) window, entered); -} - -// Notifies shared code of files or directories dropped on a window -// -void _glfwInputDrop(_GLFWwindow* window, int count, const char** paths) -{ - if (window->callbacks.drop) - window->callbacks.drop((GLFWwindow*) window, count, paths); -} - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -// Center the cursor in the content area of the specified window -// -void _glfwCenterCursorInContentArea(_GLFWwindow* window) -{ - int width, height; - - _glfwPlatformGetWindowSize(window, &width, &height); - _glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0); -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW public API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI FCLinjectorfun glfwSetInjectorCallback(FCLinjectorfun cbfun) -{ - _glfwPlatformSetInjectorCallback(cbfun); - return cbfun; -} - -GLFWAPI void glfwSetHitResultType(int type) -{ - _glfwPlatformSetHitResultType(type); -} - -GLFWAPI int glfwGetInputMode(GLFWwindow* handle, int mode) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(0); - - switch (mode) - { - case GLFW_CURSOR: - return window->cursorMode; - case GLFW_STICKY_KEYS: - return window->stickyKeys; - case GLFW_STICKY_MOUSE_BUTTONS: - return window->stickyMouseButtons; - case GLFW_LOCK_KEY_MODS: - return window->lockKeyMods; - case GLFW_RAW_MOUSE_MOTION: - return window->rawMouseMotion; - } - - _glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode); - return 0; -} - -GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - if (mode == GLFW_CURSOR) - { - if (value != GLFW_CURSOR_NORMAL && - value != GLFW_CURSOR_HIDDEN && - value != GLFW_CURSOR_DISABLED) - { - _glfwInputError(GLFW_INVALID_ENUM, - "Invalid cursor mode 0x%08X", - value); - return; - } - - if (window->cursorMode == value) - return; - - window->cursorMode = value; - - _glfwPlatformGetCursorPos(window, - &window->virtualCursorPosX, - &window->virtualCursorPosY); - _glfwPlatformSetCursorMode(window, value); - } - else if (mode == GLFW_STICKY_KEYS) - { - value = value ? GLFW_TRUE : GLFW_FALSE; - if (window->stickyKeys == value) - return; - - if (!value) - { - int i; - - // Release all sticky keys - for (i = 0; i <= GLFW_KEY_LAST; i++) - { - if (window->keys[i] == _GLFW_STICK) - window->keys[i] = GLFW_RELEASE; - } - } - - window->stickyKeys = value; - } - else if (mode == GLFW_STICKY_MOUSE_BUTTONS) - { - value = value ? GLFW_TRUE : GLFW_FALSE; - if (window->stickyMouseButtons == value) - return; - - if (!value) - { - int i; - - // Release all sticky mouse buttons - for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) - { - if (window->mouseButtons[i] == _GLFW_STICK) - window->mouseButtons[i] = GLFW_RELEASE; - } - } - - window->stickyMouseButtons = value; - } - else if (mode == GLFW_LOCK_KEY_MODS) - { - window->lockKeyMods = value ? GLFW_TRUE : GLFW_FALSE; - } - else if (mode == GLFW_RAW_MOUSE_MOTION) - { - if (!_glfwPlatformRawMouseMotionSupported()) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Raw mouse motion is not supported on this system"); - return; - } - - value = value ? GLFW_TRUE : GLFW_FALSE; - if (window->rawMouseMotion == value) - return; - - window->rawMouseMotion = value; - _glfwPlatformSetRawMouseMotion(window, value); - } - else - _glfwInputError(GLFW_INVALID_ENUM, "Invalid input mode 0x%08X", mode); -} - -GLFWAPI int glfwRawMouseMotionSupported(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE); - return _glfwPlatformRawMouseMotionSupported(); -} - -GLFWAPI const char* glfwGetKeyName(int key, int scancode) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (key != GLFW_KEY_UNKNOWN) - { - if (key != GLFW_KEY_KP_EQUAL && - (key < GLFW_KEY_KP_0 || key > GLFW_KEY_KP_ADD) && - (key < GLFW_KEY_APOSTROPHE || key > GLFW_KEY_WORLD_2)) - { - return NULL; - } - - scancode = _glfwPlatformGetKeyScancode(key); - } - - return _glfwPlatformGetScancodeName(scancode); -} - -GLFWAPI int glfwGetKeyScancode(int key) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(-1); - - if (key < GLFW_KEY_SPACE || key > GLFW_KEY_LAST) - { - _glfwInputError(GLFW_INVALID_ENUM, "Invalid key %i", key); - return GLFW_RELEASE; - } - - return _glfwPlatformGetKeyScancode(key); -} - -GLFWAPI int glfwGetKey(GLFWwindow* handle, int key) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_RELEASE); - - if (key < GLFW_KEY_SPACE || key > GLFW_KEY_LAST) - { - _glfwInputError(GLFW_INVALID_ENUM, "Invalid key %i", key); - return GLFW_RELEASE; - } - - if (window->keys[key] == _GLFW_STICK) - { - // Sticky mode: release key now - window->keys[key] = GLFW_RELEASE; - return GLFW_PRESS; - } - - return (int) window->keys[key]; -} - -GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_RELEASE); - - if (button < GLFW_MOUSE_BUTTON_1 || button > GLFW_MOUSE_BUTTON_LAST) - { - _glfwInputError(GLFW_INVALID_ENUM, "Invalid mouse button %i", button); - return GLFW_RELEASE; - } - - if (window->mouseButtons[button] == _GLFW_STICK) - { - // Sticky mode: release mouse button now - window->mouseButtons[button] = GLFW_RELEASE; - return GLFW_PRESS; - } - - return (int) window->mouseButtons[button]; -} - -GLFWAPI void glfwGetCursorPos(GLFWwindow* handle, double* xpos, double* ypos) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; - - _GLFW_REQUIRE_INIT(); - - if (window->cursorMode == GLFW_CURSOR_DISABLED) - { - if (xpos) - *xpos = window->virtualCursorPosX; - if (ypos) - *ypos = window->virtualCursorPosY; - } - else - _glfwPlatformGetCursorPos(window, xpos, ypos); -} - -GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, double xpos, double ypos) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - if (xpos != xpos || xpos < -DBL_MAX || xpos > DBL_MAX || - ypos != ypos || ypos < -DBL_MAX || ypos > DBL_MAX) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid cursor position %f %f", - xpos, ypos); - return; - } - - if (!_glfwPlatformWindowFocused(window)) - return; - - if (window->cursorMode == GLFW_CURSOR_DISABLED) - { - // Only update the accumulated position if the cursor is disabled - window->virtualCursorPosX = xpos; - window->virtualCursorPosY = ypos; - } - else - { - // Update system cursor position - _glfwPlatformSetCursorPos(window, xpos, ypos); - } -} - -GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot) -{ - _GLFWcursor* cursor; - - assert(image != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - cursor = calloc(1, sizeof(_GLFWcursor)); - cursor->next = _glfw.cursorListHead; - _glfw.cursorListHead = cursor; - - if (!_glfwPlatformCreateCursor(cursor, image, xhot, yhot)) - { - glfwDestroyCursor((GLFWcursor*) cursor); - return NULL; - } - - return (GLFWcursor*) cursor; -} - -GLFWAPI GLFWcursor* glfwCreateStandardCursor(int shape) -{ - _GLFWcursor* cursor; - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (shape != GLFW_ARROW_CURSOR && - shape != GLFW_IBEAM_CURSOR && - shape != GLFW_CROSSHAIR_CURSOR && - shape != GLFW_HAND_CURSOR && - shape != GLFW_HRESIZE_CURSOR && - shape != GLFW_VRESIZE_CURSOR) - { - _glfwInputError(GLFW_INVALID_ENUM, "Invalid standard cursor 0x%08X", shape); - return NULL; - } - - cursor = calloc(1, sizeof(_GLFWcursor)); - cursor->next = _glfw.cursorListHead; - _glfw.cursorListHead = cursor; - - if (!_glfwPlatformCreateStandardCursor(cursor, shape)) - { - glfwDestroyCursor((GLFWcursor*) cursor); - return NULL; - } - - return (GLFWcursor*) cursor; -} - -GLFWAPI void glfwDestroyCursor(GLFWcursor *handle) {} - -GLFWAPI void glfwSetCursor(GLFWwindow* windowHandle, GLFWcursor* cursorHandle) {} - -GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* handle, GLFWkeyfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.key, cbfun); - return cbfun; -} - -GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* handle, GLFWcharfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.character, cbfun); - return cbfun; -} - -GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* handle, GLFWcharmodsfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.charmods, cbfun); - return cbfun; -} - -GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* handle, - GLFWmousebuttonfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.mouseButton, cbfun); - return cbfun; -} - -GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* handle, - GLFWcursorposfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.cursorPos, cbfun); - return cbfun; -} - -GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* handle, - GLFWcursorenterfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.cursorEnter, cbfun); - return cbfun; -} - -GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* handle, - GLFWscrollfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.scroll, cbfun); - return cbfun; -} - -GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* handle, GLFWdropfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.drop, cbfun); - return cbfun; -} - -GLFWAPI void glfwSetClipboardString(GLFWwindow* handle, const char* string) -{ - assert(string != NULL); - - _GLFW_REQUIRE_INIT(); - _glfwPlatformSetClipboardString(string); -} - -GLFWAPI const char* glfwGetClipboardString(GLFWwindow* handle) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return _glfwPlatformGetClipboardString(); -} - -GLFWAPI double glfwGetTime(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(0.0); - return (double) (_glfwPlatformGetTimerValue() - _glfw.timer.offset) / - _glfwPlatformGetTimerFrequency(); -} - -GLFWAPI void glfwSetTime(double time) -{ - _GLFW_REQUIRE_INIT(); - - if (time != time || time < 0.0 || time > 18446744073.0) - { - _glfwInputError(GLFW_INVALID_VALUE, "Invalid time %f", time); - return; - } - - _glfw.timer.offset = _glfwPlatformGetTimerValue() - - (uint64_t) (time * _glfwPlatformGetTimerFrequency()); -} - -GLFWAPI uint64_t glfwGetTimerValue(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(0); - return _glfwPlatformGetTimerValue(); -} - -GLFWAPI uint64_t glfwGetTimerFrequency(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(0); - return _glfwPlatformGetTimerFrequency(); -} diff --git a/FCLauncher/src/main/jni/glfw/monitor.c b/FCLauncher/src/main/jni/glfw/monitor.c deleted file mode 100644 index 4174795d..00000000 --- a/FCLauncher/src/main/jni/glfw/monitor.c +++ /dev/null @@ -1,517 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#include -#include -#include -#include -#include -#include - - -// Lexically compare video modes, used by qsort -// -static int compareVideoModes(const void* fp, const void* sp) -{ - const GLFWvidmode* fm = fp; - const GLFWvidmode* sm = sp; - const int fbpp = fm->redBits + fm->greenBits + fm->blueBits; - const int sbpp = sm->redBits + sm->greenBits + sm->blueBits; - const int farea = fm->width * fm->height; - const int sarea = sm->width * sm->height; - - // First sort on color bits per pixel - if (fbpp != sbpp) - return fbpp - sbpp; - - // Then sort on screen area - if (farea != sarea) - return farea - sarea; - - // Then sort on width - if (fm->width != sm->width) - return fm->width - sm->width; - - // Lastly sort on refresh rate - return fm->refreshRate - sm->refreshRate; -} - -// Retrieves the available modes for the specified monitor -// -static GLFWbool refreshVideoModes(_GLFWmonitor* monitor) -{ - int modeCount; - GLFWvidmode* modes; - - if (monitor->modes) - return GLFW_TRUE; - - modes = _glfwPlatformGetVideoModes(monitor, &modeCount); - if (!modes) - return GLFW_FALSE; - - qsort(modes, modeCount, sizeof(GLFWvidmode), compareVideoModes); - - free(monitor->modes); - monitor->modes = modes; - monitor->modeCount = modeCount; - - return GLFW_TRUE; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW event API ////// -////////////////////////////////////////////////////////////////////////// - -// Notifies shared code of a monitor connection or disconnection -// -void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement) -{ - if (action == GLFW_CONNECTED) - { - _glfw.monitorCount++; - _glfw.monitors = - realloc(_glfw.monitors, sizeof(_GLFWmonitor*) * _glfw.monitorCount); - - if (placement == _GLFW_INSERT_FIRST) - { - memmove(_glfw.monitors + 1, - _glfw.monitors, - ((size_t) _glfw.monitorCount - 1) * sizeof(_GLFWmonitor*)); - _glfw.monitors[0] = monitor; - } - else - _glfw.monitors[_glfw.monitorCount - 1] = monitor; - } - else if (action == GLFW_DISCONNECTED) - { - int i; - _GLFWwindow* window; - - for (window = _glfw.windowListHead; window; window = window->next) - { - if (window->monitor == monitor) - { - int width, height, xoff, yoff; - _glfwPlatformGetWindowSize(window, &width, &height); - _glfwPlatformSetWindowMonitor(window, NULL, 0, 0, width, height, 0); - _glfwPlatformGetWindowFrameSize(window, &xoff, &yoff, NULL, NULL); - _glfwPlatformSetWindowPos(window, xoff, yoff); - } - } - - for (i = 0; i < _glfw.monitorCount; i++) - { - if (_glfw.monitors[i] == monitor) - { - _glfw.monitorCount--; - memmove(_glfw.monitors + i, - _glfw.monitors + i + 1, - ((size_t) _glfw.monitorCount - i) * sizeof(_GLFWmonitor*)); - break; - } - } - } - - if (_glfw.callbacks.monitor) - _glfw.callbacks.monitor((GLFWmonitor*) monitor, action); - - if (action == GLFW_DISCONNECTED) - _glfwFreeMonitor(monitor); -} - -// Notifies shared code that a full screen window has acquired or released -// a monitor -// -void _glfwInputMonitorWindow(_GLFWmonitor* monitor, _GLFWwindow* window) -{ - monitor->window = window; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -// Allocates and returns a monitor object with the specified name and dimensions -// -_GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM) -{ - _GLFWmonitor* monitor = calloc(1, sizeof(_GLFWmonitor)); - monitor->widthMM = widthMM; - monitor->heightMM = heightMM; - - strncpy(monitor->name, name, sizeof(monitor->name) - 1); - - return monitor; -} - -// Frees a monitor object and any data associated with it -// -void _glfwFreeMonitor(_GLFWmonitor* monitor) -{ - if (monitor == NULL) - return; - - _glfwPlatformFreeMonitor(monitor); - - _glfwFreeGammaArrays(&monitor->originalRamp); - _glfwFreeGammaArrays(&monitor->currentRamp); - - free(monitor->modes); - free(monitor); -} - -// Allocates red, green and blue value arrays of the specified size -// -void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size) -{ - ramp->red = calloc(size, sizeof(unsigned short)); - ramp->green = calloc(size, sizeof(unsigned short)); - ramp->blue = calloc(size, sizeof(unsigned short)); - ramp->size = size; -} - -// Frees the red, green and blue value arrays and clears the struct -// -void _glfwFreeGammaArrays(GLFWgammaramp* ramp) -{ - free(ramp->red); - free(ramp->green); - free(ramp->blue); - - memset(ramp, 0, sizeof(GLFWgammaramp)); -} - -// Chooses the video mode most closely matching the desired one -// -const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor, - const GLFWvidmode* desired) -{ - int i; - unsigned int sizeDiff, leastSizeDiff = UINT_MAX; - unsigned int rateDiff, leastRateDiff = UINT_MAX; - unsigned int colorDiff, leastColorDiff = UINT_MAX; - const GLFWvidmode* current; - const GLFWvidmode* closest = NULL; - - if (!refreshVideoModes(monitor)) - return NULL; - - for (i = 0; i < monitor->modeCount; i++) - { - current = monitor->modes + i; - - colorDiff = 0; - - if (desired->redBits != GLFW_DONT_CARE) - colorDiff += abs(current->redBits - desired->redBits); - if (desired->greenBits != GLFW_DONT_CARE) - colorDiff += abs(current->greenBits - desired->greenBits); - if (desired->blueBits != GLFW_DONT_CARE) - colorDiff += abs(current->blueBits - desired->blueBits); - - sizeDiff = abs((current->width - desired->width) * - (current->width - desired->width) + - (current->height - desired->height) * - (current->height - desired->height)); - - if (desired->refreshRate != GLFW_DONT_CARE) - rateDiff = abs(current->refreshRate - desired->refreshRate); - else - rateDiff = UINT_MAX - current->refreshRate; - - if ((colorDiff < leastColorDiff) || - (colorDiff == leastColorDiff && sizeDiff < leastSizeDiff) || - (colorDiff == leastColorDiff && sizeDiff == leastSizeDiff && rateDiff < leastRateDiff)) - { - closest = current; - leastSizeDiff = sizeDiff; - leastRateDiff = rateDiff; - leastColorDiff = colorDiff; - } - } - - return closest; -} - -// Performs lexical comparison between two @ref GLFWvidmode structures -// -int _glfwCompareVideoModes(const GLFWvidmode* fm, const GLFWvidmode* sm) -{ - return compareVideoModes(fm, sm); -} - -// Splits a color depth into red, green and blue bit depths -// -void _glfwSplitBPP(int bpp, int* red, int* green, int* blue) -{ - int delta; - - // We assume that by 32 the user really meant 24 - if (bpp == 32) - bpp = 24; - - // Convert "bits per pixel" to red, green & blue sizes - - *red = *green = *blue = bpp / 3; - delta = bpp - (*red * 3); - if (delta >= 1) - *green = *green + 1; - - if (delta == 2) - *red = *red + 1; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW public API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI GLFWmonitor** glfwGetMonitors(int* count) -{ - assert(count != NULL); - - *count = 0; - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - *count = _glfw.monitorCount; - return (GLFWmonitor**) _glfw.monitors; -} - -GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (!_glfw.monitorCount) - return NULL; - - return (GLFWmonitor*) _glfw.monitors[0]; -} - -GLFWAPI void glfwGetMonitorPos(GLFWmonitor* handle, int* xpos, int* ypos) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; - - _GLFW_REQUIRE_INIT(); - - _glfwPlatformGetMonitorPos(monitor, xpos, ypos); -} - -GLFWAPI void glfwGetMonitorWorkarea(GLFWmonitor* handle, - int* xpos, int* ypos, - int* width, int* height) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; - if (width) - *width = 0; - if (height) - *height = 0; - - _GLFW_REQUIRE_INIT(); - - _glfwPlatformGetMonitorWorkarea(monitor, xpos, ypos, width, height); -} - -GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* handle, int* widthMM, int* heightMM) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - if (widthMM) - *widthMM = 0; - if (heightMM) - *heightMM = 0; - - _GLFW_REQUIRE_INIT(); - - if (widthMM) - *widthMM = monitor->widthMM; - if (heightMM) - *heightMM = monitor->heightMM; -} - -GLFWAPI void glfwGetMonitorContentScale(GLFWmonitor* handle, - float* xscale, float* yscale) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - if (xscale) - *xscale = 0.f; - if (yscale) - *yscale = 0.f; - - _GLFW_REQUIRE_INIT(); - _glfwPlatformGetMonitorContentScale(monitor, xscale, yscale); -} - -GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return monitor->name; -} - -GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor* handle, void* pointer) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - _GLFW_REQUIRE_INIT(); - monitor->userPointer = pointer; -} - -GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return monitor->userPointer; -} - -GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(_glfw.callbacks.monitor, cbfun); - return cbfun; -} - -GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* handle, int* count) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - assert(count != NULL); - - *count = 0; - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (!refreshVideoModes(monitor)) - return NULL; - - *count = monitor->modeCount; - return monitor->modes; -} - -GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - _glfwPlatformGetVideoMode(monitor, &monitor->currentMode); - return &monitor->currentMode; -} - -GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma) -{ - unsigned int i; - unsigned short* values; - GLFWgammaramp ramp; - const GLFWgammaramp* original; - assert(handle != NULL); - assert(gamma > 0.f); - assert(gamma <= FLT_MAX); - - _GLFW_REQUIRE_INIT(); - - if (gamma != gamma || gamma <= 0.f || gamma > FLT_MAX) - { - _glfwInputError(GLFW_INVALID_VALUE, "Invalid gamma value %f", gamma); - return; - } - - original = glfwGetGammaRamp(handle); - if (!original) - return; - - values = calloc(original->size, sizeof(unsigned short)); - - for (i = 0; i < original->size; i++) - { - float value; - - // Calculate intensity - value = i / (float) (original->size - 1); - // Apply gamma curve - value = powf(value, 1.f / gamma) * 65535.f + 0.5f; - // Clamp to value range - value = _glfw_fminf(value, 65535.f); - - values[i] = (unsigned short) value; - } - - ramp.red = values; - ramp.green = values; - ramp.blue = values; - ramp.size = original->size; - - glfwSetGammaRamp(handle, &ramp); - free(values); -} - -GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - _glfwFreeGammaArrays(&monitor->currentRamp); - if (!_glfwPlatformGetGammaRamp(monitor, &monitor->currentRamp)) - return NULL; - - return &monitor->currentRamp; -} - -GLFWAPI void glfwSetGammaRamp(GLFWmonitor* handle, const GLFWgammaramp* ramp) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - assert(monitor != NULL); - assert(ramp != NULL); - assert(ramp->size > 0); - assert(ramp->red != NULL); - assert(ramp->green != NULL); - assert(ramp->blue != NULL); - - if (ramp->size <= 0) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid gamma ramp size %i", - ramp->size); - return; - } - - _GLFW_REQUIRE_INIT(); - - if (!monitor->originalRamp.size) - { - if (!_glfwPlatformGetGammaRamp(monitor, &monitor->originalRamp)) - return; - } - - _glfwPlatformSetGammaRamp(monitor, ramp); -} - diff --git a/FCLauncher/src/main/jni/glfw/osmesa_context.c b/FCLauncher/src/main/jni/glfw/osmesa_context.c deleted file mode 100644 index 41b1eeaa..00000000 --- a/FCLauncher/src/main/jni/glfw/osmesa_context.c +++ /dev/null @@ -1,471 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include -#include -#include - -#include -#include -#include -#include - -int (*vtest_main) (int argc, char** argv); -void (*vtest_swap_buffers) (void); - -ANativeWindow_Buffer buf; -int32_t stride; - -#ifndef FCL_NSBYPASS_H -#define FCL_NSBYPASS_H - -void* load_turnip_vulkan(); - -#endif - -void* makeContextCurrentEGL(void* win) { - _GLFWwindow* window = win; - if (!eglMakeCurrent(_glfw.egl.display, - window->context.egl.handle == 0 ? (EGLSurface *) 0 : window->context.egl.surface, - window->context.egl.handle == 0 ? (EGLSurface *) 0 : window->context.egl.surface, - window->context.egl.handle)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "EGL: Failed to make context current: %04x", - eglGetError()); - } - - if (strcmp(getenv("LIBGL_STRING"), "VirGLRenderer") == 0) { - vtest_main(3, (const char*[]) {"vtest", "--no-loop-or-fork", "--use-gles", NULL, NULL}); - } -} - -static void makeContextCurrentOSMesa(_GLFWwindow* window) -{ - if (window) - { - int width, height; - _glfwPlatformGetFramebufferSize(window, &width, &height); - - // Check to see if we need to allocate a new buffer - if ((window->context.osmesa.buffer == NULL) || - (width != window->context.osmesa.width) || - (height != window->context.osmesa.height)) - { - free(window->context.osmesa.buffer); - - // Allocate the new buffer (width * height * 8-bit RGBA) - window->context.osmesa.buffer = calloc(4, (size_t) width * height); - window->context.osmesa.width = width; - window->context.osmesa.height = height; - } - - if (!OSMesaMakeCurrent(window->context.osmesa.handle, - window->context.osmesa.buffer, - GL_UNSIGNED_BYTE, - width, height)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "OSMesa: Failed to make context current"); - return; - } - - if (strcmp(getenv("LIBGL_STRING"), "VirGLRenderer") != 0) { - ANativeWindow_lock(window->fcl.handle, &buf, NULL); - OSMesaPixelStore(OSMESA_ROW_LENGTH, buf.stride); - stride = buf.stride; - OSMesaPixelStore(OSMESA_Y_UP, 0); - } - - window->context.Clear = (PFNGLCLEAR) window->context.getProcAddress("glClear"); - window->context.ClearColor = (PFNGLCLEARCOLOR) window->context.getProcAddress("glClearColor"); - window->context.ReadPixels = (PFNGLREADPIXELS) window->context.getProcAddress("glReadPixels"); - window->context.Finish = (PFNGLFINISH) window->context.getProcAddress("glFinish"); - if (!window->context.Clear || !window->context.ClearColor || !window->context.ReadPixels || !window->context.Finish) { - _glfwInputError(GLFW_PLATFORM_ERROR, "Entry point retrieval is broken"); - return; - } - - window->context.Clear(GL_COLOR_BUFFER_BIT); - window->context.ClearColor(0.4f, 0.4f, 0.4f, 1.0f); - - int pixelsArr[4]; - window->context.ReadPixels(0, 0, 1, 1, GL_RGB, GL_INT, &pixelsArr); - - window->context.swapBuffers(window); - } - - _glfwPlatformSetTls(&_glfw.contextSlot, window); -} - -static GLFWglproc getProcAddressOSMesa(const char* procname) -{ - return (GLFWglproc) OSMesaGetProcAddress(procname); -} - -static void destroyContextOSMesa(_GLFWwindow* window) -{ - if (window->context.osmesa.handle) - { - OSMesaDestroyContext(window->context.osmesa.handle); - window->context.osmesa.handle = NULL; - } - - if (window->context.osmesa.buffer) - { - free(window->context.osmesa.buffer); - window->context.osmesa.width = 0; - window->context.osmesa.height = 0; - } -} - -static void swapBuffersOSMesa(_GLFWwindow* window) -{ - if (strcmp(getenv("LIBGL_STRING"), "VirGLRenderer") == 0) { - window->context.Finish(); - vtest_swap_buffers(); - } else { - OSMesaContext context = OSMesaGetCurrentContext(); - if (context == NULL) { - printf("OSMesa: attempted to swap buffers without context!"); - return; - } - OSMesaMakeCurrent(context, buf.bits, GL_UNSIGNED_BYTE, buf.width, buf.height); - if (stride != buf.stride) OSMesaPixelStore(OSMESA_ROW_LENGTH, buf.stride); - stride = buf.stride; - window->context.Finish(); - ANativeWindow_unlockAndPost(window->fcl.handle); - ANativeWindow_lock(window->fcl.handle, &buf, NULL); - } -} - -static void swapIntervalOSMesa(int interval) -{ - if (strcmp(getenv("LIBGL_STRING"), "VirGLRenderer") == 0) { - eglSwapInterval(_glfw.egl.display, interval); - } -} - -static int extensionSupportedOSMesa(const char* extension) -{ - // OSMesa does not have extensions - return GLFW_FALSE; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -static void set_vulkan_ptr(void* ptr) { - char envval[64]; - sprintf(envval, "%"PRIxPTR, (uintptr_t)ptr); - setenv("VULKAN_PTR", envval, 1); -} - -void load_vulkan() { - if(getenv("VULKAN_DRIVER_SYSTEM") == NULL && android_get_device_api_level() >= 28) { -#ifdef ADRENO_POSSIBLE - void* result = load_turnip_vulkan(); - if(result != NULL) { - printf("AdrenoSupp: Loaded Turnip, loader address: %p\n", result); - set_vulkan_ptr(result); - return; - } -#endif - } - printf("OSMDroid: loading vulkan regularly...\n"); - void* vulkan_ptr = dlopen("libvulkan.so", RTLD_LAZY | RTLD_LOCAL); - printf("OSMDroid: loaded vulkan, ptr=%p\n", vulkan_ptr); - set_vulkan_ptr(vulkan_ptr); -} - -GLFWbool _glfwInitOSMesa(void) -{ - if (_glfw.osmesa.handle) - return GLFW_TRUE; - - _glfw.osmesa.handle = _glfw_dlopen(getenv("LIBGL_NAME")); - - const char *renderer = getenv("LIBGL_STRING"); - - if (strcmp(renderer, "Zink") == 0) - load_vulkan(); - - if (!_glfw.osmesa.handle) - { - _glfwInputError(GLFW_API_UNAVAILABLE, "OSMesa: Library not found"); - return GLFW_FALSE; - } - - _glfw.osmesa.CreateContext = (PFN_OSMesaCreateContext) - _glfw_dlsym(_glfw.osmesa.handle, "OSMesaCreateContext"); - _glfw.osmesa.GetCurrentContext = (PFN_OSMesaGetCurrentContext) - _glfw_dlsym(_glfw.osmesa.handle, "OSMesaGetCurrentContext"); - _glfw.osmesa.DestroyContext = (PFN_OSMesaDestroyContext) - _glfw_dlsym(_glfw.osmesa.handle, "OSMesaDestroyContext"); - _glfw.osmesa.PixelStore = (PFN_OSMesaPixelStore) - _glfw_dlsym(_glfw.osmesa.handle, "OSMesaPixelStore"); - _glfw.osmesa.MakeCurrent = (PFN_OSMesaMakeCurrent) - _glfw_dlsym(_glfw.osmesa.handle, "OSMesaMakeCurrent"); - _glfw.osmesa.GetColorBuffer = (PFN_OSMesaGetColorBuffer) - _glfw_dlsym(_glfw.osmesa.handle, "OSMesaGetColorBuffer"); - _glfw.osmesa.GetDepthBuffer = (PFN_OSMesaGetDepthBuffer) - _glfw_dlsym(_glfw.osmesa.handle, "OSMesaGetDepthBuffer"); - _glfw.osmesa.GetProcAddress = (PFN_OSMesaGetProcAddress) - _glfw_dlsym(_glfw.osmesa.handle, "OSMesaGetProcAddress"); - - if (strcmp(renderer, "VirGLRenderer") == 0) { - char* fileName = calloc(1, 1024); - sprintf(fileName, "%s/libvirgl_test_server.so", getenv("FCL_NATIVEDIR")); - void *handle = _glfw_dlopen(fileName); - if (!handle) { - printf("VirGL: %s\n", dlerror()); - return GLFW_FALSE; - } - vtest_main = _glfw_dlsym(handle, "vtest_main"); - vtest_swap_buffers = _glfw_dlsym(handle, "vtest_swap_buffers"); - free(fileName); - if (!vtest_main || !vtest_swap_buffers) { - _glfwInputError(GLFW_PLATFORM_ERROR, "OSMesa: Failed to load required entry points"); - _glfwTerminateOSMesa(); - return GLFW_FALSE; - } - } - - if (!_glfw.osmesa.CreateContext || - !_glfw.osmesa.GetCurrentContext || - !_glfw.osmesa.DestroyContext || - !_glfw.osmesa.PixelStore || - !_glfw.osmesa.MakeCurrent || - !_glfw.osmesa.GetColorBuffer || - !_glfw.osmesa.GetDepthBuffer || - !_glfw.osmesa.GetProcAddress) - { - _glfwInputError(GLFW_PLATFORM_ERROR, "OSMesa: Failed to load required entry points"); - _glfwTerminateOSMesa(); - return GLFW_FALSE; - } - - return GLFW_TRUE; -} - -void _glfwTerminateOSMesa(void) -{ - if (_glfw.osmesa.handle) - { - _glfw_dlclose(_glfw.osmesa.handle); - _glfw.osmesa.handle = NULL; - } -} - -#define setAttrib(a, v) \ -{ \ - assert(((size_t) index + 1) < sizeof(attribs) / sizeof(attribs[0])); \ - attribs[index++] = a; \ - attribs[index++] = v; \ -} - -GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig) -{ - const char *renderer = getenv("LIBGL_STRING"); - if (strcmp(renderer, "VirGLRenderer") == 0) { - EGLConfig config = malloc(sizeof(EGLConfig)); - EGLint egl_attributes[] = { - EGL_BLUE_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_RED_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 24, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT|0x0001, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_NONE - }; - - EGLint num_configs = 0; - EGLint vid; - - if (eglChooseConfig(_glfw.egl.display, egl_attributes, &config, 1, &num_configs) != GLFW_TRUE) { - _glfwInputError(GLFW_API_UNAVAILABLE, "eglChooseConfig() failed: %04x", - eglGetError()); - return GLFW_FALSE; - } - - if (num_configs == 0) { - _glfwInputError(GLFW_API_UNAVAILABLE, "%s", - "eglChooseConfig() found no matching config"); - return GLFW_FALSE; - } - - if (eglGetConfigAttrib(_glfw.egl.display, config, EGL_NATIVE_VISUAL_ID, &vid) != GLFW_TRUE) { - _glfwInputError(GLFW_API_UNAVAILABLE, "eglGetConfigAttrib() failed: %04x", - eglGetError()); - return GLFW_FALSE; - } - - ANativeWindow_setBuffersGeometry(window->fcl.handle, 0, 0, vid); - - eglBindAPI(EGL_OPENGL_ES_API); - - window->context.egl.surface = eglCreateWindowSurface(_glfw.egl.display, - config, - _GLFW_EGL_NATIVE_WINDOW, - NULL); - if (window->context.egl.surface == EGL_NO_SURFACE) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "EGL: Failed to create window surface: %04x", - eglGetError()); - return GLFW_FALSE; - } - window->context.egl.config = config; - - { - EGLint val; - assert(eglGetConfigAttrib(_glfw.egl.display, config, EGL_SURFACE_TYPE, &val)); - assert(val & EGL_WINDOW_BIT); - } - - const EGLint virgl_context_attrib[] = { - EGL_CONTEXT_CLIENT_VERSION, 3, - EGL_NONE - }; - window->context.egl.handle = eglCreateContext(_glfw.egl.display, config, NULL, virgl_context_attrib); - - if (window->context.egl.handle == EGL_NO_CONTEXT) - { - _glfwInputError(GLFW_VERSION_UNAVAILABLE, - "EGL: Failed to create context: %04x", - eglGetError()); - return GLFW_FALSE; - } - - pthread_t t; - pthread_create(&t, NULL, makeContextCurrentEGL, (void*) window); - usleep(100 * 1000); - } - - OSMesaContext share = NULL; - - if (ctxconfig->client == GLFW_OPENGL_ES_API) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "OSMesa: OpenGL ES is not available on OSMesa"); - return GLFW_FALSE; - } - - if (ctxconfig->share) - share = ctxconfig->share->context.osmesa.handle; - - window->context.osmesa.handle = OSMesaCreateContext(OSMESA_RGBA, share); - - if (window->context.osmesa.handle == NULL) - { - _glfwInputError(GLFW_VERSION_UNAVAILABLE, - "OSMesa: Failed to create context"); - return GLFW_FALSE; - } - - window->context.makeCurrent = makeContextCurrentOSMesa; - window->context.swapBuffers = swapBuffersOSMesa; - window->context.swapInterval = swapIntervalOSMesa; - window->context.extensionSupported = extensionSupportedOSMesa; - window->context.getProcAddress = getProcAddressOSMesa; - window->context.destroy = destroyContextOSMesa; - - return GLFW_TRUE; -} - -#undef setAttrib - - -////////////////////////////////////////////////////////////////////////// -////// GLFW native API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* handle, int* width, - int* height, int* format, void** buffer) -{ - void* mesaBuffer; - GLint mesaWidth, mesaHeight, mesaFormat; - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE); - - if (!OSMesaGetColorBuffer(window->context.osmesa.handle, - &mesaWidth, &mesaHeight, - &mesaFormat, &mesaBuffer)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "OSMesa: Failed to retrieve color buffer"); - return GLFW_FALSE; - } - - if (width) - *width = mesaWidth; - if (height) - *height = mesaHeight; - if (format) - *format = mesaFormat; - if (buffer) - *buffer = mesaBuffer; - - return GLFW_TRUE; -} - -GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* handle, - int* width, int* height, - int* bytesPerValue, - void** buffer) -{ - void* mesaBuffer; - GLint mesaWidth, mesaHeight, mesaBytes; - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE); - - if (!OSMesaGetDepthBuffer(window->context.osmesa.handle, - &mesaWidth, &mesaHeight, - &mesaBytes, &mesaBuffer)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "OSMesa: Failed to retrieve depth buffer"); - return GLFW_FALSE; - } - - if (width) - *width = mesaWidth; - if (height) - *height = mesaHeight; - if (bytesPerValue) - *bytesPerValue = mesaBytes; - if (buffer) - *buffer = mesaBuffer; - - return GLFW_TRUE; -} - -GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (window->context.client == GLFW_NO_API) - { - _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); - return NULL; - } - - return window->context.osmesa.handle; -} - -JNIEXPORT jlong JNICALL -Java_org_lwjgl_vulkan_VK_getVulkanDriverHandle(JNIEnv *env, jclass thiz) { - if (getenv("VULKAN_PTR") == NULL) load_vulkan(); - return strtoul(getenv("VULKAN_PTR"), NULL, 0x10); -} diff --git a/FCLauncher/src/main/jni/glfw/platform.c b/FCLauncher/src/main/jni/glfw/platform.c deleted file mode 100644 index 15515c19..00000000 --- a/FCLauncher/src/main/jni/glfw/platform.c +++ /dev/null @@ -1,169 +0,0 @@ -//======================================================================== -// GLFW 3.4 - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2002-2006 Marcus Geelnard -// Copyright (c) 2006-2018 Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// Please use C89 style variable declarations in this file because VS 2010 -//======================================================================== - -#include - -// These construct a string literal from individual numeric constants -#define _GLFW_CONCAT_VERSION(m, n, r) #m "." #n "." #r -#define _GLFW_MAKE_VERSION(m, n, r) _GLFW_CONCAT_VERSION(m, n, r) - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -int GLFW_ANY_PLATFORM = 0x60000, - GLFW_PLATFORM_WIN32 = 0x60001, - GLFW_PLATFORM_COCOA = 0x60002, - GLFW_PLATFORM_WAYLAND = 0x60003, - GLFW_PLATFORM_X11 = 0x60004, - GLFW_PLATFORM_NULL = 0x60005; - -/* -static const struct -{ - int ID; - GLFWbool (*connect)(int,_GLFWplatform*); -} supportedPlatforms[] = - { -#if defined(_GLFW_WIN32) - { GLFW_PLATFORM_WIN32, _glfwConnectWin32 }, -#endif -#if defined(_GLFW_COCOA) - { GLFW_PLATFORM_COCOA, _glfwConnectCocoa }, -#endif -#if defined(_GLFW_X11) - { GLFW_PLATFORM_X11, _glfwConnectX11 }, -#endif -#if defined(_GLFW_WAYLAND) - { GLFW_PLATFORM_WAYLAND, _glfwConnectWayland }, -#endif - }; - -GLFWbool _glfwSelectPlatform(int desiredID, _GLFWplatform* platform) -{ - const size_t count = sizeof(supportedPlatforms) / sizeof(supportedPlatforms[0]); - size_t i; - - if (desiredID != GLFW_ANY_PLATFORM && - desiredID != GLFW_PLATFORM_WIN32 && - desiredID != GLFW_PLATFORM_COCOA && - desiredID != GLFW_PLATFORM_WAYLAND && - desiredID != GLFW_PLATFORM_X11 && - desiredID != GLFW_PLATFORM_NULL) - { - _glfwInputError(GLFW_INVALID_ENUM, "Invalid platform ID 0x%08X", desiredID); - return GLFW_FALSE; - } - - // Only allow the Null platform if specifically requested - if (desiredID == GLFW_PLATFORM_NULL) - return _glfwConnectNull(desiredID, platform); - else if (count == 0) - { - _glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "This binary only supports the Null platform"); - return GLFW_FALSE; - } - - if (desiredID == GLFW_ANY_PLATFORM) - { - // If there is exactly one platform available for auto-selection, let it emit the - // error on failure as the platform-specific error description may be more helpful - if (count == 1) - return supportedPlatforms[0].connect(supportedPlatforms[0].ID, platform); - - for (i = 0; i < count; i++) - { - if (supportedPlatforms[i].connect(desiredID, platform)) - return GLFW_TRUE; - } - - _glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "Failed to detect any supported platform"); - } - else - { - for (i = 0; i < count; i++) - { - if (supportedPlatforms[i].ID == desiredID) - return supportedPlatforms[i].connect(desiredID, platform); - } - - _glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "The requested platform is not supported"); - } - - return GLFW_FALSE; -} - */ - -////////////////////////////////////////////////////////////////////////// -////// GLFW public API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI int glfwGetPlatform(void) -{ - /* - _GLFW_REQUIRE_INIT_OR_RETURN(0); - return _glfw.platform.platformID; - */ - return GLFW_PLATFORM_X11; -} - -GLFWAPI int glfwPlatformSupported(int platformID) -{ - /* - const size_t count = sizeof(supportedPlatforms) / sizeof(supportedPlatforms[0]); - size_t i; - - if (platformID != GLFW_PLATFORM_WIN32 && - platformID != GLFW_PLATFORM_COCOA && - platformID != GLFW_PLATFORM_WAYLAND && - platformID != GLFW_PLATFORM_X11 && - platformID != GLFW_PLATFORM_NULL) - { - _glfwInputError(GLFW_INVALID_ENUM, "Invalid platform ID 0x%08X", platformID); - return GLFW_FALSE; - } - - if (platformID == GLFW_PLATFORM_NULL) - return GLFW_TRUE; - - for (i = 0; i < count; i++) - { - if (platformID == supportedPlatforms[i].ID) - return GLFW_TRUE; - } - - return GLFW_FALSE; - */ - return GLFW_TRUE; -} - -GLFWAPI const char* glfwGetVersionString(void) -{ - return _glfwPlatformGetVersionString(); -} \ No newline at end of file diff --git a/FCLauncher/src/main/jni/glfw/posix_thread.c b/FCLauncher/src/main/jni/glfw/posix_thread.c deleted file mode 100644 index 29bb84df..00000000 --- a/FCLauncher/src/main/jni/glfw/posix_thread.c +++ /dev/null @@ -1,80 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#include -#include - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls) -{ - assert(tls->posix.allocated == GLFW_FALSE); - - if (pthread_key_create(&tls->posix.key, NULL) != 0) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "POSIX: Failed to create context TLS"); - return GLFW_FALSE; - } - - tls->posix.allocated = GLFW_TRUE; - return GLFW_TRUE; -} - -void _glfwPlatformDestroyTls(_GLFWtls* tls) -{ - if (tls->posix.allocated) - pthread_key_delete(tls->posix.key); - memset(tls, 0, sizeof(_GLFWtls)); -} - -void* _glfwPlatformGetTls(_GLFWtls* tls) -{ - assert(tls->posix.allocated == GLFW_TRUE); - return pthread_getspecific(tls->posix.key); -} - -void _glfwPlatformSetTls(_GLFWtls* tls, void* value) -{ - assert(tls->posix.allocated == GLFW_TRUE); - pthread_setspecific(tls->posix.key, value); -} - -GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex) -{ - assert(mutex->posix.allocated == GLFW_FALSE); - - if (pthread_mutex_init(&mutex->posix.handle, NULL) != 0) - { - _glfwInputError(GLFW_PLATFORM_ERROR, "POSIX: Failed to create mutex"); - return GLFW_FALSE; - } - - return mutex->posix.allocated = GLFW_TRUE; -} - -void _glfwPlatformDestroyMutex(_GLFWmutex* mutex) -{ - if (mutex->posix.allocated) - pthread_mutex_destroy(&mutex->posix.handle); - memset(mutex, 0, sizeof(_GLFWmutex)); -} - -void _glfwPlatformLockMutex(_GLFWmutex* mutex) -{ - assert(mutex->posix.allocated == GLFW_TRUE); - pthread_mutex_lock(&mutex->posix.handle); -} - -void _glfwPlatformUnlockMutex(_GLFWmutex* mutex) -{ - assert(mutex->posix.allocated == GLFW_TRUE); - pthread_mutex_unlock(&mutex->posix.handle); -} - diff --git a/FCLauncher/src/main/jni/glfw/posix_time.c b/FCLauncher/src/main/jni/glfw/posix_time.c deleted file mode 100644 index c6b2fe82..00000000 --- a/FCLauncher/src/main/jni/glfw/posix_time.c +++ /dev/null @@ -1,62 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include -#include - -#include - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -// Initialise timer -// -void _glfwInitTimerPOSIX(void) -{ -#if defined(CLOCK_MONOTONIC) - struct timespec ts; - - if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) - { - _glfw.timer.posix.monotonic = GLFW_TRUE; - _glfw.timer.posix.frequency = 1000000000; - } - else -#endif - { - _glfw.timer.posix.monotonic = GLFW_FALSE; - _glfw.timer.posix.frequency = 1000000; - } -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -uint64_t _glfwPlatformGetTimerValue(void) -{ -#if defined(CLOCK_MONOTONIC) - if (_glfw.timer.posix.monotonic) - { - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - return (uint64_t) ts.tv_sec * (uint64_t) 1000000000 + (uint64_t) ts.tv_nsec; - } - else -#endif - { - struct timeval tv; - gettimeofday(&tv, NULL); - return (uint64_t) tv.tv_sec * (uint64_t) 1000000 + (uint64_t) tv.tv_usec; - } -} - -uint64_t _glfwPlatformGetTimerFrequency(void) -{ - return _glfw.timer.posix.frequency; -} - diff --git a/FCLauncher/src/main/jni/glfw/vulkan.c b/FCLauncher/src/main/jni/glfw/vulkan.c deleted file mode 100644 index 9e0cc026..00000000 --- a/FCLauncher/src/main/jni/glfw/vulkan.c +++ /dev/null @@ -1,312 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#include -#include -#include - -#define _GLFW_FIND_LOADER 1 -#define _GLFW_REQUIRE_LOADER 2 - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWbool _glfwInitVulkan(int mode) -{ - VkResult err; - VkExtensionProperties* ep; - uint32_t i, count; - - if (_glfw.vk.available) - return GLFW_TRUE; - -#if !defined(_GLFW_VULKAN_STATIC) -#if defined(_GLFW_VULKAN_LIBRARY) - _glfw.vk.handle = _glfw_dlopen(_GLFW_VULKAN_LIBRARY); -#elif defined(_GLFW_WIN32) - _glfw.vk.handle = _glfw_dlopen("vulkan-1.dll"); -#elif defined(_GLFW_COCOA) - _glfw.vk.handle = _glfw_dlopen("libvulkan.1.dylib"); - if (!_glfw.vk.handle) - _glfw.vk.handle = _glfwLoadLocalVulkanLoaderNS(); -#elif defined(_GLFW_FCL) - _glfw.vk.handle = _glfw_dlopen("libvulkan.so"); -#else - _glfw.vk.handle = _glfw_dlopen("libvulkan.so.1"); -#endif - if (!_glfw.vk.handle) - { - if (mode == _GLFW_REQUIRE_LOADER) - _glfwInputError(GLFW_API_UNAVAILABLE, "Vulkan: Loader not found"); - - return GLFW_FALSE; - } - - _glfw.vk.GetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) - _glfw_dlsym(_glfw.vk.handle, "vkGetInstanceProcAddr"); - if (!_glfw.vk.GetInstanceProcAddr) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "Vulkan: Loader does not export vkGetInstanceProcAddr"); - - _glfwTerminateVulkan(); - return GLFW_FALSE; - } - - _glfw.vk.EnumerateInstanceExtensionProperties = (PFN_vkEnumerateInstanceExtensionProperties) - vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceExtensionProperties"); - if (!_glfw.vk.EnumerateInstanceExtensionProperties) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "Vulkan: Failed to retrieve vkEnumerateInstanceExtensionProperties"); - - _glfwTerminateVulkan(); - return GLFW_FALSE; - } -#endif // _GLFW_VULKAN_STATIC - - err = vkEnumerateInstanceExtensionProperties(NULL, &count, NULL); - if (err) - { - // NOTE: This happens on systems with a loader but without any Vulkan ICD - if (mode == _GLFW_REQUIRE_LOADER) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "Vulkan: Failed to query instance extension count: %s", - _glfwGetVulkanResultString(err)); - } - - _glfwTerminateVulkan(); - return GLFW_FALSE; - } - - ep = calloc(count, sizeof(VkExtensionProperties)); - - err = vkEnumerateInstanceExtensionProperties(NULL, &count, ep); - if (err) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "Vulkan: Failed to query instance extensions: %s", - _glfwGetVulkanResultString(err)); - - free(ep); - _glfwTerminateVulkan(); - return GLFW_FALSE; - } - - for (i = 0; i < count; i++) - { - if (strcmp(ep[i].extensionName, "VK_KHR_surface") == 0) - _glfw.vk.KHR_surface = GLFW_TRUE; -#if defined(_GLFW_WIN32) - else if (strcmp(ep[i].extensionName, "VK_KHR_win32_surface") == 0) - _glfw.vk.KHR_win32_surface = GLFW_TRUE; -#elif defined(_GLFW_COCOA) - else if (strcmp(ep[i].extensionName, "VK_MVK_macos_surface") == 0) - _glfw.vk.MVK_macos_surface = GLFW_TRUE; - else if (strcmp(ep[i].extensionName, "VK_EXT_metal_surface") == 0) - _glfw.vk.EXT_metal_surface = GLFW_TRUE; -#elif defined(_GLFW_X11) - else if (strcmp(ep[i].extensionName, "VK_KHR_xlib_surface") == 0) - _glfw.vk.KHR_xlib_surface = GLFW_TRUE; - else if (strcmp(ep[i].extensionName, "VK_KHR_xcb_surface") == 0) - _glfw.vk.KHR_xcb_surface = GLFW_TRUE; -#elif defined(_GLFW_FCL) - else if (strcmp(ep[i].extensionName, "VK_KHR_android_surface") == 0) - _glfw.vk.KHR_android_surface = GLFW_TRUE; -#elif defined(_GLFW_WAYLAND) - else if (strcmp(ep[i].extensionName, "VK_KHR_wayland_surface") == 0) - _glfw.vk.KHR_wayland_surface = GLFW_TRUE; -#endif - } - - free(ep); - - _glfw.vk.available = GLFW_TRUE; - - _glfwPlatformGetRequiredInstanceExtensions(_glfw.vk.extensions); - - return GLFW_TRUE; -} - -void _glfwTerminateVulkan(void) -{ -#if !defined(_GLFW_VULKAN_STATIC) - if (_glfw.vk.handle) - _glfw_dlclose(_glfw.vk.handle); -#endif -} - -const char* _glfwGetVulkanResultString(VkResult result) -{ - switch (result) - { - case VK_SUCCESS: - return "Success"; - case VK_NOT_READY: - return "A fence or query has not yet completed"; - case VK_TIMEOUT: - return "A wait operation has not completed in the specified time"; - case VK_EVENT_SET: - return "An event is signaled"; - case VK_EVENT_RESET: - return "An event is unsignaled"; - case VK_INCOMPLETE: - return "A return array was too small for the result"; - case VK_ERROR_OUT_OF_HOST_MEMORY: - return "A host memory allocation has failed"; - case VK_ERROR_OUT_OF_DEVICE_MEMORY: - return "A device memory allocation has failed"; - case VK_ERROR_INITIALIZATION_FAILED: - return "Initialization of an object could not be completed for implementation-specific reasons"; - case VK_ERROR_DEVICE_LOST: - return "The logical or physical device has been lost"; - case VK_ERROR_MEMORY_MAP_FAILED: - return "Mapping of a memory object has failed"; - case VK_ERROR_LAYER_NOT_PRESENT: - return "A requested layer is not present or could not be loaded"; - case VK_ERROR_EXTENSION_NOT_PRESENT: - return "A requested extension is not supported"; - case VK_ERROR_FEATURE_NOT_PRESENT: - return "A requested feature is not supported"; - case VK_ERROR_INCOMPATIBLE_DRIVER: - return "The requested version of Vulkan is not supported by the driver or is otherwise incompatible"; - case VK_ERROR_TOO_MANY_OBJECTS: - return "Too many objects of the type have already been created"; - case VK_ERROR_FORMAT_NOT_SUPPORTED: - return "A requested format is not supported on this device"; - case VK_ERROR_SURFACE_LOST_KHR: - return "A surface is no longer available"; - case VK_SUBOPTIMAL_KHR: - return "A swapchain no longer matches the surface properties exactly, but can still be used"; - case VK_ERROR_OUT_OF_DATE_KHR: - return "A surface has changed in such a way that it is no longer compatible with the swapchain"; - case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR: - return "The display used by a swapchain does not use the same presentable image layout"; - case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR: - return "The requested window is already connected to a VkSurfaceKHR, or to some other non-Vulkan API"; - case VK_ERROR_VALIDATION_FAILED_EXT: - return "A validation layer found an error"; - default: - return "ERROR: UNKNOWN VULKAN ERROR"; - } -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW public API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI int glfwVulkanSupported(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE); - return _glfwInitVulkan(_GLFW_FIND_LOADER); -} - -GLFWAPI const char** glfwGetRequiredInstanceExtensions(uint32_t* count) -{ - assert(count != NULL); - - *count = 0; - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (!_glfwInitVulkan(_GLFW_REQUIRE_LOADER)) - return NULL; - - if (!_glfw.vk.extensions[0]) - return NULL; - - *count = 2; - return (const char**) _glfw.vk.extensions; -} - -GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, - const char* procname) -{ - GLFWvkproc proc; - assert(procname != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (!_glfwInitVulkan(_GLFW_REQUIRE_LOADER)) - return NULL; - - proc = (GLFWvkproc) vkGetInstanceProcAddr(instance, procname); -#if defined(_GLFW_VULKAN_STATIC) - if (!proc) - { - if (strcmp(procname, "vkGetInstanceProcAddr") == 0) - return (GLFWvkproc) vkGetInstanceProcAddr; - } -#else - if (!proc) - proc = (GLFWvkproc) _glfw_dlsym(_glfw.vk.handle, procname); -#endif - - return proc; -} - -GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, - VkPhysicalDevice device, - uint32_t queuefamily) -{ - assert(instance != VK_NULL_HANDLE); - assert(device != VK_NULL_HANDLE); - - _GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE); - - if (!_glfwInitVulkan(_GLFW_REQUIRE_LOADER)) - return GLFW_FALSE; - - if (!_glfw.vk.extensions[0]) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "Vulkan: Window surface creation extensions not found"); - return GLFW_FALSE; - } - - return _glfwPlatformGetPhysicalDevicePresentationSupport(instance, - device, - queuefamily); -} - -GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, - GLFWwindow* handle, - const VkAllocationCallbacks* allocator, - VkSurfaceKHR* surface) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(instance != VK_NULL_HANDLE); - assert(window != NULL); - assert(surface != NULL); - - *surface = VK_NULL_HANDLE; - - _GLFW_REQUIRE_INIT_OR_RETURN(VK_ERROR_INITIALIZATION_FAILED); - - if (!_glfwInitVulkan(_GLFW_REQUIRE_LOADER)) - return VK_ERROR_INITIALIZATION_FAILED; - - if (!_glfw.vk.extensions[0]) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "Vulkan: Window surface creation extensions not found"); - return VK_ERROR_EXTENSION_NOT_PRESENT; - } - - if (window->context.client != GLFW_NO_API) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Vulkan: Window surface creation requires the window to have the client API set to GLFW_NO_API"); - return VK_ERROR_NATIVE_WINDOW_IN_USE_KHR; - } - - return _glfwPlatformCreateWindowSurface(instance, window, allocator, surface); -} - diff --git a/FCLauncher/src/main/jni/glfw/window.c b/FCLauncher/src/main/jni/glfw/window.c deleted file mode 100644 index 99705b25..00000000 --- a/FCLauncher/src/main/jni/glfw/window.c +++ /dev/null @@ -1,1078 +0,0 @@ -// -// Created by Tungsten on 2022/10/11. -// - -#include - -#include -#include -#include -#include - - -////////////////////////////////////////////////////////////////////////// -////// GLFW event API ////// -////////////////////////////////////////////////////////////////////////// - -// Notifies shared code that a window has lost or received input focus -// -void _glfwInputWindowFocus(_GLFWwindow* window, GLFWbool focused) -{ - if (window->callbacks.focus) - window->callbacks.focus((GLFWwindow*) window, focused); - - if (!focused) - { - int key, button; - - for (key = 0; key <= GLFW_KEY_LAST; key++) - { - if (window->keys[key] == GLFW_PRESS) - { - const int scancode = _glfwPlatformGetKeyScancode(key); - _glfwInputKey(window, key, scancode, GLFW_RELEASE, 0); - } - } - - for (button = 0; button <= GLFW_MOUSE_BUTTON_LAST; button++) - { - if (window->mouseButtons[button] == GLFW_PRESS) - _glfwInputMouseClick(window, button, GLFW_RELEASE, 0); - } - } -} - -// Notifies shared code that a window has moved -// The position is specified in content area relative screen coordinates -// -void _glfwInputWindowPos(_GLFWwindow* window, int x, int y) -{ - if (window->callbacks.pos) - window->callbacks.pos((GLFWwindow*) window, x, y); -} - -// Notifies shared code that a window has been resized -// The size is specified in screen coordinates -// -void _glfwInputWindowSize(_GLFWwindow* window, int width, int height) -{ - if (window->callbacks.size) - window->callbacks.size((GLFWwindow*) window, width, height); -} - -// Notifies shared code that a window has been iconified or restored -// -void _glfwInputWindowIconify(_GLFWwindow* window, GLFWbool iconified) -{ - if (window->callbacks.iconify) - window->callbacks.iconify((GLFWwindow*) window, iconified); -} - -// Notifies shared code that a window has been maximized or restored -// -void _glfwInputWindowMaximize(_GLFWwindow* window, GLFWbool maximized) -{ - if (window->callbacks.maximize) - window->callbacks.maximize((GLFWwindow*) window, maximized); -} - -// Notifies shared code that a window framebuffer has been resized -// The size is specified in pixels -// -void _glfwInputFramebufferSize(_GLFWwindow* window, int width, int height) -{ - if (window->callbacks.fbsize) - window->callbacks.fbsize((GLFWwindow*) window, width, height); -} - -// Notifies shared code that a window content scale has changed -// The scale is specified as the ratio between the current and default DPI -// -void _glfwInputWindowContentScale(_GLFWwindow* window, float xscale, float yscale) -{ - if (window->callbacks.scale) - window->callbacks.scale((GLFWwindow*) window, xscale, yscale); -} - -// Notifies shared code that the window contents needs updating -// -void _glfwInputWindowDamage(_GLFWwindow* window) -{ - if (window->callbacks.refresh) - window->callbacks.refresh((GLFWwindow*) window); -} - -// Notifies shared code that the user wishes to close a window -// -void _glfwInputWindowCloseRequest(_GLFWwindow* window) -{ - window->shouldClose = GLFW_TRUE; - - if (window->callbacks.close) - window->callbacks.close((GLFWwindow*) window); -} - -// Notifies shared code that a window has changed its desired monitor -// -void _glfwInputWindowMonitor(_GLFWwindow* window, _GLFWmonitor* monitor) -{ - window->monitor = monitor; -} - -////////////////////////////////////////////////////////////////////////// -////// GLFW public API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, - const char* title, - GLFWmonitor* monitor, - GLFWwindow* share) -{ - _GLFWfbconfig fbconfig; - _GLFWctxconfig ctxconfig; - _GLFWwndconfig wndconfig; - _GLFWwindow* window; - - assert(title != NULL); - assert(width >= 0); - assert(height >= 0); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (width <= 0 || height <= 0) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid window size %ix%i", - width, height); - - return NULL; - } - - fbconfig = _glfw.hints.framebuffer; - ctxconfig = _glfw.hints.context; - wndconfig = _glfw.hints.window; - - wndconfig.width = width; - wndconfig.height = height; - wndconfig.title = title; - ctxconfig.share = (_GLFWwindow*) share; - - if (!_glfwIsValidContextConfig(&ctxconfig)) - return NULL; - - window = calloc(1, sizeof(_GLFWwindow)); - window->next = _glfw.windowListHead; - _glfw.windowListHead = window; - - window->videoMode.width = width; - window->videoMode.height = height; - window->videoMode.redBits = fbconfig.redBits; - window->videoMode.greenBits = fbconfig.greenBits; - window->videoMode.blueBits = fbconfig.blueBits; - window->videoMode.refreshRate = _glfw.hints.refreshRate; - - window->monitor = (_GLFWmonitor*) monitor; - window->resizable = wndconfig.resizable; - window->decorated = wndconfig.decorated; - window->autoIconify = wndconfig.autoIconify; - window->floating = wndconfig.floating; - window->focusOnShow = wndconfig.focusOnShow; - window->cursorMode = GLFW_CURSOR_NORMAL; - - window->doublebuffer = fbconfig.doublebuffer; - - window->minwidth = GLFW_DONT_CARE; - window->minheight = GLFW_DONT_CARE; - window->maxwidth = GLFW_DONT_CARE; - window->maxheight = GLFW_DONT_CARE; - window->numer = GLFW_DONT_CARE; - window->denom = GLFW_DONT_CARE; - - // Open the actual window and create its context - if (!_glfwPlatformCreateWindow(window, &wndconfig, &ctxconfig, &fbconfig)) - { - glfwDestroyWindow((GLFWwindow*) window); - return NULL; - } - - if (ctxconfig.client != GLFW_NO_API) - { - if (!_glfwRefreshContextAttribs(window, &ctxconfig)) - { - glfwDestroyWindow((GLFWwindow*) window); - return NULL; - } - } - - if (window->monitor) - { - if (wndconfig.centerCursor) - _glfwCenterCursorInContentArea(window); - } - else - { - if (wndconfig.visible) - { - _glfwPlatformShowWindow(window); - if (wndconfig.focused) - _glfwPlatformFocusWindow(window); - } - } - - return (GLFWwindow*) window; -} - -void glfwDefaultWindowHints(void) -{ - _GLFW_REQUIRE_INIT(); - - // The default is OpenGL with minimum version 1.0 - memset(&_glfw.hints.context, 0, sizeof(_glfw.hints.context)); - _glfw.hints.context.client = GLFW_OPENGL_API; - _glfw.hints.context.source = (strncmp(getenv("LIBGL_NAME"), "libOSMesa", 9) == 0) ? GLFW_OSMESA_CONTEXT_API : GLFW_NATIVE_CONTEXT_API; - _glfw.hints.context.major = 1; - _glfw.hints.context.minor = 0; - - // The default is a focused, visible, resizable window with decorations - memset(&_glfw.hints.window, 0, sizeof(_glfw.hints.window)); - _glfw.hints.window.resizable = GLFW_TRUE; - _glfw.hints.window.visible = GLFW_TRUE; - _glfw.hints.window.decorated = GLFW_TRUE; - _glfw.hints.window.focused = GLFW_TRUE; - _glfw.hints.window.autoIconify = GLFW_TRUE; - _glfw.hints.window.centerCursor = GLFW_TRUE; - _glfw.hints.window.focusOnShow = GLFW_TRUE; - - // The default is 24 bits of color, 24 bits of depth and 8 bits of stencil, - // double buffered - memset(&_glfw.hints.framebuffer, 0, sizeof(_glfw.hints.framebuffer)); - _glfw.hints.framebuffer.redBits = 8; - _glfw.hints.framebuffer.greenBits = 8; - _glfw.hints.framebuffer.blueBits = 8; - _glfw.hints.framebuffer.alphaBits = 8; - _glfw.hints.framebuffer.depthBits = 24; - _glfw.hints.framebuffer.stencilBits = 8; - _glfw.hints.framebuffer.doublebuffer = GLFW_TRUE; - - // The default is to select the highest available refresh rate - _glfw.hints.refreshRate = GLFW_DONT_CARE; - - // The default is to use full Retina resolution framebuffers - _glfw.hints.window.ns.retina = GLFW_TRUE; -} - -GLFWAPI void glfwWindowHint(int hint, int value) -{ - _GLFW_REQUIRE_INIT(); - - switch (hint) - { - case GLFW_RED_BITS: - _glfw.hints.framebuffer.redBits = value; - return; - case GLFW_GREEN_BITS: - _glfw.hints.framebuffer.greenBits = value; - return; - case GLFW_BLUE_BITS: - _glfw.hints.framebuffer.blueBits = value; - return; - case GLFW_ALPHA_BITS: - _glfw.hints.framebuffer.alphaBits = value; - return; - case GLFW_DEPTH_BITS: - _glfw.hints.framebuffer.depthBits = value; - return; - case GLFW_STENCIL_BITS: - _glfw.hints.framebuffer.stencilBits = value; - return; - case GLFW_ACCUM_RED_BITS: - _glfw.hints.framebuffer.accumRedBits = value; - return; - case GLFW_ACCUM_GREEN_BITS: - _glfw.hints.framebuffer.accumGreenBits = value; - return; - case GLFW_ACCUM_BLUE_BITS: - _glfw.hints.framebuffer.accumBlueBits = value; - return; - case GLFW_ACCUM_ALPHA_BITS: - _glfw.hints.framebuffer.accumAlphaBits = value; - return; - case GLFW_AUX_BUFFERS: - _glfw.hints.framebuffer.auxBuffers = value; - return; - case GLFW_STEREO: - _glfw.hints.framebuffer.stereo = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_DOUBLEBUFFER: - _glfw.hints.framebuffer.doublebuffer = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_TRANSPARENT_FRAMEBUFFER: - _glfw.hints.framebuffer.transparent = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_SAMPLES: - _glfw.hints.framebuffer.samples = value; - return; - case GLFW_SRGB_CAPABLE: - _glfw.hints.framebuffer.sRGB = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_RESIZABLE: - _glfw.hints.window.resizable = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_DECORATED: - _glfw.hints.window.decorated = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_FOCUSED: - _glfw.hints.window.focused = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_AUTO_ICONIFY: - _glfw.hints.window.autoIconify = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_FLOATING: - _glfw.hints.window.floating = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_MAXIMIZED: - _glfw.hints.window.maximized = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_VISIBLE: - _glfw.hints.window.visible = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_COCOA_RETINA_FRAMEBUFFER: - _glfw.hints.window.ns.retina = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_COCOA_GRAPHICS_SWITCHING: - _glfw.hints.context.nsgl.offline = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_SCALE_TO_MONITOR: - _glfw.hints.window.scaleToMonitor = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_CENTER_CURSOR: - _glfw.hints.window.centerCursor = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_FOCUS_ON_SHOW: - _glfw.hints.window.focusOnShow = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_CLIENT_API: - _glfw.hints.context.client = value; - return; - case GLFW_CONTEXT_CREATION_API: - _glfw.hints.context.source = (strncmp(getenv("LIBGL_NAME"), "libOSMesa", 9) == 0) ? GLFW_OSMESA_CONTEXT_API : value; - return; - case GLFW_CONTEXT_VERSION_MAJOR: - _glfw.hints.context.major = value; - return; - case GLFW_CONTEXT_VERSION_MINOR: - _glfw.hints.context.minor = value; - return; - case GLFW_CONTEXT_ROBUSTNESS: - _glfw.hints.context.robustness = value; - return; - case GLFW_OPENGL_FORWARD_COMPAT: - _glfw.hints.context.forward = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_OPENGL_DEBUG_CONTEXT: - _glfw.hints.context.debug = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_CONTEXT_NO_ERROR: - _glfw.hints.context.noerror = value ? GLFW_TRUE : GLFW_FALSE; - return; - case GLFW_OPENGL_PROFILE: - _glfw.hints.context.profile = value; - return; - case GLFW_CONTEXT_RELEASE_BEHAVIOR: - _glfw.hints.context.release = value; - return; - case GLFW_REFRESH_RATE: - _glfw.hints.refreshRate = value; - return; - } - - _glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint 0x%08X", hint); -} - -GLFWAPI void glfwWindowHintString(int hint, const char* value) -{ - assert(value != NULL); - - _GLFW_REQUIRE_INIT(); - - switch (hint) - { - case GLFW_COCOA_FRAME_NAME: - strncpy(_glfw.hints.window.ns.frameName, value, - sizeof(_glfw.hints.window.ns.frameName) - 1); - return; - case GLFW_X11_CLASS_NAME: - strncpy(_glfw.hints.window.x11.className, value, - sizeof(_glfw.hints.window.x11.className) - 1); - return; - case GLFW_X11_INSTANCE_NAME: - strncpy(_glfw.hints.window.x11.instanceName, value, - sizeof(_glfw.hints.window.x11.instanceName) - 1); - return; - } - - _glfwInputError(GLFW_INVALID_ENUM, "Invalid window hint string 0x%08X", hint); -} - -GLFWAPI void glfwDestroyWindow(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - - _GLFW_REQUIRE_INIT(); - - // Allow closing of NULL (to match the behavior of free) - if (window == NULL) - return; - - // Clear all callbacks to avoid exposing a half torn-down window object - memset(&window->callbacks, 0, sizeof(window->callbacks)); - - // The window's context must not be current on another thread when the - // window is destroyed - if (window == _glfwPlatformGetTls(&_glfw.contextSlot)) - glfwMakeContextCurrent(NULL); - - _glfwPlatformDestroyWindow(window); - - // Unlink window from global linked list - { - _GLFWwindow** prev = &_glfw.windowListHead; - - while (*prev != window) - prev = &((*prev)->next); - - *prev = window->next; - } - - free(window); -} - -GLFWAPI int glfwWindowShouldClose(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(0); - return window->shouldClose; -} - -GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* handle, int value) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - window->shouldClose = value; -} - -GLFWAPI void glfwSetWindowTitle(GLFWwindow* handle, const char* title) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - assert(title != NULL); - - _GLFW_REQUIRE_INIT(); - _glfwPlatformSetWindowTitle(window, title); -} - -GLFWAPI void glfwSetWindowIcon(GLFWwindow* handle, - int count, const GLFWimage* images) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - assert(count >= 0); - assert(count == 0 || images != NULL); - - _GLFW_REQUIRE_INIT(); - _glfwPlatformSetWindowIcon(window, count, images); -} - -GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; - - _GLFW_REQUIRE_INIT(); - _glfwPlatformGetWindowPos(window, xpos, ypos); -} - -GLFWAPI void glfwSetWindowPos(GLFWwindow* handle, int xpos, int ypos) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - if (window->monitor) - return; - - _glfwPlatformSetWindowPos(window, xpos, ypos); -} - -GLFWAPI void glfwGetWindowSize(GLFWwindow* handle, int* width, int* height) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - if (width) - *width = 0; - if (height) - *height = 0; - - _GLFW_REQUIRE_INIT(); - _glfwPlatformGetWindowSize(window, width, height); -} - -GLFWAPI void glfwSetWindowSize(GLFWwindow* handle, int width, int height) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - assert(width >= 0); - assert(height >= 0); - - _GLFW_REQUIRE_INIT(); - - window->videoMode.width = width; - window->videoMode.height = height; - - _glfwPlatformSetWindowSize(window, width, height); -} - -GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* handle, - int minwidth, int minheight, - int maxwidth, int maxheight) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - if (minwidth != GLFW_DONT_CARE && minheight != GLFW_DONT_CARE) - { - if (minwidth < 0 || minheight < 0) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid window minimum size %ix%i", - minwidth, minheight); - return; - } - } - - if (maxwidth != GLFW_DONT_CARE && maxheight != GLFW_DONT_CARE) - { - if (maxwidth < 0 || maxheight < 0 || - maxwidth < minwidth || maxheight < minheight) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid window maximum size %ix%i", - maxwidth, maxheight); - return; - } - } - - window->minwidth = minwidth; - window->minheight = minheight; - window->maxwidth = maxwidth; - window->maxheight = maxheight; - - if (window->monitor || !window->resizable) - return; - - _glfwPlatformSetWindowSizeLimits(window, - minwidth, minheight, - maxwidth, maxheight); -} - -GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* handle, int numer, int denom) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - assert(numer != 0); - assert(denom != 0); - - _GLFW_REQUIRE_INIT(); - - if (numer != GLFW_DONT_CARE && denom != GLFW_DONT_CARE) - { - if (numer <= 0 || denom <= 0) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid window aspect ratio %i:%i", - numer, denom); - return; - } - } - - window->numer = numer; - window->denom = denom; - - if (window->monitor || !window->resizable) - return; - - _glfwPlatformSetWindowAspectRatio(window, numer, denom); -} - -GLFWAPI void glfwGetFramebufferSize(GLFWwindow* handle, int* width, int* height) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - if (width) - *width = 0; - if (height) - *height = 0; - - _GLFW_REQUIRE_INIT(); - _glfwPlatformGetFramebufferSize(window, width, height); -} - -GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* handle, - int* left, int* top, - int* right, int* bottom) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - if (left) - *left = 0; - if (top) - *top = 0; - if (right) - *right = 0; - if (bottom) - *bottom = 0; - - _GLFW_REQUIRE_INIT(); - _glfwPlatformGetWindowFrameSize(window, left, top, right, bottom); -} - -GLFWAPI void glfwGetWindowContentScale(GLFWwindow* handle, - float* xscale, float* yscale) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - if (xscale) - *xscale = 0.f; - if (yscale) - *yscale = 0.f; - - _GLFW_REQUIRE_INIT(); - _glfwPlatformGetWindowContentScale(window, xscale, yscale); -} - -GLFWAPI float glfwGetWindowOpacity(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(1.f); - return _glfwPlatformGetWindowOpacity(window); -} - -GLFWAPI void glfwSetWindowOpacity(GLFWwindow* handle, float opacity) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - assert(opacity == opacity); - assert(opacity >= 0.f); - assert(opacity <= 1.f); - - _GLFW_REQUIRE_INIT(); - - if (opacity != opacity || opacity < 0.f || opacity > 1.f) - { - _glfwInputError(GLFW_INVALID_VALUE, "Invalid window opacity %f", opacity); - return; - } - - _glfwPlatformSetWindowOpacity(window, opacity); -} - -GLFWAPI void glfwIconifyWindow(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - _glfwPlatformIconifyWindow(window); -} - -GLFWAPI void glfwRestoreWindow(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - _glfwPlatformRestoreWindow(window); -} - -GLFWAPI void glfwMaximizeWindow(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - if (window->monitor) - return; - - _glfwPlatformMaximizeWindow(window); -} - -GLFWAPI void glfwShowWindow(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - if (window->monitor) - return; - - _glfwPlatformShowWindow(window); - - if (window->focusOnShow) - _glfwPlatformFocusWindow(window); -} - -GLFWAPI void glfwRequestWindowAttention(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - _glfwPlatformRequestWindowAttention(window); -} - -GLFWAPI void glfwHideWindow(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - if (window->monitor) - return; - - _glfwPlatformHideWindow(window); -} - -GLFWAPI void glfwFocusWindow(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - _glfwPlatformFocusWindow(window); -} - -GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(0); - - switch (attrib) - { - case GLFW_FOCUSED: - return _glfwPlatformWindowFocused(window); - case GLFW_ICONIFIED: - return _glfwPlatformWindowIconified(window); - case GLFW_VISIBLE: - return _glfwPlatformWindowVisible(window); - case GLFW_MAXIMIZED: - return _glfwPlatformWindowMaximized(window); - case GLFW_HOVERED: - return _glfwPlatformWindowHovered(window); - case GLFW_FOCUS_ON_SHOW: - return window->focusOnShow; - case GLFW_TRANSPARENT_FRAMEBUFFER: - return _glfwPlatformFramebufferTransparent(window); - case GLFW_RESIZABLE: - return window->resizable; - case GLFW_DECORATED: - return window->decorated; - case GLFW_FLOATING: - return window->floating; - case GLFW_AUTO_ICONIFY: - return window->autoIconify; - case GLFW_CLIENT_API: - return window->context.client; - case GLFW_CONTEXT_CREATION_API: - return window->context.source; - case GLFW_CONTEXT_VERSION_MAJOR: - return window->context.major; - case GLFW_CONTEXT_VERSION_MINOR: - return window->context.minor; - case GLFW_CONTEXT_REVISION: - return window->context.revision; - case GLFW_CONTEXT_ROBUSTNESS: - return window->context.robustness; - case GLFW_OPENGL_FORWARD_COMPAT: - return window->context.forward; - case GLFW_OPENGL_DEBUG_CONTEXT: - return window->context.debug; - case GLFW_OPENGL_PROFILE: - return window->context.profile; - case GLFW_CONTEXT_RELEASE_BEHAVIOR: - return window->context.release; - case GLFW_CONTEXT_NO_ERROR: - return window->context.noerror; - } - - _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib); - return 0; -} - -GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - - value = value ? GLFW_TRUE : GLFW_FALSE; - - if (attrib == GLFW_AUTO_ICONIFY) - window->autoIconify = value; - else if (attrib == GLFW_RESIZABLE) - { - if (window->resizable == value) - return; - - window->resizable = value; - if (!window->monitor) - _glfwPlatformSetWindowResizable(window, value); - } - else if (attrib == GLFW_DECORATED) - { - if (window->decorated == value) - return; - - window->decorated = value; - if (!window->monitor) - _glfwPlatformSetWindowDecorated(window, value); - } - else if (attrib == GLFW_FLOATING) - { - if (window->floating == value) - return; - - window->floating = value; - if (!window->monitor) - _glfwPlatformSetWindowFloating(window, value); - } - else if (attrib == GLFW_FOCUS_ON_SHOW) - window->focusOnShow = value; - else - _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib); -} - -GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return (GLFWmonitor*) window->monitor; -} - -GLFWAPI void glfwSetWindowMonitor(GLFWwindow* wh, - GLFWmonitor* mh, - int xpos, int ypos, - int width, int height, - int refreshRate) -{ - _GLFWwindow* window = (_GLFWwindow*) wh; - _GLFWmonitor* monitor = (_GLFWmonitor*) mh; - assert(window != NULL); - assert(width >= 0); - assert(height >= 0); - - _GLFW_REQUIRE_INIT(); - - if (width <= 0 || height <= 0) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid window size %ix%i", - width, height); - return; - } - - if (refreshRate < 0 && refreshRate != GLFW_DONT_CARE) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid refresh rate %i", - refreshRate); - return; - } - - window->videoMode.width = width; - window->videoMode.height = height; - window->videoMode.refreshRate = refreshRate; - - _glfwPlatformSetWindowMonitor(window, monitor, - xpos, ypos, width, height, - refreshRate); -} - -GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* handle, void* pointer) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT(); - window->userPointer = pointer; -} - -GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return window->userPointer; -} - -GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* handle, - GLFWwindowposfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.pos, cbfun); - return cbfun; -} - -GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* handle, - GLFWwindowsizefun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.size, cbfun); - return cbfun; -} - -GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* handle, - GLFWwindowclosefun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.close, cbfun); - return cbfun; -} - -GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* handle, - GLFWwindowrefreshfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.refresh, cbfun); - return cbfun; -} - -GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* handle, - GLFWwindowfocusfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.focus, cbfun); - return cbfun; -} - -GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* handle, - GLFWwindowiconifyfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.iconify, cbfun); - return cbfun; -} - -GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* handle, - GLFWwindowmaximizefun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.maximize, cbfun); - return cbfun; -} - -GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* handle, - GLFWframebuffersizefun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.fbsize, cbfun); - return cbfun; -} - -GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* handle, - GLFWwindowcontentscalefun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - assert(window != NULL); - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.scale, cbfun); - return cbfun; -} - -GLFWAPI void glfwPollEvents(void) -{ - _GLFW_REQUIRE_INIT(); - _glfwPlatformPollEvents(); -} - -GLFWAPI void glfwWaitEvents(void) -{ - _GLFW_REQUIRE_INIT(); - _glfwPlatformWaitEvents(); -} - -GLFWAPI void glfwWaitEventsTimeout(double timeout) -{ - _GLFW_REQUIRE_INIT(); - assert(timeout == timeout); - assert(timeout >= 0.0); - assert(timeout <= DBL_MAX); - - if (timeout != timeout || timeout < 0.0 || timeout > DBL_MAX) - { - _glfwInputError(GLFW_INVALID_VALUE, "Invalid time %f", timeout); - return; - } - - _glfwPlatformWaitEventsTimeout(timeout); -} - -GLFWAPI void glfwPostEmptyEvent(void) -{ - _GLFW_REQUIRE_INIT(); - _glfwPlatformPostEmptyEvent(); -} - diff --git a/FCLauncher/src/main/jni/lwjgl/FCLConfig.h b/FCLauncher/src/main/jni/lwjgl/FCLConfig.h deleted file mode 100644 index 31c7eb25..00000000 --- a/FCLauncher/src/main/jni/lwjgl/FCLConfig.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ - -#include -#include - -#define DISABLE_WARNINGS() \ - _Pragma("GCC diagnostic push") - _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") - _Pragma("GCC diagnostic ignored \"-Wunused-variable\"") - _Pragma("GCC diagnostic ignored \"-Wsign-compare\"") - -#define ENABLE_WARNINGS() \ - _Pragma("GCC diagnostic pop") - -// JNIEXPORT_CRITICAL & CRITICAL are used as a workaround for JDK-8167409 on applicable functions. -#define JNIEXPORT_CRITICAL static -#define CRITICAL(function) _JavaCritical_##function \ No newline at end of file diff --git a/FCLauncher/src/main/jni/lwjgl/FCLLWJGL.h b/FCLauncher/src/main/jni/lwjgl/FCLLWJGL.h deleted file mode 100644 index 6a1b13db..00000000 --- a/FCLauncher/src/main/jni/lwjgl/FCLLWJGL.h +++ /dev/null @@ -1,5 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ -#pragma once \ No newline at end of file diff --git a/FCLauncher/src/main/jni/lwjgl/common_tools.c b/FCLauncher/src/main/jni/lwjgl/common_tools.c deleted file mode 100644 index 28d24dad..00000000 --- a/FCLauncher/src/main/jni/lwjgl/common_tools.c +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ -#ifdef LWJGL_WINDOWS - __pragma(warning(disable : 4710)) -#endif -#include "common_tools.h" -#include "fcl_hook.h" -#include -#include - -JavaVM *jvm; - -static inline JNIEnv* getThreadEnv(void) { - JNIEnv *env; - (*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_6); - return env; -} - -static inline JNIEnv* attachCurrentThreadAsDaemon(void) { - JNIEnv *env; - (*jvm)->AttachCurrentThreadAsDaemon(jvm, (void **)&env, NULL); - if (env == NULL) { - fprintf(stderr, "[LWJGL] Failed to attach native thread to the JVM."); - fflush(stderr); - exit(1); - } - return env; -} - -static inline void detachCurrentThread(void) { - if ((*jvm)->DetachCurrentThread(jvm) != JNI_OK) { - fprintf(stderr, "[LWJGL] Failed to detach native thread from the JVM."); - fflush(stderr); - } -} - -static inline EnvData* createEnvData(jboolean async, JNIEnv* env) { - EnvData* data = (EnvData*)calloc(sizeof(EnvData), 1); - - data->async = async; - data->env = env; - - return data; -} - -static inline void linkEnvData(EnvData* data, JNIEnv *env) { - data->envCopy = *env; - ((void **)*env)[2] = (void *)data; -} - -#ifdef LWJGL_WINDOWS - #include - DWORD envTLS = TLS_OUT_OF_INDEXES; - - BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD fdwReason, LPVOID lpvReserved) { - UNUSED_PARAMS(hDLL, lpvReserved) - - if (fdwReason == DLL_THREAD_DETACH && lpvReserved == NULL/* see: https://docs.microsoft.com/en-us/windows/win32/dlls/dllmain */) { - EnvData* data = (EnvData*)TlsGetValue(envTLS); - if (data != NULL) { - TlsSetValue(envTLS, NULL); - - JNIEnv env = data->envCopy; - if (env != NULL) { - free((void *)env); - } - free(data); - } - - if (getThreadEnv() != NULL) { - detachCurrentThread(); - } - } - - return TRUE; - } - - static inline void tlsInit(void) { - envTLS = TlsAlloc(); - if (envTLS == TLS_OUT_OF_INDEXES) { - fprintf(stderr, "[LWJGL] Failed to allocate TLS for JNIEnv."); - fflush(stderr); - } - } - - static inline void tlsDestroy(void) { - TlsFree(envTLS); - } - - EnvData* tlsCreateEnvData(void) { - jboolean async = 0; - JNIEnv* env = getThreadEnv(); - - if (env == NULL) { - async = 1; - env = attachCurrentThreadAsDaemon(); - } - - EnvData* data = createEnvData(async, env); - - TlsSetValue(envTLS, (LPVOID)data); - - return data; - } - - EnvData* tlsCreateEnvDataWithCopy(JNIEnv *env) { - EnvData* data = createEnvData(0, env); - linkEnvData(data, env); - - TlsSetValue(envTLS, (LPVOID)data); - - return data; - } - - inline EnvData* tlsGetEnvData(void) { - EnvData* data = (EnvData*)TlsGetValue(envTLS); - if (data == NULL) { - data = tlsCreateEnvData(); - } - return data; - } -#else - #include - pthread_key_t envTLS = 0; - - static void autoDetach(void* value) { - EnvData* data = (EnvData *)value; - - JNIEnv env = data->envCopy; - if (env != NULL) { - free((void *)env); - } - - free(data); - - if (getThreadEnv() != NULL) { - detachCurrentThread(); - } - } - - static inline void tlsInit(void) { - if (pthread_key_create(&envTLS, autoDetach) != 0) { - fprintf(stderr, "[LWJGL] Failed to allocate TLS for JNIEnv."); - fflush(stderr); - } - } - - static inline void tlsDestroy(void) { - if (envTLS) { - pthread_key_delete(envTLS); - envTLS = 0; - } - } - - EnvData* tlsCreateEnvData(void) { - jboolean async = 0; - JNIEnv* env = getThreadEnv(); - - if (env == NULL) { - async = 1; - env = attachCurrentThreadAsDaemon(); - } - - EnvData* data = createEnvData(async, env); - - pthread_setspecific(envTLS, data); - - return data; - } - - EnvData* tlsCreateEnvDataWithCopy(JNIEnv* env) { - EnvData* data = createEnvData(0, env); - linkEnvData(data, env); - - pthread_setspecific(envTLS, data); - - return data; - } - - inline EnvData* tlsGetEnvData(void) { - EnvData* data = (EnvData*)pthread_getspecific(envTLS); - if (data == NULL) { - data = tlsCreateEnvData(); - } - return data; - } -#endif - -inline JNIEnv* getEnv(jboolean *async) { - EnvData* data = tlsGetEnvData(); - *async = data->async; - return data->env; -} - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { - UNUSED_PARAM(reserved) - - jvm = vm; - - JNIEnv *env = NULL; - (*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_4); - hookExec(env); - - tlsInit(); - return JNI_VERSION_1_6; -} - -JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) { - UNUSED_PARAMS(vm, reserved); - tlsDestroy(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/common_tools.h b/FCLauncher/src/main/jni/lwjgl/common_tools.h deleted file mode 100644 index 36298535..00000000 --- a/FCLauncher/src/main/jni/lwjgl/common_tools.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ -#pragma once - -#ifdef LWJGL_WINDOWS - #include "WindowsConfig.h" -#endif -#ifdef LWJGL_LINUX - #include "LinuxConfig.h" -#endif -#ifdef LWJGL_FCL - #include "FCLConfig.h" -#endif -#ifdef LWJGL_MACOS - #include "macOSConfig.h" -#endif - -DISABLE_WARNINGS() -#include -#include -#include -ENABLE_WARNINGS() - -// Per-thread data, stored in a platform-specific thread-local. -// Present in threads that had Callback invocations, saveErrno/saveLastError calls, OpenGL(ES) contexts made current. -// Clean up is automatic via DllMain notifications (on Windows) or pthread destructors (on Linux/OSX). -typedef struct EnvData_ { - // true if AttachCurrentThreadAsDaemon was used to attach to a foreign thread (on a callback invocation). - jboolean async; - char padding[sizeof(void *) - sizeof(jboolean)]; - // Cached JNIEnv* for the current thread. Faster than calling jvm->GetEnv. - // NOTE: points to JavaThread::_jni_environment (jdk/src/hotspot/share/runtime/thread.hpp), which is itself a pointer to the JNINativeInterface struct. - JNIEnv* env; - // The JNIEnv copy for the current thread. - // Not NULL in threads where saveErrno/saveLastError has been called, or an OpenGL(ES) context has been made current. - // * env->reserved2 points to this EnvData instance. - // * env->reserved3 may point to the GL(ES)Capabilities function array. - // The above two enable access to thread-local data without a TL lookup. - // NOTE: Stored separately instead of dereferencing env, because JavaThread instances may already be corrupted on thread detach. - JNIEnv envCopy; - // errno for the current thread. Must be stored before a JNI function returns (may change between JNI method calls). - jint errnum; -#ifdef LWJGL_WINDOWS - // GetLastError() for the current thread. Must be stored before a JNI function returns (may change between JNI method calls). - jint LastError; -#endif -} EnvData; - -// Cached JNIEnv, using TLS. Will use attachCurrentThreadAsDaemon in foreign threads. -extern JNIEnv* getEnv(jboolean* async); - -// Upcalls are used to create EnvData, because these macros will be used in non-core modules too. -/* - * method (any module) -> ThreadLocalUtil::setupEnvData upcall (core module) - * \ / \ - * -> nfunction downcall (any module) -> saveErrno/saveLastError -> nsetupEnvData downcall (core module) - */ -#define saveErrno() \ - jint errnum = errno; \ - EnvData *envData = (EnvData *)(*__env)->reserved2; \ - if (envData == (*__env)->reserved0) { \ - jclass TLU = (*__env)->FindClass(__env, "org/lwjgl/system/ThreadLocalUtil"); \ - envData = (EnvData *)(uintptr_t)(*__env)->CallStaticLongMethod(__env, TLU, (*__env)->GetStaticMethodID(__env, TLU, "setupEnvData", "()J")); \ - } \ - envData->errnum = errnum; - -#ifdef LWJGL_WINDOWS - #define saveLastError() \ - jint LastError = (jint)GetLastError(); \ - EnvData *envData = (EnvData *)(*__env)->reserved2; \ - if (envData == (*__env)->reserved0) { \ - jclass TLU = (*__env)->FindClass(__env, "org/lwjgl/system/ThreadLocalUtil"); \ - envData = (EnvData *)(uintptr_t)(*__env)->CallStaticLongMethod(__env, TLU, (*__env)->GetStaticMethodID(__env, TLU, "setupEnvData", "()J")); \ - } \ - envData->LastError = LastError; - - #define VA_LIST_CAST &(va_list) -#else - #define VA_LIST_CAST (va_list *) -#endif - -// ----------------------------------------------------- - -#ifdef __cplusplus - #define EXTERN_C_ENTER extern "C" { - #define EXTERN_C_EXIT } -#else - #define EXTERN_C_ENTER - #define EXTERN_C_EXIT -#endif - -// ----------------------------------------------------- - -#define UNUSED_PARAM(param) \ - (void)(param); - -#define UNUSED_PARAMS(a, b) \ - (void)(a); \ - (void)(b); - -// ----------------------------------------------------- diff --git a/FCLauncher/src/main/jni/lwjgl/fcl_hook.c b/FCLauncher/src/main/jni/lwjgl/fcl_hook.c deleted file mode 100644 index e8e66c69..00000000 --- a/FCLauncher/src/main/jni/lwjgl/fcl_hook.c +++ /dev/null @@ -1,71 +0,0 @@ -// -// Created by mio on 2023/7/9. -// - -#include "fcl_hook.h" -#include -#include -#include -#include -#include "fcl/include/fcl_internal.h" - -jint (*orig_ProcessImpl_forkAndExec)(JNIEnv *env, jobject process, jint mode, jbyteArray helperpath, - jbyteArray prog, jbyteArray argBlock, jint argc, - jbyteArray envBlock, jint envc, jbyteArray dir, - jintArray std_fds, jboolean redirectErrorStream); - -jint -hooked_ProcessImpl_forkAndExec(JNIEnv *env, jobject process, jint mode, jbyteArray helperpath, - jbyteArray prog, jbyteArray argBlock, jint argc, jbyteArray envBlock, - jint envc, jbyteArray dir, jintArray std_fds, - jboolean redirectErrorStream) { - char *pProg = (char *) ((*env)->GetByteArrayElements(env, prog, NULL)); - - if (strcmp(basename(pProg), "xdg-open") != 0) { - (*env)->ReleaseByteArrayElements(env, prog, (jbyte *) pProg, 0); - return orig_ProcessImpl_forkAndExec(env, process, mode, helperpath, prog, argBlock, argc, - envBlock, envc, dir, std_fds, redirectErrorStream); - } - (*env)->ReleaseByteArrayElements(env, prog, (jbyte *) pProg, 0); - - long len = (*env)->GetArrayLength(env, argBlock); - const char *cs[len]; - (*env)->GetByteArrayRegion(env, argBlock, 0, len, (jbyte *) cs); - (*env)->DeleteLocalRef(env, argBlock); - - FCL_INTERNAL_LOG("forkAndExec:%s", cs); - JavaVM *androidVm = fcl->android_jvm; - JNIEnv *androidEnv = NULL; - char detachable = 0; - if ((*androidVm)->GetEnv(androidVm, (void **) &androidEnv, JNI_VERSION_1_2) == JNI_EDETACHED) { - (*androidVm)->AttachCurrentThread(androidVm, &androidEnv, NULL); - detachable = 1; - } - if (!androidEnv) { - FCL_INTERNAL_LOG("forkAndExec error:androidEnv in null"); - } - jmethodID method_OpenLink = (*androidEnv)->GetStaticMethodID(androidEnv, fcl->class_FCLBridge, "openLink", - "(Ljava/lang/String;)V"); - (*androidEnv)->CallStaticVoidMethod(androidEnv, fcl->class_FCLBridge, method_OpenLink, - (*androidEnv)->NewStringUTF(androidEnv, cs)); - if (detachable) (*androidVm)->DetachCurrentThread(androidVm); - - return 0; -} - -void hookExec(JNIEnv *env) { - jclass cls; - orig_ProcessImpl_forkAndExec = dlsym(RTLD_DEFAULT, "Java_java_lang_UNIXProcess_forkAndExec"); - if (!orig_ProcessImpl_forkAndExec) { - orig_ProcessImpl_forkAndExec = dlsym(RTLD_DEFAULT, - "Java_java_lang_ProcessImpl_forkAndExec"); - cls = (*env)->FindClass(env, "java/lang/ProcessImpl"); - } else { - cls = (*env)->FindClass(env, "java/lang/UNIXProcess"); - } - JNINativeMethod methods[] = { - {"forkAndExec", "(I[B[B[BI[BI[B[IZ)I", (void *) &hooked_ProcessImpl_forkAndExec} - }; - (*env)->RegisterNatives(env, cls, methods, 1); - FCL_INTERNAL_LOG("Registered forkAndExec"); -} diff --git a/FCLauncher/src/main/jni/lwjgl/fcl_hook.h b/FCLauncher/src/main/jni/lwjgl/fcl_hook.h deleted file mode 100644 index d87f29bb..00000000 --- a/FCLauncher/src/main/jni/lwjgl/fcl_hook.h +++ /dev/null @@ -1,12 +0,0 @@ -// -// Created by mio on 2023/7/9. -// - -#ifndef FOLD_CRAFT_LAUNCHER_FCL_HOOK_H -#define FOLD_CRAFT_LAUNCHER_FCL_HOOK_H - -#include -void hookExec(JNIEnv *env); - - -#endif //FOLD_CRAFT_LAUNCHER_FCL_HOOK_H diff --git a/FCLauncher/src/main/jni/lwjgl/ffi.h b/FCLauncher/src/main/jni/lwjgl/ffi.h deleted file mode 100644 index 6c16184a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/ffi.h +++ /dev/null @@ -1,538 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - libffi @VERSION@ - - Copyright (c) 2011, 2014, 2019, 2021, 2022 Anthony Green - - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the ``Software''), to deal in the Software without - restriction, including without limitation the rights to use, copy, - modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - ----------------------------------------------------------------------- */ - -/* ------------------------------------------------------------------- - Most of the API is documented in doc/libffi.texi. - - The raw API is designed to bypass some of the argument packing and - unpacking on architectures for which it can be avoided. Routines - are provided to emulate the raw API if the underlying platform - doesn't allow faster implementation. - - More details on the raw API can be found in: - - http://gcc.gnu.org/ml/java/1999-q3/msg00138.html - - and - - http://gcc.gnu.org/ml/java/1999-q3/msg00174.html - -------------------------------------------------------------------- */ - -#ifndef LIBFFI_H -#define LIBFFI_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Specify which architecture libffi is configured for. */ -//#ifndef @TARGET@ -//#define @TARGET@ -//#endif - -/* ---- System configuration information --------------------------------- */ - -#define HAVE_LONG_DOUBLE 0 -#if defined(LWJGL_MACOS) && defined(LWJGL_arm64) -#define FFI_EXEC_TRAMPOLINE_TABLE 1 -#else -#define FFI_EXEC_TRAMPOLINE_TABLE 0 -#endif - -/* If these change, update src/mips/ffitarget.h. */ -#define FFI_TYPE_VOID 0 -#define FFI_TYPE_INT 1 -#define FFI_TYPE_FLOAT 2 -#define FFI_TYPE_DOUBLE 3 -#if HAVE_LONG_DOUBLE -#define FFI_TYPE_LONGDOUBLE 4 -#else -#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE -#endif -#define FFI_TYPE_UINT8 5 -#define FFI_TYPE_SINT8 6 -#define FFI_TYPE_UINT16 7 -#define FFI_TYPE_SINT16 8 -#define FFI_TYPE_UINT32 9 -#define FFI_TYPE_SINT32 10 -#define FFI_TYPE_UINT64 11 -#define FFI_TYPE_SINT64 12 -#define FFI_TYPE_STRUCT 13 -#define FFI_TYPE_POINTER 14 -#define FFI_TYPE_COMPLEX 15 - -/* This should always refer to the last type code (for sanity checks). */ -#define FFI_TYPE_LAST FFI_TYPE_COMPLEX - -#include - -#ifndef LIBFFI_ASM - -#if defined(_MSC_VER) && !defined(__clang__) -#define __attribute__(X) -#endif - -#include -#include - -/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example). - But we can find it either under the correct ANSI name, or under GNU - C's internal name. */ - -#define FFI_64_BIT_MAX 9223372036854775807 - -#ifdef LONG_LONG_MAX -# define FFI_LONG_LONG_MAX LONG_LONG_MAX -#else -# ifdef LLONG_MAX -# define FFI_LONG_LONG_MAX LLONG_MAX -# ifdef _AIX52 /* or newer has C99 LLONG_MAX */ -# undef FFI_64_BIT_MAX -# define FFI_64_BIT_MAX 9223372036854775807LL -# endif /* _AIX52 or newer */ -# else -# ifdef __GNUC__ -# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__ -# endif -# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */ -# ifndef __PPC64__ -# if defined (__IBMC__) || defined (__IBMCPP__) -# define FFI_LONG_LONG_MAX LONGLONG_MAX -# endif -# endif /* __PPC64__ */ -# undef FFI_64_BIT_MAX -# define FFI_64_BIT_MAX 9223372036854775807LL -# endif -# endif -#endif - -/* The closure code assumes that this works on pointers, i.e. a size_t - can hold a pointer. */ - -typedef struct _ffi_type -{ - size_t size; - unsigned short alignment; - unsigned short type; - struct _ffi_type **elements; -} ffi_type; - -/* Need minimal decorations for DLLs to work on Windows. GCC has - autoimport and autoexport. Always mark externally visible symbols - as dllimport for MSVC clients, even if it means an extra indirection - when using the static version of the library. - Besides, as a workaround, they can define FFI_BUILDING if they - *know* they are going to link with the static library. */ -#if defined _MSC_VER -# if defined FFI_BUILDING_DLL /* Building libffi.DLL with msvcc.sh */ -# define FFI_API __declspec(dllexport) -# elif !defined FFI_BUILDING /* Importing libffi.DLL */ -# define FFI_API __declspec(dllimport) -# else /* Building/linking static library */ -# define FFI_API -# endif -#else -# define FFI_API -#endif - -/* The externally visible type declarations also need the MSVC DLL - decorations, or they will not be exported from the object file. */ -#if defined LIBFFI_HIDE_BASIC_TYPES -# define FFI_EXTERN FFI_API -#else -# define FFI_EXTERN extern FFI_API -#endif - -#ifndef LIBFFI_HIDE_BASIC_TYPES -#if SCHAR_MAX == 127 -# define ffi_type_uchar ffi_type_uint8 -# define ffi_type_schar ffi_type_sint8 -#else - #error "char size not supported" -#endif - -#if SHRT_MAX == 32767 -# define ffi_type_ushort ffi_type_uint16 -# define ffi_type_sshort ffi_type_sint16 -#elif SHRT_MAX == 2147483647 -# define ffi_type_ushort ffi_type_uint32 -# define ffi_type_sshort ffi_type_sint32 -#else - #error "short size not supported" -#endif - -#if INT_MAX == 32767 -# define ffi_type_uint ffi_type_uint16 -# define ffi_type_sint ffi_type_sint16 -#elif INT_MAX == 2147483647 -# define ffi_type_uint ffi_type_uint32 -# define ffi_type_sint ffi_type_sint32 -#elif INT_MAX == 9223372036854775807 -# define ffi_type_uint ffi_type_uint64 -# define ffi_type_sint ffi_type_sint64 -#else - #error "int size not supported" -#endif - -#if LONG_MAX == 2147483647 -# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX - #error "no 64-bit data type supported" -# endif -#elif LONG_MAX != FFI_64_BIT_MAX - #error "long size not supported" -#endif - -#if LONG_MAX == 2147483647 -# define ffi_type_ulong ffi_type_uint32 -# define ffi_type_slong ffi_type_sint32 -#elif LONG_MAX == FFI_64_BIT_MAX -# define ffi_type_ulong ffi_type_uint64 -# define ffi_type_slong ffi_type_sint64 -#else - #error "long size not supported" -#endif - -/* These are defined in types.c. */ -FFI_EXTERN ffi_type ffi_type_void; -FFI_EXTERN ffi_type ffi_type_uint8; -FFI_EXTERN ffi_type ffi_type_sint8; -FFI_EXTERN ffi_type ffi_type_uint16; -FFI_EXTERN ffi_type ffi_type_sint16; -FFI_EXTERN ffi_type ffi_type_uint32; -FFI_EXTERN ffi_type ffi_type_sint32; -FFI_EXTERN ffi_type ffi_type_uint64; -FFI_EXTERN ffi_type ffi_type_sint64; -FFI_EXTERN ffi_type ffi_type_float; -FFI_EXTERN ffi_type ffi_type_double; -FFI_EXTERN ffi_type ffi_type_pointer; - -#if HAVE_LONG_DOUBLE -FFI_EXTERN ffi_type ffi_type_longdouble; -#else -#define ffi_type_longdouble ffi_type_double -#endif - -#ifdef FFI_TARGET_HAS_COMPLEX_TYPE -FFI_EXTERN ffi_type ffi_type_complex_float; -FFI_EXTERN ffi_type ffi_type_complex_double; -#if HAVE_LONG_DOUBLE -FFI_EXTERN ffi_type ffi_type_complex_longdouble; -#else -#define ffi_type_complex_longdouble ffi_type_complex_double -#endif -#endif -#endif /* LIBFFI_HIDE_BASIC_TYPES */ - -typedef enum { - FFI_OK = 0, - FFI_BAD_TYPEDEF, - FFI_BAD_ABI, - FFI_BAD_ARGTYPE -} ffi_status; - -typedef struct { - ffi_abi abi; - unsigned nargs; - ffi_type **arg_types; - ffi_type *rtype; - unsigned bytes; - unsigned flags; -#ifdef FFI_EXTRA_CIF_FIELDS - FFI_EXTRA_CIF_FIELDS; -#endif -} ffi_cif; - -/* ---- Definitions for the raw API -------------------------------------- */ - -#ifndef FFI_SIZEOF_ARG -# if LONG_MAX == 2147483647 -# define FFI_SIZEOF_ARG 4 -# elif LONG_MAX == FFI_64_BIT_MAX -# define FFI_SIZEOF_ARG 8 -# endif -#endif - -#ifndef FFI_SIZEOF_JAVA_RAW -# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG -#endif - -typedef union { - ffi_sarg sint; - ffi_arg uint; - float flt; - char data[FFI_SIZEOF_ARG]; - void* ptr; -} ffi_raw; - -#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8 -/* This is a special case for mips64/n32 ABI (and perhaps others) where - sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */ -typedef union { - signed int sint; - unsigned int uint; - float flt; - char data[FFI_SIZEOF_JAVA_RAW]; - void* ptr; -} ffi_java_raw; -#else -typedef ffi_raw ffi_java_raw; -#endif - - -FFI_API -void ffi_raw_call (ffi_cif *cif, - void (*fn)(void), - void *rvalue, - ffi_raw *avalue); - -FFI_API void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw); -FFI_API void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args); -FFI_API size_t ffi_raw_size (ffi_cif *cif); - -/* This is analogous to the raw API, except it uses Java parameter - packing, even on 64-bit machines. I.e. on 64-bit machines longs - and doubles are followed by an empty 64-bit word. */ - -#if !FFI_NATIVE_RAW_API -FFI_API -void ffi_java_raw_call (ffi_cif *cif, - void (*fn)(void), - void *rvalue, - ffi_java_raw *avalue) __attribute__((deprecated)); -#endif - -FFI_API -void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated)); -FFI_API -void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args) __attribute__((deprecated)); -FFI_API -size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated)); - -/* ---- Definitions for closures ----------------------------------------- */ - -#if FFI_CLOSURES - -#ifdef _MSC_VER -__declspec(align(8)) -#endif -typedef struct { -#if FFI_EXEC_TRAMPOLINE_TABLE - void *trampoline_table; - void *trampoline_table_entry; -#else - union { - char tramp[FFI_TRAMPOLINE_SIZE]; - void *ftramp; - }; -#endif - ffi_cif *cif; - void (*fun)(ffi_cif*,void*,void**,void*); - void *user_data; -#if defined(_MSC_VER) && defined(_M_IX86) - void *padding; -#endif -} ffi_closure -#ifdef __GNUC__ - __attribute__((aligned (8))) -#endif - ; - -#ifndef __GNUC__ -# ifdef __sgi -# pragma pack 0 -# endif -#endif - -FFI_API void *ffi_closure_alloc (size_t size, void **code); -FFI_API void ffi_closure_free (void *); - -#if defined(PA_LINUX) || defined(PA_HPUX) -#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2)) -#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3)) -#else -#define FFI_CLOSURE_PTR(X) (X) -#define FFI_RESTORE_PTR(X) (X) -#endif - -FFI_API ffi_status -ffi_prep_closure (ffi_closure*, - ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data) -#if defined(__GNUC__) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 405) - __attribute__((deprecated ("use ffi_prep_closure_loc instead"))) -#elif defined(__GNUC__) && __GNUC__ >= 3 - __attribute__((deprecated)) -#endif - ; - -FFI_API ffi_status -ffi_prep_closure_loc (ffi_closure*, - ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*), - void *user_data, - void *codeloc); - -#ifdef __sgi -# pragma pack 8 -#endif -typedef struct { -#if FFI_EXEC_TRAMPOLINE_TABLE - void *trampoline_table; - void *trampoline_table_entry; -#else - char tramp[FFI_TRAMPOLINE_SIZE]; -#endif - ffi_cif *cif; - -#if !FFI_NATIVE_RAW_API - - /* If this is enabled, then a raw closure has the same layout - as a regular closure. We use this to install an intermediate - handler to do the transaltion, void** -> ffi_raw*. */ - - void (*translate_args)(ffi_cif*,void*,void**,void*); - void *this_closure; - -#endif - - void (*fun)(ffi_cif*,void*,ffi_raw*,void*); - void *user_data; - -} ffi_raw_closure; - -typedef struct { -#if FFI_EXEC_TRAMPOLINE_TABLE - void *trampoline_table; - void *trampoline_table_entry; -#else - char tramp[FFI_TRAMPOLINE_SIZE]; -#endif - - ffi_cif *cif; - -#if !FFI_NATIVE_RAW_API - - /* If this is enabled, then a raw closure has the same layout - as a regular closure. We use this to install an intermediate - handler to do the translation, void** -> ffi_raw*. */ - - void (*translate_args)(ffi_cif*,void*,void**,void*); - void *this_closure; - -#endif - - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*); - void *user_data; - -} ffi_java_raw_closure; - -FFI_API ffi_status -ffi_prep_raw_closure (ffi_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data); - -FFI_API ffi_status -ffi_prep_raw_closure_loc (ffi_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_raw*,void*), - void *user_data, - void *codeloc); - -#if !FFI_NATIVE_RAW_API -FFI_API ffi_status -ffi_prep_java_raw_closure (ffi_java_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), - void *user_data) __attribute__((deprecated)); - -FFI_API ffi_status -ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*, - ffi_cif *cif, - void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*), - void *user_data, - void *codeloc) __attribute__((deprecated)); -#endif - -#endif /* FFI_CLOSURES */ - -#if FFI_GO_CLOSURES - -typedef struct { - void *tramp; - ffi_cif *cif; - void (*fun)(ffi_cif*,void*,void**,void*); -} ffi_go_closure; - -FFI_API ffi_status ffi_prep_go_closure (ffi_go_closure*, ffi_cif *, - void (*fun)(ffi_cif*,void*,void**,void*)); - -FFI_API void ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, - void **avalue, void *closure); - -#endif /* FFI_GO_CLOSURES */ - -/* ---- Public interface definition -------------------------------------- */ - -FFI_API -ffi_status ffi_prep_cif(ffi_cif *cif, - ffi_abi abi, - unsigned int nargs, - ffi_type *rtype, - ffi_type **atypes); - -FFI_API -ffi_status ffi_prep_cif_var(ffi_cif *cif, - ffi_abi abi, - unsigned int nfixedargs, - unsigned int ntotalargs, - ffi_type *rtype, - ffi_type **atypes); - -FFI_API -void ffi_call(ffi_cif *cif, - void (*fn)(void), - void *rvalue, - void **avalue); - -FFI_API -ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type, - size_t *offsets); - -/* Useful for eliminating compiler warnings. */ -#define FFI_FN(f) ((void (*)(void))f) - -/* ---- Definitions shared with assembly code ---------------------------- */ - -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/libffi/arm64-v8a/ffitarget.h b/FCLauncher/src/main/jni/lwjgl/libffi/arm64-v8a/ffitarget.h deleted file mode 100644 index 3ad68583..00000000 --- a/FCLauncher/src/main/jni/lwjgl/libffi/arm64-v8a/ffitarget.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -``Software''), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -#ifdef __ILP32__ -#define FFI_SIZEOF_ARG 8 -#define FFI_SIZEOF_JAVA_RAW 4 -typedef unsigned long long ffi_arg; -typedef signed long long ffi_sarg; -#elif defined(_WIN32) -#define FFI_SIZEOF_ARG 8 -typedef unsigned long long ffi_arg; -typedef signed long long ffi_sarg; -#else -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; -#endif - -typedef enum ffi_abi - { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_WIN64, - FFI_LAST_ABI, -#if defined(_WIN32) - FFI_DEFAULT_ABI = FFI_WIN64, -#else - FFI_DEFAULT_ABI = FFI_SYSV, -#endif - - // LWJGL - //FFI_WIN64 = -1, - FFI_GNUW64 = -1, - FFI_UNIX64 = -1, - FFI_EFI64 = -1, - //FFI_SYSV = -1, - FFI_STDCALL = -1, - FFI_THISCALL = -1, - FFI_FASTCALL = -1, - FFI_MS_CDECL = -1, - FFI_PASCAL = -1, - FFI_REGISTER = -1, - FFI_VFP = -1, - } ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ -#define FFI_TRAMPOLINE_SIZE 16 -#define FFI_TRAMPOLINE_CLOSURE_OFFSET 16 -#else -#error "No trampoline table implementation" -#endif - -#else -#define FFI_TRAMPOLINE_SIZE 24 -#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE -#endif - -#ifdef _WIN32 -#define FFI_EXTRA_CIF_FIELDS unsigned is_variadic -#endif -#define FFI_TARGET_SPECIFIC_VARIADIC - -/* ---- Internal ---- */ - -#if defined (__APPLE__) -#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs -#elif !defined(_WIN32) -/* iOS and Windows reserve x18 for the system. Disable Go closures until - a new static chain is chosen. */ -#define FFI_GO_CLOSURES 1 -#endif - -#ifndef _WIN32 -/* No complex type on Windows */ -#define FFI_TARGET_HAS_COMPLEX_TYPE -#endif - -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/libffi/arm64-v8a/libffi.a b/FCLauncher/src/main/jni/lwjgl/libffi/arm64-v8a/libffi.a deleted file mode 100644 index da273eb2..00000000 Binary files a/FCLauncher/src/main/jni/lwjgl/libffi/arm64-v8a/libffi.a and /dev/null differ diff --git a/FCLauncher/src/main/jni/lwjgl/libffi/armeabi-v7a/ffitarget.h b/FCLauncher/src/main/jni/lwjgl/libffi/armeabi-v7a/ffitarget.h deleted file mode 100644 index 0f505888..00000000 --- a/FCLauncher/src/main/jni/lwjgl/libffi/armeabi-v7a/ffitarget.h +++ /dev/null @@ -1,103 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012 Anthony Green - Copyright (c) 2010 CodeSourcery - Copyright (c) 1996-2003 Red Hat, Inc. - - Target configuration macros for ARM. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - FFI_FIRST_ABI = 0, - FFI_SYSV, - FFI_VFP, - FFI_LAST_ABI, -#if defined(__ARM_PCS_VFP) || defined(_M_ARM) - FFI_DEFAULT_ABI = FFI_VFP, -#else - FFI_DEFAULT_ABI = FFI_SYSV, -#endif - - // LWJGL - FFI_WIN64 = -1, - FFI_GNUW64 = -1, - FFI_UNIX64 = -1, - FFI_EFI64 = -1, - //FFI_SYSV = -1, - FFI_STDCALL = -1, - FFI_THISCALL = -1, - FFI_FASTCALL = -1, - FFI_MS_CDECL = -1, - FFI_PASCAL = -1, - FFI_REGISTER = -1, - //FFI_VFP = -1, -} ffi_abi; -#endif - -#define FFI_EXTRA_CIF_FIELDS \ - int vfp_used; \ - unsigned short vfp_reg_free, vfp_nargs; \ - signed char vfp_args[16] \ - -#define FFI_TARGET_SPECIFIC_VARIADIC -#ifndef _M_ARM -#define FFI_TARGET_HAS_COMPLEX_TYPE -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 -#define FFI_NATIVE_RAW_API 0 - -#if defined (FFI_EXEC_TRAMPOLINE_TABLE) && FFI_EXEC_TRAMPOLINE_TABLE - -#ifdef __MACH__ -#define FFI_TRAMPOLINE_SIZE 12 -#define FFI_TRAMPOLINE_CLOSURE_OFFSET 8 -#else -#error "No trampoline table implementation" -#endif - -#else -#ifdef _MSC_VER -#define FFI_TRAMPOLINE_SIZE 16 -#define FFI_TRAMPOLINE_CLOSURE_FUNCTION 12 -#else -#define FFI_TRAMPOLINE_SIZE 12 -#endif -#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE -#endif - -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/libffi/armeabi-v7a/libffi.a b/FCLauncher/src/main/jni/lwjgl/libffi/armeabi-v7a/libffi.a deleted file mode 100644 index 5b7a2077..00000000 Binary files a/FCLauncher/src/main/jni/lwjgl/libffi/armeabi-v7a/libffi.a and /dev/null differ diff --git a/FCLauncher/src/main/jni/lwjgl/libffi/x86/ffitarget.h b/FCLauncher/src/main/jni/lwjgl/libffi/x86/ffitarget.h deleted file mode 100644 index 3cc1b29b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/libffi/x86/ffitarget.h +++ /dev/null @@ -1,217 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012, 2014, 2018 Anthony Green - Copyright (c) 1996-2003, 2010 Red Hat, Inc. - Copyright (C) 2008 Free Software Foundation, Inc. - - Target configuration macros for x86 and x86-64. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -/* For code common to all platforms on x86 and x86_64. */ -#define X86_ANY - -#if defined (X86_64) && defined (__i386__) -#undef X86_64 -#define X86 -#endif - -#ifdef X86_WIN64 -#define FFI_SIZEOF_ARG 8 -#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */ -#endif - -#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION -#ifndef _MSC_VER -#define FFI_TARGET_HAS_COMPLEX_TYPE -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -#ifndef LIBFFI_ASM -#ifdef X86_WIN64 -#ifdef _MSC_VER -typedef unsigned __int64 ffi_arg; -typedef __int64 ffi_sarg; -#else -typedef unsigned long long ffi_arg; -typedef long long ffi_sarg; -#endif -#else -#if defined __x86_64__ && defined __ILP32__ -#define FFI_SIZEOF_ARG 8 -#define FFI_SIZEOF_JAVA_RAW 4 -typedef unsigned long long ffi_arg; -typedef long long ffi_sarg; -#else -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; -#endif -#endif - -typedef enum ffi_abi { -#if defined(X86_WIN64) - FFI_FIRST_ABI = 0, - FFI_WIN64, /* sizeof(long double) == 8 - microsoft compilers */ - FFI_GNUW64, /* sizeof(long double) == 16 - GNU compilers */ - FFI_LAST_ABI, -#ifdef __GNUC__ - FFI_DEFAULT_ABI = FFI_GNUW64, -#else - FFI_DEFAULT_ABI = FFI_WIN64, - - // LWJGL - //FFI_WIN64 = -1, - //FFI_GNUW64 = -1, - FFI_UNIX64 = -1, - FFI_EFI64 = -1, - FFI_SYSV = -1, - FFI_STDCALL = -1, - FFI_THISCALL = -1, - FFI_FASTCALL = -1, - FFI_MS_CDECL = -1, - FFI_PASCAL = -1, - FFI_REGISTER = -1, - FFI_VFP = -1, -#endif - -#elif defined(X86_64) || (defined (__x86_64__) && defined (X86_DARWIN)) - FFI_FIRST_ABI = 1, - FFI_UNIX64, - FFI_WIN64, - FFI_EFI64 = FFI_WIN64, - FFI_GNUW64, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_UNIX64, - - // LWJGL - //FFI_WIN64 = -1, - //FFI_GNUW64 = -1, - //FFI_UNIX64 = -1, - //FFI_EFI64 = -1, - FFI_SYSV = -1, - FFI_STDCALL = -1, - FFI_THISCALL = -1, - FFI_FASTCALL = -1, - FFI_MS_CDECL = -1, - FFI_PASCAL = -1, - FFI_REGISTER = -1, - FFI_VFP = -1, - -#elif defined(X86_WIN32) - FFI_FIRST_ABI = 0, - FFI_SYSV = 1, - FFI_STDCALL = 2, - FFI_THISCALL = 3, - FFI_FASTCALL = 4, - FFI_MS_CDECL = 5, - FFI_PASCAL = 6, - FFI_REGISTER = 7, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_MS_CDECL, - - // LWJGL - FFI_WIN64 = -1, - FFI_GNUW64 = -1, - FFI_UNIX64 = -1, - FFI_EFI64 = -1, - //FFI_SYSV = -1, - //FFI_STDCALL = -1, - //FFI_THISCALL = -1, - //FFI_FASTCALL = -1, - //FFI_MS_CDECL = -1, - //FFI_PASCAL = -1, - //FFI_REGISTER = -1, - FFI_VFP = -1, -#else - FFI_FIRST_ABI = 0, - FFI_SYSV = 1, - FFI_THISCALL = 3, - FFI_FASTCALL = 4, - FFI_STDCALL = 5, - FFI_PASCAL = 6, - FFI_REGISTER = 7, - FFI_MS_CDECL = 8, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_SYSV, - - // LWJGL - FFI_WIN64 = -1, - FFI_GNUW64 = -1, - FFI_UNIX64 = -1, - FFI_EFI64 = -1, - //FFI_SYSV = -1, - //FFI_STDCALL = -1, - //FFI_THISCALL = -1, - //FFI_FASTCALL = -1, - //FFI_MS_CDECL = -1, - //FFI_PASCAL = -1, - //FFI_REGISTER = -1, - FFI_VFP = -1, -#endif -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 - -#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1) -#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2) -#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3) -#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4) - -#if defined (X86_64) || defined(X86_WIN64) \ - || (defined (__x86_64__) && defined (X86_DARWIN)) -/* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP - + 8 bytes of pointer. */ -# define FFI_TRAMPOLINE_SIZE 32 -# define FFI_NATIVE_RAW_API 0 -#else -/* 4 bytes of ENDBR32 + 5 bytes of MOV + 5 bytes of JMP + 2 unused - bytes. */ -# define FFI_TRAMPOLINE_SIZE 16 -# define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */ -#endif - -#if !defined(GENERATE_LIBFFI_MAP) && defined(__CET__) -# include -# if (__CET__ & 1) != 0 -# define ENDBR_PRESENT -# endif -# define _CET_NOTRACK notrack -#else -# define _CET_ENDBR -# define _CET_NOTRACK -#endif - -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/libffi/x86/libffi.a b/FCLauncher/src/main/jni/lwjgl/libffi/x86/libffi.a deleted file mode 100644 index b8e6c702..00000000 Binary files a/FCLauncher/src/main/jni/lwjgl/libffi/x86/libffi.a and /dev/null differ diff --git a/FCLauncher/src/main/jni/lwjgl/libffi/x86_64/ffitarget.h b/FCLauncher/src/main/jni/lwjgl/libffi/x86_64/ffitarget.h deleted file mode 100644 index 13544cb7..00000000 --- a/FCLauncher/src/main/jni/lwjgl/libffi/x86_64/ffitarget.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -----------------------------------------------------------------*-C-*- - ffitarget.h - Copyright (c) 2012, 2014, 2018 Anthony Green - Copyright (c) 1996-2003, 2010 Red Hat, Inc. - Copyright (C) 2008 Free Software Foundation, Inc. - - Target configuration macros for x86 and x86-64. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. - - ----------------------------------------------------------------------- */ - -#ifndef LIBFFI_TARGET_H -#define LIBFFI_TARGET_H - -#ifndef LIBFFI_H -#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." -#endif - -/* ---- System specific configurations ----------------------------------- */ - -#define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION -#ifndef _MSC_VER -#define FFI_TARGET_HAS_COMPLEX_TYPE -#endif - -/* ---- Generic type definitions ----------------------------------------- */ - -#ifndef LIBFFI_ASM -typedef unsigned long ffi_arg; -typedef signed long ffi_sarg; - -typedef enum ffi_abi { - - FFI_FIRST_ABI = 1, - FFI_UNIX64, - FFI_WIN64, - FFI_EFI64 = FFI_WIN64, - FFI_GNUW64, - FFI_LAST_ABI, - FFI_DEFAULT_ABI = FFI_UNIX64, - - // LWJGL - //FFI_WIN64 = -1, - //FFI_GNUW64 = -1, - //FFI_UNIX64 = -1, - //FFI_EFI64 = -1, - FFI_SYSV = -1, - FFI_STDCALL = -1, - FFI_THISCALL = -1, - FFI_FASTCALL = -1, - FFI_MS_CDECL = -1, - FFI_PASCAL = -1, - FFI_REGISTER = -1, - FFI_VFP = -1, - -} ffi_abi; -#endif - -/* ---- Definitions for closures ----------------------------------------- */ - -#define FFI_CLOSURES 1 -#define FFI_GO_CLOSURES 1 - -#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1) -#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2) -#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3) -#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4) - -/* 4 bytes of ENDBR64 + 7 bytes of LEA + 6 bytes of JMP + 7 bytes of NOP - + 8 bytes of pointer. */ -# define FFI_TRAMPOLINE_SIZE 32 -# define FFI_NATIVE_RAW_API 0 - -# define _CET_ENDBR -# define _CET_NOTRACK - -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/libffi/x86_64/libffi.a b/FCLauncher/src/main/jni/lwjgl/libffi/x86_64/libffi.a deleted file mode 100644 index 921c2f75..00000000 Binary files a/FCLauncher/src/main/jni/lwjgl/libffi/x86_64/libffi.a and /dev/null differ diff --git a/FCLauncher/src/main/jni/lwjgl/lwjgl_malloc.h b/FCLauncher/src/main/jni/lwjgl/lwjgl_malloc.h deleted file mode 100644 index 2f35ee82..00000000 --- a/FCLauncher/src/main/jni/lwjgl/lwjgl_malloc.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ -#pragma once - -#include - -#define LWJGL_MALLOC(function) org_lwjgl_##function - -// Overridable memory management functions - -typedef void* (*mallocPROC) (size_t); -typedef void* (*callocPROC) (size_t num, size_t size); -typedef void* (*reallocPROC) (void *ptr, size_t size); -typedef void (*freePROC) (void *ptr); -typedef void* (*aligned_allocPROC) (size_t alignment, size_t size); -typedef void (*aligned_freePROC) (void *ptr); - -extern mallocPROC org_lwjgl_malloc; -extern callocPROC org_lwjgl_calloc; -extern reallocPROC org_lwjgl_realloc; -extern freePROC org_lwjgl_free; - -extern aligned_allocPROC org_lwjgl_aligned_alloc; -extern aligned_freePROC org_lwjgl_aligned_free; - -#ifdef LWJGL_MALLOC_LIB -#define XSETUP_MALLOC(classPath) SETUP_MALLOC(classPath) -#define SETUP_MALLOC(classPath) \ -JNIEXPORT void JNICALL Java_##classPath##_setupMalloc( \ - JNIEnv *env, jclass clazz, \ - \ - jlong malloc, \ - jlong calloc, \ - jlong realloc, \ - jlong free, \ - \ - jlong aligned_alloc, \ - jlong aligned_free \ -) { \ - UNUSED_PARAMS(env, clazz) \ - \ - org_lwjgl_malloc = (mallocPROC)(uintptr_t)malloc; \ - org_lwjgl_calloc = (callocPROC)(uintptr_t)calloc; \ - org_lwjgl_realloc = (reallocPROC)(uintptr_t)realloc; \ - org_lwjgl_free = (freePROC)(uintptr_t)free; \ - \ - org_lwjgl_aligned_alloc = (aligned_allocPROC)(uintptr_t)aligned_alloc; \ - org_lwjgl_aligned_free = (aligned_freePROC)(uintptr_t)aligned_free; \ -} - -mallocPROC org_lwjgl_malloc; -callocPROC org_lwjgl_calloc; -reallocPROC org_lwjgl_realloc; -freePROC org_lwjgl_free; - -aligned_allocPROC org_lwjgl_aligned_alloc; -aligned_freePROC org_lwjgl_aligned_free; - -EXTERN_C_ENTER - -XSETUP_MALLOC(LWJGL_MALLOC_LIB) - -EXTERN_C_EXIT -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/blendish.h b/FCLauncher/src/main/jni/lwjgl/nanovg/blendish.h deleted file mode 100644 index b52df146..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/blendish.h +++ /dev/null @@ -1,2400 +0,0 @@ -/* -Blendish - Blender 2.5 UI based theming functions for NanoVG - -Copyright (c) 2014 Leonard Ritter - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#ifndef BLENDISH_H -#define BLENDISH_H - -#include "nanovg.h" - -#ifndef NANOVG_H -#error "nanovg.h must be included first." -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - -Revision 6 (2014-09-21) - -Summary -------- - -Blendish is a small collection of drawing functions for NanoVG, designed to -replicate the look of the Blender 2.5+ User Interface. You can use these -functions to theme your UI library. Several metric constants for faithful -reproduction are also included. - -Blendish supports the original Blender icon sheet; As the licensing of Blenders -icons is unclear, they are not included in Blendishes repository, but a SVG -template, "icons_template.svg" is provided, which you can use to build your own -icon sheet. - -To use icons, you must first load the icon sheet using one of the -nvgCreateImage*() functions and then pass the image handle to bndSetIconImage(); -otherwise, no icons will be drawn. See bndSetIconImage() for more information. - -Blendish will not render text until a suitable UI font has been passed to -bndSetFont() has been called. See bndSetFont() for more information. - - -Drawbacks ---------- - -There is no support for varying dpi resolutions yet. The library is hardcoded -to the equivalent of 72 dpi in the Blender system settings. - -Support for label truncation is missing. Text rendering breaks when widgets are -too short to contain their labels. - -Usage ------ - -To use this header file in implementation mode, define BLENDISH_IMPLEMENTATION -before including blendish.h, otherwise the file will be in header-only mode. - -*/ - -// you can override this from the outside to pick -// the export level you need -#ifndef BND_EXPORT -#define BND_EXPORT -#endif - -// if that typedef is provided elsewhere, you may define -// BLENDISH_NO_NVG_TYPEDEFS before including the header. -#ifndef BLENDISH_NO_NVG_TYPEDEFS -typedef struct NVGcontext NVGcontext; -typedef struct NVGcolor NVGcolor; -typedef struct NVGglyphPosition NVGglyphPosition; -#endif - -// describes the theme used to draw a single widget or widget box; -// these values correspond to the same values that can be retrieved from -// the Theme panel in the Blender preferences -typedef struct BNDwidgetTheme { - // color of widget box outline - NVGcolor outlineColor; - // color of widget item (meaning changes depending on class) - NVGcolor itemColor; - // fill color of widget box - NVGcolor innerColor; - // fill color of widget box when active - NVGcolor innerSelectedColor; - // color of text label - NVGcolor textColor; - // color of text label when active - NVGcolor textSelectedColor; - // delta modifier for upper part of gradient (-100 to 100) - int shadeTop; - // delta modifier for lower part of gradient (-100 to 100) - int shadeDown; -} BNDwidgetTheme; - -// describes the theme used to draw nodes -typedef struct BNDnodeTheme { - // inner color of selected node (and downarrow) - NVGcolor nodeSelectedColor; - // outline of wires - NVGcolor wiresColor; - // color of text label when active - NVGcolor textSelectedColor; - - // inner color of active node (and dragged wire) - NVGcolor activeNodeColor; - // color of selected wire - NVGcolor wireSelectColor; - // color of background of node - NVGcolor nodeBackdropColor; - - // how much a noodle curves (0 to 10) - int noodleCurving; -} BNDnodeTheme; - -// describes the theme used to draw widgets -typedef struct BNDtheme { - // the background color of panels and windows - NVGcolor backgroundColor; - // theme for labels - BNDwidgetTheme regularTheme; - // theme for tool buttons - BNDwidgetTheme toolTheme; - // theme for radio buttons - BNDwidgetTheme radioTheme; - // theme for text fields - BNDwidgetTheme textFieldTheme; - // theme for option buttons (checkboxes) - BNDwidgetTheme optionTheme; - // theme for choice buttons (comboboxes) - // Blender calls them "menu buttons" - BNDwidgetTheme choiceTheme; - // theme for number fields - BNDwidgetTheme numberFieldTheme; - // theme for slider controls - BNDwidgetTheme sliderTheme; - // theme for scrollbars - BNDwidgetTheme scrollBarTheme; - // theme for tooltips - BNDwidgetTheme tooltipTheme; - // theme for menu backgrounds - BNDwidgetTheme menuTheme; - // theme for menu items - BNDwidgetTheme menuItemTheme; - // theme for nodes - BNDnodeTheme nodeTheme; -} BNDtheme; - -// how text on a control is aligned -typedef enum BNDtextAlignment { - BND_LEFT = 0, - BND_CENTER, -} BNDtextAlignment; - -// states altering the styling of a widget -typedef enum BNDwidgetState { - // not interacting - BND_DEFAULT = 0, - // the mouse is hovering over the control - BND_HOVER, - // the widget is activated (pressed) or in an active state (toggled) - BND_ACTIVE -} BNDwidgetState; - -// flags indicating which corners are sharp (for grouping widgets) -typedef enum BNDcornerFlags { - // all corners are round - BND_CORNER_NONE = 0, - // sharp top left corner - BND_CORNER_TOP_LEFT = 1, - // sharp top right corner - BND_CORNER_TOP_RIGHT = 2, - // sharp bottom right corner - BND_CORNER_DOWN_RIGHT = 4, - // sharp bottom left corner - BND_CORNER_DOWN_LEFT = 8, - // all corners are sharp; - // you can invert a set of flags using ^= BND_CORNER_ALL - BND_CORNER_ALL = 0xF, - // top border is sharp - BND_CORNER_TOP = 3, - // bottom border is sharp - BND_CORNER_DOWN = 0xC, - // left border is sharp - BND_CORNER_LEFT = 9, - // right border is sharp - BND_CORNER_RIGHT = 6 -} BNDcornerFlags; - -// build an icon ID from two coordinates into the icon sheet, where -// (0,0) designates the upper-leftmost icon, (1,0) the one right next to it, -// and so on. -#define BND_ICONID(x,y) ((x)|((y)<<8)) -// alpha of disabled widget groups -// can be used in conjunction with nvgGlobalAlpha() -#define BND_DISABLED_ALPHA 0.5 - -enum { - // default widget height - BND_WIDGET_HEIGHT = 21, - // default toolbutton width (if icon only) - BND_TOOL_WIDTH = 20, - - // default radius of node ports - BND_NODE_PORT_RADIUS = 5, - // top margin of node content - BND_NODE_MARGIN_TOP = 25, - // bottom margin of node content - BND_NODE_MARGIN_DOWN = 5, - // left and right margin of node content - BND_NODE_MARGIN_SIDE = 10, - // height of node title bar - BND_NODE_TITLE_HEIGHT = 20, - // width of node title arrow click area - BND_NODE_ARROW_AREA_WIDTH = 20, - - // size of splitter corner click area - BND_SPLITTER_AREA_SIZE = 12, - - // width of vertical scrollbar - BND_SCROLLBAR_WIDTH = 13, - // height of horizontal scrollbar - BND_SCROLLBAR_HEIGHT = 14, - - // default vertical spacing - BND_VSPACING = 1, - // default vertical spacing between groups - BND_VSPACING_GROUP = 8, - // default horizontal spacing - BND_HSPACING = 8, -}; - -typedef enum BNDicon { - BND_ICON_NONE = BND_ICONID(0,29), - BND_ICON_QUESTION = BND_ICONID(1,29), - BND_ICON_ERROR = BND_ICONID(2,29), - BND_ICON_CANCEL = BND_ICONID(3,29), - BND_ICON_TRIA_RIGHT = BND_ICONID(4,29), - BND_ICON_TRIA_DOWN = BND_ICONID(5,29), - BND_ICON_TRIA_LEFT = BND_ICONID(6,29), - BND_ICON_TRIA_UP = BND_ICONID(7,29), - BND_ICON_ARROW_LEFTRIGHT = BND_ICONID(8,29), - BND_ICON_PLUS = BND_ICONID(9,29), - BND_ICON_DISCLOSURE_TRI_DOWN = BND_ICONID(10,29), - BND_ICON_DISCLOSURE_TRI_RIGHT = BND_ICONID(11,29), - BND_ICON_RADIOBUT_OFF = BND_ICONID(12,29), - BND_ICON_RADIOBUT_ON = BND_ICONID(13,29), - BND_ICON_MENU_PANEL = BND_ICONID(14,29), - BND_ICON_BLENDER = BND_ICONID(15,29), - BND_ICON_GRIP = BND_ICONID(16,29), - BND_ICON_DOT = BND_ICONID(17,29), - BND_ICON_COLLAPSEMENU = BND_ICONID(18,29), - BND_ICON_X = BND_ICONID(19,29), - BND_ICON_GO_LEFT = BND_ICONID(21,29), - BND_ICON_PLUG = BND_ICONID(22,29), - BND_ICON_UI = BND_ICONID(23,29), - BND_ICON_NODE = BND_ICONID(24,29), - BND_ICON_NODE_SEL = BND_ICONID(25,29), - - BND_ICON_FULLSCREEN = BND_ICONID(0,28), - BND_ICON_SPLITSCREEN = BND_ICONID(1,28), - BND_ICON_RIGHTARROW_THIN = BND_ICONID(2,28), - BND_ICON_BORDERMOVE = BND_ICONID(3,28), - BND_ICON_VIEWZOOM = BND_ICONID(4,28), - BND_ICON_ZOOMIN = BND_ICONID(5,28), - BND_ICON_ZOOMOUT = BND_ICONID(6,28), - BND_ICON_PANEL_CLOSE = BND_ICONID(7,28), - BND_ICON_COPY_ID = BND_ICONID(8,28), - BND_ICON_EYEDROPPER = BND_ICONID(9,28), - BND_ICON_LINK_AREA = BND_ICONID(10,28), - BND_ICON_AUTO = BND_ICONID(11,28), - BND_ICON_CHECKBOX_DEHLT = BND_ICONID(12,28), - BND_ICON_CHECKBOX_HLT = BND_ICONID(13,28), - BND_ICON_UNLOCKED = BND_ICONID(14,28), - BND_ICON_LOCKED = BND_ICONID(15,28), - BND_ICON_UNPINNED = BND_ICONID(16,28), - BND_ICON_PINNED = BND_ICONID(17,28), - BND_ICON_SCREEN_BACK = BND_ICONID(18,28), - BND_ICON_RIGHTARROW = BND_ICONID(19,28), - BND_ICON_DOWNARROW_HLT = BND_ICONID(20,28), - BND_ICON_DOTSUP = BND_ICONID(21,28), - BND_ICON_DOTSDOWN = BND_ICONID(22,28), - BND_ICON_LINK = BND_ICONID(23,28), - BND_ICON_INLINK = BND_ICONID(24,28), - BND_ICON_PLUGIN = BND_ICONID(25,28), - - BND_ICON_HELP = BND_ICONID(0,27), - BND_ICON_GHOST_ENABLED = BND_ICONID(1,27), - BND_ICON_COLOR = BND_ICONID(2,27), - BND_ICON_LINKED = BND_ICONID(3,27), - BND_ICON_UNLINKED = BND_ICONID(4,27), - BND_ICON_HAND = BND_ICONID(5,27), - BND_ICON_ZOOM_ALL = BND_ICONID(6,27), - BND_ICON_ZOOM_SELECTED = BND_ICONID(7,27), - BND_ICON_ZOOM_PREVIOUS = BND_ICONID(8,27), - BND_ICON_ZOOM_IN = BND_ICONID(9,27), - BND_ICON_ZOOM_OUT = BND_ICONID(10,27), - BND_ICON_RENDER_REGION = BND_ICONID(11,27), - BND_ICON_BORDER_RECT = BND_ICONID(12,27), - BND_ICON_BORDER_LASSO = BND_ICONID(13,27), - BND_ICON_FREEZE = BND_ICONID(14,27), - BND_ICON_STYLUS_PRESSURE = BND_ICONID(15,27), - BND_ICON_GHOST_DISABLED = BND_ICONID(16,27), - BND_ICON_NEW = BND_ICONID(17,27), - BND_ICON_FILE_TICK = BND_ICONID(18,27), - BND_ICON_QUIT = BND_ICONID(19,27), - BND_ICON_URL = BND_ICONID(20,27), - BND_ICON_RECOVER_LAST = BND_ICONID(21,27), - BND_ICON_FULLSCREEN_ENTER = BND_ICONID(23,27), - BND_ICON_FULLSCREEN_EXIT = BND_ICONID(24,27), - BND_ICON_BLANK1 = BND_ICONID(25,27), - - BND_ICON_LAMP = BND_ICONID(0,26), - BND_ICON_MATERIAL = BND_ICONID(1,26), - BND_ICON_TEXTURE = BND_ICONID(2,26), - BND_ICON_ANIM = BND_ICONID(3,26), - BND_ICON_WORLD = BND_ICONID(4,26), - BND_ICON_SCENE = BND_ICONID(5,26), - BND_ICON_EDIT = BND_ICONID(6,26), - BND_ICON_GAME = BND_ICONID(7,26), - BND_ICON_RADIO = BND_ICONID(8,26), - BND_ICON_SCRIPT = BND_ICONID(9,26), - BND_ICON_PARTICLES = BND_ICONID(10,26), - BND_ICON_PHYSICS = BND_ICONID(11,26), - BND_ICON_SPEAKER = BND_ICONID(12,26), - BND_ICON_TEXTURE_SHADED = BND_ICONID(13,26), - - BND_ICON_VIEW3D = BND_ICONID(0,25), - BND_ICON_IPO = BND_ICONID(1,25), - BND_ICON_OOPS = BND_ICONID(2,25), - BND_ICON_BUTS = BND_ICONID(3,25), - BND_ICON_FILESEL = BND_ICONID(4,25), - BND_ICON_IMAGE_COL = BND_ICONID(5,25), - BND_ICON_INFO = BND_ICONID(6,25), - BND_ICON_SEQUENCE = BND_ICONID(7,25), - BND_ICON_TEXT = BND_ICONID(8,25), - BND_ICON_IMASEL = BND_ICONID(9,25), - BND_ICON_SOUND = BND_ICONID(10,25), - BND_ICON_ACTION = BND_ICONID(11,25), - BND_ICON_NLA = BND_ICONID(12,25), - BND_ICON_SCRIPTWIN = BND_ICONID(13,25), - BND_ICON_TIME = BND_ICONID(14,25), - BND_ICON_NODETREE = BND_ICONID(15,25), - BND_ICON_LOGIC = BND_ICONID(16,25), - BND_ICON_CONSOLE = BND_ICONID(17,25), - BND_ICON_PREFERENCES = BND_ICONID(18,25), - BND_ICON_CLIP = BND_ICONID(19,25), - BND_ICON_ASSET_MANAGER = BND_ICONID(20,25), - - BND_ICON_OBJECT_DATAMODE = BND_ICONID(0,24), - BND_ICON_EDITMODE_HLT = BND_ICONID(1,24), - BND_ICON_FACESEL_HLT = BND_ICONID(2,24), - BND_ICON_VPAINT_HLT = BND_ICONID(3,24), - BND_ICON_TPAINT_HLT = BND_ICONID(4,24), - BND_ICON_WPAINT_HLT = BND_ICONID(5,24), - BND_ICON_SCULPTMODE_HLT = BND_ICONID(6,24), - BND_ICON_POSE_HLT = BND_ICONID(7,24), - BND_ICON_PARTICLEMODE = BND_ICONID(8,24), - BND_ICON_LIGHTPAINT = BND_ICONID(9,24), - - BND_ICON_SCENE_DATA = BND_ICONID(0,23), - BND_ICON_RENDERLAYERS = BND_ICONID(1,23), - BND_ICON_WORLD_DATA = BND_ICONID(2,23), - BND_ICON_OBJECT_DATA = BND_ICONID(3,23), - BND_ICON_MESH_DATA = BND_ICONID(4,23), - BND_ICON_CURVE_DATA = BND_ICONID(5,23), - BND_ICON_META_DATA = BND_ICONID(6,23), - BND_ICON_LATTICE_DATA = BND_ICONID(7,23), - BND_ICON_LAMP_DATA = BND_ICONID(8,23), - BND_ICON_MATERIAL_DATA = BND_ICONID(9,23), - BND_ICON_TEXTURE_DATA = BND_ICONID(10,23), - BND_ICON_ANIM_DATA = BND_ICONID(11,23), - BND_ICON_CAMERA_DATA = BND_ICONID(12,23), - BND_ICON_PARTICLE_DATA = BND_ICONID(13,23), - BND_ICON_LIBRARY_DATA_DIRECT = BND_ICONID(14,23), - BND_ICON_GROUP = BND_ICONID(15,23), - BND_ICON_ARMATURE_DATA = BND_ICONID(16,23), - BND_ICON_POSE_DATA = BND_ICONID(17,23), - BND_ICON_BONE_DATA = BND_ICONID(18,23), - BND_ICON_CONSTRAINT = BND_ICONID(19,23), - BND_ICON_SHAPEKEY_DATA = BND_ICONID(20,23), - BND_ICON_CONSTRAINT_BONE = BND_ICONID(21,23), - BND_ICON_CAMERA_STEREO = BND_ICONID(22,23), - BND_ICON_PACKAGE = BND_ICONID(23,23), - BND_ICON_UGLYPACKAGE = BND_ICONID(24,23), - - BND_ICON_BRUSH_DATA = BND_ICONID(0,22), - BND_ICON_IMAGE_DATA = BND_ICONID(1,22), - BND_ICON_FILE = BND_ICONID(2,22), - BND_ICON_FCURVE = BND_ICONID(3,22), - BND_ICON_FONT_DATA = BND_ICONID(4,22), - BND_ICON_RENDER_RESULT = BND_ICONID(5,22), - BND_ICON_SURFACE_DATA = BND_ICONID(6,22), - BND_ICON_EMPTY_DATA = BND_ICONID(7,22), - BND_ICON_SETTINGS = BND_ICONID(8,22), - BND_ICON_RENDER_ANIMATION = BND_ICONID(9,22), - BND_ICON_RENDER_STILL = BND_ICONID(10,22), - BND_ICON_BOIDS = BND_ICONID(12,22), - BND_ICON_STRANDS = BND_ICONID(13,22), - BND_ICON_LIBRARY_DATA_INDIRECT = BND_ICONID(14,22), - BND_ICON_GREASEPENCIL = BND_ICONID(15,22), - BND_ICON_LINE_DATA = BND_ICONID(16,22), - BND_ICON_GROUP_BONE = BND_ICONID(18,22), - BND_ICON_GROUP_VERTEX = BND_ICONID(19,22), - BND_ICON_GROUP_VCOL = BND_ICONID(20,22), - BND_ICON_GROUP_UVS = BND_ICONID(21,22), - BND_ICON_RNA = BND_ICONID(24,22), - BND_ICON_RNA_ADD = BND_ICONID(25,22), - - BND_ICON_OUTLINER_OB_EMPTY = BND_ICONID(0,20), - BND_ICON_OUTLINER_OB_MESH = BND_ICONID(1,20), - BND_ICON_OUTLINER_OB_CURVE = BND_ICONID(2,20), - BND_ICON_OUTLINER_OB_LATTICE = BND_ICONID(3,20), - BND_ICON_OUTLINER_OB_META = BND_ICONID(4,20), - BND_ICON_OUTLINER_OB_LAMP = BND_ICONID(5,20), - BND_ICON_OUTLINER_OB_CAMERA = BND_ICONID(6,20), - BND_ICON_OUTLINER_OB_ARMATURE = BND_ICONID(7,20), - BND_ICON_OUTLINER_OB_FONT = BND_ICONID(8,20), - BND_ICON_OUTLINER_OB_SURFACE = BND_ICONID(9,20), - BND_ICON_OUTLINER_OB_SPEAKER = BND_ICONID(10,20), - BND_ICON_RESTRICT_VIEW_OFF = BND_ICONID(19,20), - BND_ICON_RESTRICT_VIEW_ON = BND_ICONID(20,20), - BND_ICON_RESTRICT_SELECT_OFF = BND_ICONID(21,20), - BND_ICON_RESTRICT_SELECT_ON = BND_ICONID(22,20), - BND_ICON_RESTRICT_RENDER_OFF = BND_ICONID(23,20), - BND_ICON_RESTRICT_RENDER_ON = BND_ICONID(24,20), - - BND_ICON_OUTLINER_DATA_EMPTY = BND_ICONID(0,19), - BND_ICON_OUTLINER_DATA_MESH = BND_ICONID(1,19), - BND_ICON_OUTLINER_DATA_CURVE = BND_ICONID(2,19), - BND_ICON_OUTLINER_DATA_LATTICE = BND_ICONID(3,19), - BND_ICON_OUTLINER_DATA_META = BND_ICONID(4,19), - BND_ICON_OUTLINER_DATA_LAMP = BND_ICONID(5,19), - BND_ICON_OUTLINER_DATA_CAMERA = BND_ICONID(6,19), - BND_ICON_OUTLINER_DATA_ARMATURE = BND_ICONID(7,19), - BND_ICON_OUTLINER_DATA_FONT = BND_ICONID(8,19), - BND_ICON_OUTLINER_DATA_SURFACE = BND_ICONID(9,19), - BND_ICON_OUTLINER_DATA_SPEAKER = BND_ICONID(10,19), - BND_ICON_OUTLINER_DATA_POSE = BND_ICONID(11,19), - - BND_ICON_MESH_PLANE = BND_ICONID(0,18), - BND_ICON_MESH_CUBE = BND_ICONID(1,18), - BND_ICON_MESH_CIRCLE = BND_ICONID(2,18), - BND_ICON_MESH_UVSPHERE = BND_ICONID(3,18), - BND_ICON_MESH_ICOSPHERE = BND_ICONID(4,18), - BND_ICON_MESH_GRID = BND_ICONID(5,18), - BND_ICON_MESH_MONKEY = BND_ICONID(6,18), - BND_ICON_MESH_CYLINDER = BND_ICONID(7,18), - BND_ICON_MESH_TORUS = BND_ICONID(8,18), - BND_ICON_MESH_CONE = BND_ICONID(9,18), - BND_ICON_LAMP_POINT = BND_ICONID(12,18), - BND_ICON_LAMP_SUN = BND_ICONID(13,18), - BND_ICON_LAMP_SPOT = BND_ICONID(14,18), - BND_ICON_LAMP_HEMI = BND_ICONID(15,18), - BND_ICON_LAMP_AREA = BND_ICONID(16,18), - BND_ICON_META_EMPTY = BND_ICONID(19,18), - BND_ICON_META_PLANE = BND_ICONID(20,18), - BND_ICON_META_CUBE = BND_ICONID(21,18), - BND_ICON_META_BALL = BND_ICONID(22,18), - BND_ICON_META_ELLIPSOID = BND_ICONID(23,18), - BND_ICON_META_CAPSULE = BND_ICONID(24,18), - - BND_ICON_SURFACE_NCURVE = BND_ICONID(0,17), - BND_ICON_SURFACE_NCIRCLE = BND_ICONID(1,17), - BND_ICON_SURFACE_NSURFACE = BND_ICONID(2,17), - BND_ICON_SURFACE_NCYLINDER = BND_ICONID(3,17), - BND_ICON_SURFACE_NSPHERE = BND_ICONID(4,17), - BND_ICON_SURFACE_NTORUS = BND_ICONID(5,17), - BND_ICON_CURVE_BEZCURVE = BND_ICONID(9,17), - BND_ICON_CURVE_BEZCIRCLE = BND_ICONID(10,17), - BND_ICON_CURVE_NCURVE = BND_ICONID(11,17), - BND_ICON_CURVE_NCIRCLE = BND_ICONID(12,17), - BND_ICON_CURVE_PATH = BND_ICONID(13,17), - BND_ICON_COLOR_RED = BND_ICONID(19,17), - BND_ICON_COLOR_GREEN = BND_ICONID(20,17), - BND_ICON_COLOR_BLUE = BND_ICONID(21,17), - - BND_ICON_FORCE_FORCE = BND_ICONID(0,16), - BND_ICON_FORCE_WIND = BND_ICONID(1,16), - BND_ICON_FORCE_VORTEX = BND_ICONID(2,16), - BND_ICON_FORCE_MAGNETIC = BND_ICONID(3,16), - BND_ICON_FORCE_HARMONIC = BND_ICONID(4,16), - BND_ICON_FORCE_CHARGE = BND_ICONID(5,16), - BND_ICON_FORCE_LENNARDJONES = BND_ICONID(6,16), - BND_ICON_FORCE_TEXTURE = BND_ICONID(7,16), - BND_ICON_FORCE_CURVE = BND_ICONID(8,16), - BND_ICON_FORCE_BOID = BND_ICONID(9,16), - BND_ICON_FORCE_TURBULENCE = BND_ICONID(10,16), - BND_ICON_FORCE_DRAG = BND_ICONID(11,16), - BND_ICON_FORCE_SMOKEFLOW = BND_ICONID(12,16), - - BND_ICON_MODIFIER = BND_ICONID(0,12), - BND_ICON_MOD_WAVE = BND_ICONID(1,12), - BND_ICON_MOD_BUILD = BND_ICONID(2,12), - BND_ICON_MOD_DECIM = BND_ICONID(3,12), - BND_ICON_MOD_MIRROR = BND_ICONID(4,12), - BND_ICON_MOD_SOFT = BND_ICONID(5,12), - BND_ICON_MOD_SUBSURF = BND_ICONID(6,12), - BND_ICON_HOOK = BND_ICONID(7,12), - BND_ICON_MOD_PHYSICS = BND_ICONID(8,12), - BND_ICON_MOD_PARTICLES = BND_ICONID(9,12), - BND_ICON_MOD_BOOLEAN = BND_ICONID(10,12), - BND_ICON_MOD_EDGESPLIT = BND_ICONID(11,12), - BND_ICON_MOD_ARRAY = BND_ICONID(12,12), - BND_ICON_MOD_UVPROJECT = BND_ICONID(13,12), - BND_ICON_MOD_DISPLACE = BND_ICONID(14,12), - BND_ICON_MOD_CURVE = BND_ICONID(15,12), - BND_ICON_MOD_LATTICE = BND_ICONID(16,12), - BND_ICON_CONSTRAINT_DATA = BND_ICONID(17,12), - BND_ICON_MOD_ARMATURE = BND_ICONID(18,12), - BND_ICON_MOD_SHRINKWRAP = BND_ICONID(19,12), - BND_ICON_MOD_CAST = BND_ICONID(20,12), - BND_ICON_MOD_MESHDEFORM = BND_ICONID(21,12), - BND_ICON_MOD_BEVEL = BND_ICONID(22,12), - BND_ICON_MOD_SMOOTH = BND_ICONID(23,12), - BND_ICON_MOD_SIMPLEDEFORM = BND_ICONID(24,12), - BND_ICON_MOD_MASK = BND_ICONID(25,12), - - BND_ICON_MOD_CLOTH = BND_ICONID(0,11), - BND_ICON_MOD_EXPLODE = BND_ICONID(1,11), - BND_ICON_MOD_FLUIDSIM = BND_ICONID(2,11), - BND_ICON_MOD_MULTIRES = BND_ICONID(3,11), - BND_ICON_MOD_SMOKE = BND_ICONID(4,11), - BND_ICON_MOD_SOLIDIFY = BND_ICONID(5,11), - BND_ICON_MOD_SCREW = BND_ICONID(6,11), - BND_ICON_MOD_VERTEX_WEIGHT = BND_ICONID(7,11), - BND_ICON_MOD_DYNAMICPAINT = BND_ICONID(8,11), - BND_ICON_MOD_REMESH = BND_ICONID(9,11), - BND_ICON_MOD_OCEAN = BND_ICONID(10,11), - BND_ICON_MOD_WARP = BND_ICONID(11,11), - BND_ICON_MOD_SKIN = BND_ICONID(12,11), - BND_ICON_MOD_TRIANGULATE = BND_ICONID(13,11), - BND_ICON_MOD_WIREFRAME = BND_ICONID(14,11), - - BND_ICON_REC = BND_ICONID(0,10), - BND_ICON_PLAY = BND_ICONID(1,10), - BND_ICON_FF = BND_ICONID(2,10), - BND_ICON_REW = BND_ICONID(3,10), - BND_ICON_PAUSE = BND_ICONID(4,10), - BND_ICON_PREV_KEYFRAME = BND_ICONID(5,10), - BND_ICON_NEXT_KEYFRAME = BND_ICONID(6,10), - BND_ICON_PLAY_AUDIO = BND_ICONID(7,10), - BND_ICON_PLAY_REVERSE = BND_ICONID(8,10), - BND_ICON_PREVIEW_RANGE = BND_ICONID(9,10), - BND_ICON_ACTION_TWEAK = BND_ICONID(10,10), - BND_ICON_PMARKER_ACT = BND_ICONID(11,10), - BND_ICON_PMARKER_SEL = BND_ICONID(12,10), - BND_ICON_PMARKER = BND_ICONID(13,10), - BND_ICON_MARKER_HLT = BND_ICONID(14,10), - BND_ICON_MARKER = BND_ICONID(15,10), - BND_ICON_SPACE2 = BND_ICONID(16,10), - BND_ICON_SPACE3 = BND_ICONID(17,10), - BND_ICON_KEYINGSET = BND_ICONID(18,10), - BND_ICON_KEY_DEHLT = BND_ICONID(19,10), - BND_ICON_KEY_HLT = BND_ICONID(20,10), - BND_ICON_MUTE_IPO_OFF = BND_ICONID(21,10), - BND_ICON_MUTE_IPO_ON = BND_ICONID(22,10), - BND_ICON_VISIBLE_IPO_OFF = BND_ICONID(23,10), - BND_ICON_VISIBLE_IPO_ON = BND_ICONID(24,10), - BND_ICON_DRIVER = BND_ICONID(25,10), - - BND_ICON_SOLO_OFF = BND_ICONID(0,9), - BND_ICON_SOLO_ON = BND_ICONID(1,9), - BND_ICON_FRAME_PREV = BND_ICONID(2,9), - BND_ICON_FRAME_NEXT = BND_ICONID(3,9), - BND_ICON_NLA_PUSHDOWN = BND_ICONID(4,9), - BND_ICON_IPO_CONSTANT = BND_ICONID(5,9), - BND_ICON_IPO_LINEAR = BND_ICONID(6,9), - BND_ICON_IPO_BEZIER = BND_ICONID(7,9), - BND_ICON_IPO_SINE = BND_ICONID(8,9), - BND_ICON_IPO_QUAD = BND_ICONID(9,9), - BND_ICON_IPO_CUBIC = BND_ICONID(10,9), - BND_ICON_IPO_QUART = BND_ICONID(11,9), - BND_ICON_IPO_QUINT = BND_ICONID(12,9), - BND_ICON_IPO_EXPO = BND_ICONID(13,9), - BND_ICON_IPO_CIRC = BND_ICONID(14,9), - BND_ICON_IPO_BOUNCE = BND_ICONID(15,9), - BND_ICON_IPO_ELASTIC = BND_ICONID(16,9), - BND_ICON_IPO_BACK = BND_ICONID(17,9), - BND_ICON_IPO_EASE_IN = BND_ICONID(18,9), - BND_ICON_IPO_EASE_OUT = BND_ICONID(19,9), - BND_ICON_IPO_EASE_IN_OUT = BND_ICONID(20,9), - - BND_ICON_VERTEXSEL = BND_ICONID(0,8), - BND_ICON_EDGESEL = BND_ICONID(1,8), - BND_ICON_FACESEL = BND_ICONID(2,8), - BND_ICON_LOOPSEL = BND_ICONID(3,8), - BND_ICON_ROTATE = BND_ICONID(5,8), - BND_ICON_CURSOR = BND_ICONID(6,8), - BND_ICON_ROTATECOLLECTION = BND_ICONID(7,8), - BND_ICON_ROTATECENTER = BND_ICONID(8,8), - BND_ICON_ROTACTIVE = BND_ICONID(9,8), - BND_ICON_ALIGN = BND_ICONID(10,8), - BND_ICON_SMOOTHCURVE = BND_ICONID(12,8), - BND_ICON_SPHERECURVE = BND_ICONID(13,8), - BND_ICON_ROOTCURVE = BND_ICONID(14,8), - BND_ICON_SHARPCURVE = BND_ICONID(15,8), - BND_ICON_LINCURVE = BND_ICONID(16,8), - BND_ICON_NOCURVE = BND_ICONID(17,8), - BND_ICON_RNDCURVE = BND_ICONID(18,8), - BND_ICON_PROP_OFF = BND_ICONID(19,8), - BND_ICON_PROP_ON = BND_ICONID(20,8), - BND_ICON_PROP_CON = BND_ICONID(21,8), - BND_ICON_SCULPT_DYNTOPO = BND_ICONID(22,8), - BND_ICON_PARTICLE_POINT = BND_ICONID(23,8), - BND_ICON_PARTICLE_TIP = BND_ICONID(24,8), - BND_ICON_PARTICLE_PATH = BND_ICONID(25,8), - - BND_ICON_MAN_TRANS = BND_ICONID(0,7), - BND_ICON_MAN_ROT = BND_ICONID(1,7), - BND_ICON_MAN_SCALE = BND_ICONID(2,7), - BND_ICON_MANIPUL = BND_ICONID(3,7), - BND_ICON_SNAP_OFF = BND_ICONID(4,7), - BND_ICON_SNAP_ON = BND_ICONID(5,7), - BND_ICON_SNAP_NORMAL = BND_ICONID(6,7), - BND_ICON_SNAP_INCREMENT = BND_ICONID(7,7), - BND_ICON_SNAP_VERTEX = BND_ICONID(8,7), - BND_ICON_SNAP_EDGE = BND_ICONID(9,7), - BND_ICON_SNAP_FACE = BND_ICONID(10,7), - BND_ICON_SNAP_VOLUME = BND_ICONID(11,7), - BND_ICON_STICKY_UVS_LOC = BND_ICONID(13,7), - BND_ICON_STICKY_UVS_DISABLE = BND_ICONID(14,7), - BND_ICON_STICKY_UVS_VERT = BND_ICONID(15,7), - BND_ICON_CLIPUV_DEHLT = BND_ICONID(16,7), - BND_ICON_CLIPUV_HLT = BND_ICONID(17,7), - BND_ICON_SNAP_PEEL_OBJECT = BND_ICONID(18,7), - BND_ICON_GRID = BND_ICONID(19,7), - - BND_ICON_PASTEDOWN = BND_ICONID(0,6), - BND_ICON_COPYDOWN = BND_ICONID(1,6), - BND_ICON_PASTEFLIPUP = BND_ICONID(2,6), - BND_ICON_PASTEFLIPDOWN = BND_ICONID(3,6), - BND_ICON_SNAP_SURFACE = BND_ICONID(8,6), - BND_ICON_AUTOMERGE_ON = BND_ICONID(9,6), - BND_ICON_AUTOMERGE_OFF = BND_ICONID(10,6), - BND_ICON_RETOPO = BND_ICONID(11,6), - BND_ICON_UV_VERTEXSEL = BND_ICONID(12,6), - BND_ICON_UV_EDGESEL = BND_ICONID(13,6), - BND_ICON_UV_FACESEL = BND_ICONID(14,6), - BND_ICON_UV_ISLANDSEL = BND_ICONID(15,6), - BND_ICON_UV_SYNC_SELECT = BND_ICONID(16,6), - - BND_ICON_BBOX = BND_ICONID(0,5), - BND_ICON_WIRE = BND_ICONID(1,5), - BND_ICON_SOLID = BND_ICONID(2,5), - BND_ICON_SMOOTH = BND_ICONID(3,5), - BND_ICON_POTATO = BND_ICONID(4,5), - BND_ICON_ORTHO = BND_ICONID(6,5), - BND_ICON_LOCKVIEW_OFF = BND_ICONID(9,5), - BND_ICON_LOCKVIEW_ON = BND_ICONID(10,5), - BND_ICON_AXIS_SIDE = BND_ICONID(12,5), - BND_ICON_AXIS_FRONT = BND_ICONID(13,5), - BND_ICON_AXIS_TOP = BND_ICONID(14,5), - BND_ICON_NDOF_DOM = BND_ICONID(15,5), - BND_ICON_NDOF_TURN = BND_ICONID(16,5), - BND_ICON_NDOF_FLY = BND_ICONID(17,5), - BND_ICON_NDOF_TRANS = BND_ICONID(18,5), - BND_ICON_LAYER_USED = BND_ICONID(19,5), - BND_ICON_LAYER_ACTIVE = BND_ICONID(20,5), - - BND_ICON_SORTALPHA = BND_ICONID(0,3), - BND_ICON_SORTBYEXT = BND_ICONID(1,3), - BND_ICON_SORTTIME = BND_ICONID(2,3), - BND_ICON_SORTSIZE = BND_ICONID(3,3), - BND_ICON_LONGDISPLAY = BND_ICONID(4,3), - BND_ICON_SHORTDISPLAY = BND_ICONID(5,3), - BND_ICON_GHOST = BND_ICONID(6,3), - BND_ICON_IMGDISPLAY = BND_ICONID(7,3), - BND_ICON_SAVE_AS = BND_ICONID(8,3), - BND_ICON_SAVE_COPY = BND_ICONID(9,3), - BND_ICON_BOOKMARKS = BND_ICONID(10,3), - BND_ICON_FONTPREVIEW = BND_ICONID(11,3), - BND_ICON_FILTER = BND_ICONID(12,3), - BND_ICON_NEWFOLDER = BND_ICONID(13,3), - BND_ICON_OPEN_RECENT = BND_ICONID(14,3), - BND_ICON_FILE_PARENT = BND_ICONID(15,3), - BND_ICON_FILE_REFRESH = BND_ICONID(16,3), - BND_ICON_FILE_FOLDER = BND_ICONID(17,3), - BND_ICON_FILE_BLANK = BND_ICONID(18,3), - BND_ICON_FILE_BLEND = BND_ICONID(19,3), - BND_ICON_FILE_IMAGE = BND_ICONID(20,3), - BND_ICON_FILE_MOVIE = BND_ICONID(21,3), - BND_ICON_FILE_SCRIPT = BND_ICONID(22,3), - BND_ICON_FILE_SOUND = BND_ICONID(23,3), - BND_ICON_FILE_FONT = BND_ICONID(24,3), - BND_ICON_FILE_TEXT = BND_ICONID(25,3), - - BND_ICON_RECOVER_AUTO = BND_ICONID(0,2), - BND_ICON_SAVE_PREFS = BND_ICONID(1,2), - BND_ICON_LINK_BLEND = BND_ICONID(2,2), - BND_ICON_APPEND_BLEND = BND_ICONID(3,2), - BND_ICON_IMPORT = BND_ICONID(4,2), - BND_ICON_EXPORT = BND_ICONID(5,2), - BND_ICON_EXTERNAL_DATA = BND_ICONID(6,2), - BND_ICON_LOAD_FACTORY = BND_ICONID(7,2), - BND_ICON_LOOP_BACK = BND_ICONID(13,2), - BND_ICON_LOOP_FORWARDS = BND_ICONID(14,2), - BND_ICON_BACK = BND_ICONID(15,2), - BND_ICON_FORWARD = BND_ICONID(16,2), - BND_ICON_FILE_BACKUP = BND_ICONID(24,2), - BND_ICON_DISK_DRIVE = BND_ICONID(25,2), - - BND_ICON_MATPLANE = BND_ICONID(0,1), - BND_ICON_MATSPHERE = BND_ICONID(1,1), - BND_ICON_MATCUBE = BND_ICONID(2,1), - BND_ICON_MONKEY = BND_ICONID(3,1), - BND_ICON_HAIR = BND_ICONID(4,1), - BND_ICON_ALIASED = BND_ICONID(5,1), - BND_ICON_ANTIALIASED = BND_ICONID(6,1), - BND_ICON_MAT_SPHERE_SKY = BND_ICONID(7,1), - BND_ICON_WORDWRAP_OFF = BND_ICONID(12,1), - BND_ICON_WORDWRAP_ON = BND_ICONID(13,1), - BND_ICON_SYNTAX_OFF = BND_ICONID(14,1), - BND_ICON_SYNTAX_ON = BND_ICONID(15,1), - BND_ICON_LINENUMBERS_OFF = BND_ICONID(16,1), - BND_ICON_LINENUMBERS_ON = BND_ICONID(17,1), - BND_ICON_SCRIPTPLUGINS = BND_ICONID(18,1), - - BND_ICON_SEQ_SEQUENCER = BND_ICONID(0,0), - BND_ICON_SEQ_PREVIEW = BND_ICONID(1,0), - BND_ICON_SEQ_LUMA_WAVEFORM = BND_ICONID(2,0), - BND_ICON_SEQ_CHROMA_SCOPE = BND_ICONID(3,0), - BND_ICON_SEQ_HISTOGRAM = BND_ICONID(4,0), - BND_ICON_SEQ_SPLITVIEW = BND_ICONID(5,0), - BND_ICON_IMAGE_RGB = BND_ICONID(9,0), - BND_ICON_IMAGE_RGB_ALPHA = BND_ICONID(10,0), - BND_ICON_IMAGE_ALPHA = BND_ICONID(11,0), - BND_ICON_IMAGE_ZDEPTH = BND_ICONID(12,0), - BND_ICON_IMAGEFILE = BND_ICONID(13,0), -} BNDicon; - -//////////////////////////////////////////////////////////////////////////////// - -// set the current theme all widgets will be drawn with. -// the default Blender 2.6 theme is set by default. -BND_EXPORT void bndSetTheme(BNDtheme theme); - -// Returns the currently set theme -BND_EXPORT const BNDtheme *bndGetTheme(); - -// designates an image handle as returned by nvgCreateImage*() as the themes' -// icon sheet. The icon sheet format must be compatible to Blender 2.6's icon -// sheet; the order of icons does not matter. -// A valid icon sheet is e.g. shown at -// http://wiki.blender.org/index.php/Dev:2.5/Doc/How_to/Add_an_icon -BND_EXPORT void bndSetIconImage(int image); - -// designates an image handle as returned by nvgCreateFont*() as the themes' -// UI font. Blender's original UI font Droid Sans is perfectly suited and -// available here: -// https://svn.blender.org/svnroot/bf-blender/trunk/blender/release/datafiles/fonts/ -BND_EXPORT void bndSetFont(int font); - -//////////////////////////////////////////////////////////////////////////////// - -// High Level Functions -// -------------------- -// Use these functions to draw themed widgets with your NVGcontext. - -// Draw a label with its lower left origin at (x,y) and size of (w,h). -// if iconid >= 0, an icon will be added to the widget -// if label is not NULL, a label will be added to the widget -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndLabel(NVGcontext *ctx, - float x, float y, float w, float h, int iconid, const char *label); - -// Draw a tool button with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags and state denotes -// the widgets current UI state. -// if iconid >= 0, an icon will be added to the widget -// if label is not NULL, a label will be added to the widget -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndToolButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - int iconid, const char *label); - -// Draw a radio button with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags and state denotes -// the widgets current UI state. -// if iconid >= 0, an icon will be added to the widget -// if label is not NULL, a label will be added to the widget -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndRadioButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - int iconid, const char *label); - - -// Calculate the corresponding text position for given coordinates px/py -// in a text field. -// See bndTextField for more info. -BND_EXPORT int bndTextFieldTextPosition(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, const char *text, int px, int py); - -// Draw a text field with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags and state denotes -// the widgets current UI state. -// if iconid >= 0, an icon will be added to the widget -// if text is not NULL, text will be printed to the widget -// cbegin must be >= 0 and <= strlen(text) and denotes the beginning of the caret -// cend must be >= cbegin and <= strlen(text) and denotes the end of the caret -// if cend < cbegin, then no caret will be drawn -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndTextField(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - int iconid, const char *text, int cbegin, int cend); - -// Draw an option button with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags and state denotes -// the widgets current UI state. -// if label is not NULL, a label will be added to the widget -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndOptionButton(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, - const char *label); - -// Draw a choice button with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags and state denotes -// the widgets current UI state. -// if iconid >= 0, an icon will be added to the widget -// if label is not NULL, a label will be added to the widget -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndChoiceButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - int iconid, const char *label); - -// Draw a color button with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags and state denotes -// the widgets current UI state. -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndColorButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, NVGcolor color); - -// Draw a number field with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags and state denotes -// the widgets current UI state. -// if label is not NULL, a label will be added to the widget -// if value is not NULL, a value will be added to the widget, along with -// a ":" separator -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndNumberField(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - const char *label, const char *value); - -// Draw slider control with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags and state denotes -// the widgets current UI state. -// progress must be in the range 0..1 and controls the size of the slider bar -// if label is not NULL, a label will be added to the widget -// if value is not NULL, a value will be added to the widget, along with -// a ":" separator -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndSlider(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - float progress, const char *label, const char *value); - -// Draw scrollbar with its lower left origin at (x,y) and size of (w,h), -// where state denotes the widgets current UI state. -// offset is in the range 0..1 and controls the position of the scroll handle -// size is in the range 0..1 and controls the size of the scroll handle -// horizontal widget looks best when height is BND_SCROLLBAR_HEIGHT, -// vertical looks best when width is BND_SCROLLBAR_WIDTH -BND_EXPORT void bndScrollBar(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, - float offset, float size); - -// Draw a menu background with its lower left origin at (x,y) and size of (w,h), -// where flags is one or multiple flags from BNDcornerFlags. -BND_EXPORT void bndMenuBackground(NVGcontext *ctx, - float x, float y, float w, float h, int flags); - -// Draw a menu label with its lower left origin at (x,y) and size of (w,h). -// if iconid >= 0, an icon will be added to the widget -// if label is not NULL, a label will be added to the widget -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndMenuLabel(NVGcontext *ctx, - float x, float y, float w, float h, int iconid, const char *label); - -// Draw a menu item with its lower left origin at (x,y) and size of (w,h), -// where state denotes the widgets current UI state. -// if iconid >= 0, an icon will be added to the widget -// if label is not NULL, a label will be added to the widget -// widget looks best when height is BND_WIDGET_HEIGHT -BND_EXPORT void bndMenuItem(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, - int iconid, const char *label); - -// Draw a tooltip background with its lower left origin at (x,y) and size of (w,h) -BND_EXPORT void bndTooltipBackground(NVGcontext *ctx, float x, float y, float w, float h); - -// Draw a node port at the given position filled with the given color -BND_EXPORT void bndNodePort(NVGcontext *ctx, float x, float y, BNDwidgetState state, - NVGcolor color); - -// Draw a node wire originating at (x0,y0) and floating to (x1,y1), with -// a colored gradient based on the states state0 and state1: -// BND_DEFAULT: default wire color -// BND_HOVER: selected wire color -// BND_ACTIVE: dragged wire color -BND_EXPORT void bndNodeWire(NVGcontext *ctx, float x0, float y0, float x1, float y1, - BNDwidgetState state0, BNDwidgetState state1); - -// Draw a node wire originating at (x0,y0) and floating to (x1,y1), with -// a colored gradient based on the two colors color0 and color1 -BND_EXPORT void bndColoredNodeWire(NVGcontext *ctx, float x0, float y0, float x1, float y1, - NVGcolor color0, NVGcolor color1); - -// Draw a node background with its upper left origin at (x,y) and size of (w,h) -// where titleColor provides the base color for the title bar -BND_EXPORT void bndNodeBackground(NVGcontext *ctx, float x, float y, float w, float h, - BNDwidgetState state, int iconid, const char *label, NVGcolor titleColor); - -// Draw a window with the upper right and lower left splitter widgets into -// the rectangle at origin (x,y) and size (w, h) -BND_EXPORT void bndSplitterWidgets(NVGcontext *ctx, float x, float y, float w, float h); - -// Draw the join area overlay stencil into the rectangle -// at origin (x,y) and size (w,h) -// vertical is 0 or 1 and designates the arrow orientation, -// mirror is 0 or 1 and flips the arrow side -BND_EXPORT void bndJoinAreaOverlay(NVGcontext *ctx, float x, float y, float w, float h, - int vertical, int mirror); - -//////////////////////////////////////////////////////////////////////////////// - -// Estimator Functions -// ------------------- -// Use these functions to estimate sizes for widgets with your NVGcontext. - -// returns the ideal width for a label with given icon and text -BND_EXPORT float bndLabelWidth(NVGcontext *ctx, int iconid, const char *label); - -// returns the height for a label with given icon, text and width; this -// function is primarily useful in conjunction with multiline labels and textboxes -BND_EXPORT float bndLabelHeight(NVGcontext *ctx, int iconid, const char *label, - float width); - -//////////////////////////////////////////////////////////////////////////////// - -// Low Level Functions -// ------------------- -// these are part of the implementation detail and can be used to theme -// new kinds of controls in a similar fashion. - -// make color transparent using the default alpha value -BND_EXPORT NVGcolor bndTransparent(NVGcolor color); - -// offset a color by a given integer delta in the range -100 to 100 -BND_EXPORT NVGcolor bndOffsetColor(NVGcolor color, int delta); - -// assigns radius r to the four entries of array radiuses depending on whether -// the corner is marked as sharp or not; see BNDcornerFlags for possible -// flag values. -BND_EXPORT void bndSelectCorners(float *radiuses, float r, int flags); - -// computes the upper and lower gradient colors for the inner box from a widget -// theme and the widgets state. If flipActive is set and the state is -// BND_ACTIVE, the upper and lower colors will be swapped. -BND_EXPORT void bndInnerColors(NVGcolor *shade_top, NVGcolor *shade_down, - const BNDwidgetTheme *theme, BNDwidgetState state, int flipActive); - -// computes the text color for a widget label from a widget theme and the -// widgets state. -BND_EXPORT NVGcolor bndTextColor(const BNDwidgetTheme *theme, BNDwidgetState state); - -// computes the bounds of the scrollbar handle from the scrollbar size -// and the handles offset and size. -// offset is in the range 0..1 and defines the position of the scroll handle -// size is in the range 0..1 and defines the size of the scroll handle -BND_EXPORT void bndScrollHandleRect(float *x, float *y, float *w, float *h, - float offset, float size); - -// Add a rounded box path at position (x,y) with size (w,h) and a separate -// radius for each corner listed in clockwise order, so that cr0 = top left, -// cr1 = top right, cr2 = bottom right, cr3 = bottom left; -// this is a low level drawing function: the path must be stroked or filled -// to become visible. -BND_EXPORT void bndRoundedBox(NVGcontext *ctx, float x, float y, float w, float h, - float cr0, float cr1, float cr2, float cr3); - -// Draw a flat panel without any decorations at position (x,y) with size (w,h) -// and fills it with backgroundColor -BND_EXPORT void bndBackground(NVGcontext *ctx, float x, float y, float w, float h); - -// Draw a beveled border at position (x,y) with size (w,h) shaded with -// lighter and darker versions of backgroundColor -BND_EXPORT void bndBevel(NVGcontext *ctx, float x, float y, float w, float h); - -// Draw a lower inset for a rounded box at position (x,y) with size (w,h) -// that gives the impression the surface has been pushed in. -// cr2 and cr3 contain the radiuses of the bottom right and bottom left -// corners of the rounded box. -BND_EXPORT void bndBevelInset(NVGcontext *ctx, float x, float y, float w, float h, - float cr2, float cr3); - -// Draw an icon with (x,y) as its upper left coordinate; the iconid selects -// the icon from the sheet; use the BND_ICONID macro to build icon IDs. -BND_EXPORT void bndIcon(NVGcontext *ctx, float x, float y, int iconid); - -// Draw a drop shadow around the rounded box at (x,y) with size (w,h) and -// radius r, with feather as its maximum range in pixels. -// No shadow will be painted inside the rounded box. -BND_EXPORT void bndDropShadow(NVGcontext *ctx, float x, float y, float w, float h, - float r, float feather, float alpha); - -// Draw the inner part of a widget box, with a gradient from shade_top to -// shade_down. If h>w, the gradient will be horizontal instead of -// vertical. -BND_EXPORT void bndInnerBox(NVGcontext *ctx, float x, float y, float w, float h, - float cr0, float cr1, float cr2, float cr3, - NVGcolor shade_top, NVGcolor shade_down); - -// Draw the outline part of a widget box with the given color -BND_EXPORT void bndOutlineBox(NVGcontext *ctx, float x, float y, float w, float h, - float cr0, float cr1, float cr2, float cr3, NVGcolor color); - -// Draw an optional icon specified by and an optional label with -// given alignment (BNDtextAlignment), fontsize and color within a widget box. -// if iconid is >= 0, an icon will be drawn and the labels remaining space -// will be adjusted. -// if label is not NULL, it will be drawn with the specified alignment, fontsize -// and color. -// if value is not NULL, label and value will be drawn with a ":" separator -// inbetween. -BND_EXPORT void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, int align, float fontsize, const char *label, - const char *value); - -// Draw an optional icon specified by and an optional label with -// given alignment (BNDtextAlignment), fontsize and color within a node title bar -// if iconid is >= 0, an icon will be drawn -// if label is not NULL, it will be drawn with the specified alignment, fontsize -// and color. -BND_EXPORT void bndNodeIconLabel(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, NVGcolor shadowColor, int align, - float fontsize, const char *label); - -// Calculate the corresponding text position for given coordinates px/py -// in an iconLabel. -// See bndIconLabelCaret for more info. -BND_EXPORT int bndIconLabelTextPosition(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, float fontsize, const char *label, int px, int py); - -// Draw an optional icon specified by , an optional label and -// a caret with given fontsize and color within a widget box. -// if iconid is >= 0, an icon will be drawn and the labels remaining space -// will be adjusted. -// if label is not NULL, it will be drawn with the specified alignment, fontsize -// and color. -// cbegin must be >= 0 and <= strlen(text) and denotes the beginning of the caret -// cend must be >= cbegin and <= strlen(text) and denotes the end of the caret -// if cend < cbegin, then no caret will be drawn -BND_EXPORT void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, float fontsize, const char *label, - NVGcolor caretcolor, int cbegin, int cend); - -// Draw a checkmark for an option box with the given upper left coordinates -// (ox,oy) with the specified color. -BND_EXPORT void bndCheck(NVGcontext *ctx, float ox, float oy, NVGcolor color); - -// Draw a horizontal arrow for a number field with its center at (x,y) and -// size s; if s is negative, the arrow points to the left. -BND_EXPORT void bndArrow(NVGcontext *ctx, float x, float y, float s, NVGcolor color); - -// Draw an up/down arrow for a choice box with its center at (x,y) and size s -BND_EXPORT void bndUpDownArrow(NVGcontext *ctx, float x, float y, float s, NVGcolor color); - -// Draw a node down-arrow with its tip at (x,y) and size s -BND_EXPORT void bndNodeArrowDown(NVGcontext *ctx, float x, float y, float s, NVGcolor color); - -// return the color of a node wire based on state -// BND_HOVER indicates selected state, -// BND_ACTIVE indicates dragged state -BND_EXPORT NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState state); - -#ifdef __cplusplus -}; -#endif - -#endif // BLENDISH_H - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - -#ifdef BLENDISH_IMPLEMENTATION - -#include -#include - -#ifdef _MSC_VER - #pragma warning (disable: 4996) // Switch off security warnings - #pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings - #pragma warning (disable: 4244) - #pragma warning (disable: 4305) - #ifdef __cplusplus - #define BND_INLINE inline - #else - #define BND_INLINE - #endif - -#include - -static float bnd_fminf ( float a, float b ) -{ - return _isnan(a) ? b : ( _isnan(b) ? a : ((a < b) ? a : b)); -} - -static float bnd_fmaxf ( float a, float b ) -{ - return _isnan(a) ? b : ( _isnan(b) ? a : ((a > b) ? a : b)); -} - -static double bnd_fmin ( double a, double b ) -{ - return _isnan(a) ? b : ( _isnan(b) ? a : ((a < b) ? a : b)); -} - -static double bnd_fmax ( double a, double b ) -{ - return _isnan(a) ? b : ( _isnan(b) ? a : ((a > b) ? a : b)); -} - -#else - #define BND_INLINE inline - #define bnd_fminf(a, b) fminf(a, b) - #define bnd_fmaxf(a, b) fmaxf(a, b) - #define bnd_fmin(a, b) fmin(a, b) - #define bnd_fmax(a, b) fmax(a, b) -#endif - -//////////////////////////////////////////////////////////////////////////////// - -// default text size -#define BND_LABEL_FONT_SIZE 13 - -// default text padding in inner box -#define BND_PAD_LEFT 8 -#define BND_PAD_RIGHT 8 - -// label: value separator string -#define BND_LABEL_SEPARATOR ": " - -// alpha intensity of transparent items (0xa4) -#define BND_TRANSPARENT_ALPHA 0.643 - -// shade intensity of beveled panels -#define BND_BEVEL_SHADE 30 -// shade intensity of beveled insets -#define BND_INSET_BEVEL_SHADE 30 -// shade intensity of hovered inner boxes -#define BND_HOVER_SHADE 15 -// shade intensity of splitter bevels -#define BND_SPLITTER_SHADE 100 - -// width of icon sheet -#define BND_ICON_SHEET_WIDTH 602 -// height of icon sheet -#define BND_ICON_SHEET_HEIGHT 640 -// gridsize of icon sheet in both dimensions -#define BND_ICON_SHEET_GRID 21 -// offset of first icon tile relative to left border -#define BND_ICON_SHEET_OFFSET_X 5 -// offset of first icon tile relative to top border -#define BND_ICON_SHEET_OFFSET_Y 10 -// resolution of single icon -#define BND_ICON_SHEET_RES 16 - -// size of number field arrow -#define BND_NUMBER_ARROW_SIZE 4 - -// default text color -#define BND_COLOR_TEXT {{{ 0,0,0,1 }}} -// default highlighted text color -#define BND_COLOR_TEXT_SELECTED {{{ 1,1,1,1 }}} - -// radius of tool button -#define BND_TOOL_RADIUS 4 - -// radius of option button -#define BND_OPTION_RADIUS 4 -// width of option button checkbox -#define BND_OPTION_WIDTH 14 -// height of option button checkbox -#define BND_OPTION_HEIGHT 15 - -// radius of text field -#define BND_TEXT_RADIUS 4 - -// radius of number button -#define BND_NUMBER_RADIUS 10 - -// radius of menu popup -#define BND_MENU_RADIUS 3 -// feather of menu popup shadow -#define BND_SHADOW_FEATHER 12 -// alpha of menu popup shadow -#define BND_SHADOW_ALPHA 0.5 - -// radius of scrollbar -#define BND_SCROLLBAR_RADIUS 7 -// shade intensity of active scrollbar -#define BND_SCROLLBAR_ACTIVE_SHADE 15 - -// max glyphs for position testing -#define BND_MAX_GLYPHS 1024 - -// max rows for position testing -#define BND_MAX_ROWS 32 - -// text distance from bottom -#define BND_TEXT_PAD_DOWN 7 - -// stroke width of wire outline -#define BND_NODE_WIRE_OUTLINE_WIDTH 4 -// stroke width of wire -#define BND_NODE_WIRE_WIDTH 2 -// radius of node box -#define BND_NODE_RADIUS 8 -// feather of node title text -#define BND_NODE_TITLE_FEATHER 1 -// size of node title arrow -#define BND_NODE_ARROW_SIZE 9 - -//////////////////////////////////////////////////////////////////////////////// - -BND_INLINE float bnd_clamp(float v, float mn, float mx) { - return (v > mx)?mx:(v < mn)?mn:v; -} - -//////////////////////////////////////////////////////////////////////////////// - -// the initial theme -static BNDtheme bnd_theme = { - // backgroundColor - {{{ 0.447, 0.447, 0.447, 1.0 }}}, - // regularTheme - { - {{{ 0.098,0.098,0.098,1 }}}, // color_outline - {{{ 0.098,0.098,0.098,1 }}}, // color_item - {{{ 0.6,0.6,0.6,1 }}}, // color_inner - {{{ 0.392,0.392,0.392,1 }}}, // color_inner_selected - BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - 0, // shade_top - 0, // shade_down - }, - // toolTheme - { - {{{ 0.098,0.098,0.098,1 }}}, // color_outline - {{{ 0.098,0.098,0.098,1 }}}, // color_item - {{{ 0.6,0.6,0.6,1 }}}, // color_inner - {{{ 0.392,0.392,0.392,1 }}}, // color_inner_selected - BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - 15, // shade_top - -15, // shade_down - }, - // radioTheme - { - {{{ 0,0,0,1 }}}, // color_outline - {{{ 1,1,1,1 }}}, // color_item - {{{ 0.275,0.275,0.275,1 }}}, // color_inner - {{{ 0.337,0.502,0.761,1 }}}, // color_inner_selected - BND_COLOR_TEXT_SELECTED, // color_text - BND_COLOR_TEXT, // color_text_selected - 15, // shade_top - -15, // shade_down - }, - // textFieldTheme - { - {{{ 0.098,0.098,0.098,1 }}}, // color_outline - {{{ 0.353, 0.353, 0.353,1 }}}, // color_item - {{{ 0.6, 0.6, 0.6,1 }}}, // color_inner - {{{ 0.6, 0.6, 0.6,1 }}}, // color_inner_selected - BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - 0, // shade_top - 25, // shade_down - }, - // optionTheme - { - {{{ 0,0,0,1 }}}, // color_outline - {{{ 1,1,1,1 }}}, // color_item - {{{ 0.275,0.275,0.275,1 }}}, // color_inner - {{{ 0.275,0.275,0.275,1 }}}, // color_inner_selected - BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - 15, // shade_top - -15, // shade_down - }, - // choiceTheme - { - {{{ 0,0,0,1 }}}, // color_outline - {{{ 1,1,1,1 }}}, // color_item - {{{ 0.275,0.275,0.275,1 }}}, // color_inner - {{{ 0.275,0.275,0.275,1 }}}, // color_inner_selected - BND_COLOR_TEXT_SELECTED, // color_text - {{{ 0.8,0.8,0.8,1 }}}, // color_text_selected - 15, // shade_top - -15, // shade_down - }, - // numberFieldTheme - { - {{{ 0.098,0.098,0.098,1 }}}, // color_outline - {{{ 0.353, 0.353, 0.353,1 }}}, // color_item - {{{ 0.706, 0.706, 0.706,1 }}}, // color_inner - {{{ 0.6, 0.6, 0.6,1 }}}, // color_inner_selected - BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - -20, // shade_top - 0, // shade_down - }, - // sliderTheme - { - {{{ 0.098,0.098,0.098,1 }}}, // color_outline - {{{ 0.502,0.502,0.502,1 }}}, // color_item - {{{ 0.706, 0.706, 0.706,1 }}}, // color_inner - {{{ 0.6, 0.6, 0.6,1 }}}, // color_inner_selected - BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - -20, // shade_top - 0, // shade_down - }, - // scrollBarTheme - { - {{{ 0.196,0.196,0.196,1 }}}, // color_outline - {{{ 0.502,0.502,0.502,1 }}}, // color_item - {{{ 0.314, 0.314, 0.314,0.706 }}}, // color_inner - {{{ 0.392, 0.392, 0.392,0.706 }}}, // color_inner_selected - BND_COLOR_TEXT, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - 5, // shade_top - -5, // shade_down - }, - // tooltipTheme - { - {{{ 0,0,0,1 }}}, // color_outline - {{{ 0.392,0.392,0.392,1 }}}, // color_item - {{{ 0.098, 0.098, 0.098, 0.902 }}}, // color_inner - {{{ 0.176, 0.176, 0.176, 0.902 }}}, // color_inner_selected - {{{ 0.627, 0.627, 0.627, 1 }}}, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - 0, // shade_top - 0, // shade_down - }, - // menuTheme - { - {{{ 0,0,0,1 }}}, // color_outline - {{{ 0.392,0.392,0.392,1 }}}, // color_item - {{{ 0.098, 0.098, 0.098, 0.902 }}}, // color_inner - {{{ 0.176, 0.176, 0.176, 0.902 }}}, // color_inner_selected - {{{ 0.627, 0.627, 0.627, 1 }}}, // color_text - BND_COLOR_TEXT_SELECTED, // color_text_selected - 0, // shade_top - 0, // shade_down - }, - // menuItemTheme - { - {{{ 0,0,0,1 }}}, // color_outline - {{{ 0.675,0.675,0.675,0.502 }}}, // color_item - {{{ 0,0,0,0 }}}, // color_inner - {{{ 0.337,0.502,0.761,1 }}}, // color_inner_selected - BND_COLOR_TEXT_SELECTED, // color_text - BND_COLOR_TEXT, // color_text_selected - 38, // shade_top - 0, // shade_down - }, - // nodeTheme - { - {{{ 0.945,0.345,0,1 }}}, // nodeSelectedColor - {{{ 0,0,0,1 }}}, // wiresColor - {{{ 0.498,0.439,0.439,1 }}}, // textSelectedColor - {{{ 1,0.667,0.251,1 }}}, // activeNodeColor - {{{ 1,1,1,1 }}}, // wireSelectColor - {{{ 0.608,0.608,0.608,0.627 }}}, // nodeBackdropColor - 5, // noodleCurving - }, -}; - -//////////////////////////////////////////////////////////////////////////////// - -void bndSetTheme(BNDtheme theme) { - bnd_theme = theme; -} - -const BNDtheme *bndGetTheme() { - return &bnd_theme; -} - -// the handle to the image containing the icon sheet -static int bnd_icon_image = -1; - -void bndSetIconImage(int image) { - bnd_icon_image = image; -} - -// the handle to the UI font -static int bnd_font = -1; - -void bndSetFont(int font) { - bnd_font = font; -} - -//////////////////////////////////////////////////////////////////////////////// - -void bndLabel(NVGcontext *ctx, - float x, float y, float w, float h, int iconid, const char *label) { - bndIconLabelValue(ctx,x,y,w,h,iconid, - bnd_theme.regularTheme.textColor, BND_LEFT, - BND_LABEL_FONT_SIZE, label, NULL); -} - -void bndToolButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - int iconid, const char *label) { - float cr[4]; - NVGcolor shade_top, shade_down; - - bndSelectCorners(cr, BND_TOOL_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); - bndInnerColors(&shade_top, &shade_down, &bnd_theme.toolTheme, state, 1); - bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); - bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], - bndTransparent(bnd_theme.toolTheme.outlineColor)); - bndIconLabelValue(ctx,x,y,w,h,iconid, - bndTextColor(&bnd_theme.toolTheme, state), BND_CENTER, - BND_LABEL_FONT_SIZE, label, NULL); -} - -void bndRadioButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - int iconid, const char *label) { - float cr[4]; - NVGcolor shade_top, shade_down; - - bndSelectCorners(cr, BND_OPTION_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); - bndInnerColors(&shade_top, &shade_down, &bnd_theme.radioTheme, state, 1); - bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); - bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], - bndTransparent(bnd_theme.radioTheme.outlineColor)); - bndIconLabelValue(ctx,x,y,w,h,iconid, - bndTextColor(&bnd_theme.radioTheme, state), BND_CENTER, - BND_LABEL_FONT_SIZE, label, NULL); -} - -int bndTextFieldTextPosition(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, const char *text, int px, int py) { - return bndIconLabelTextPosition(ctx, x, y, w, h, - iconid, BND_LABEL_FONT_SIZE, text, px, py); -} - -void bndTextField(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - int iconid, const char *text, int cbegin, int cend) { - float cr[4]; - NVGcolor shade_top, shade_down; - - bndSelectCorners(cr, BND_TEXT_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); - bndInnerColors(&shade_top, &shade_down, &bnd_theme.textFieldTheme, state, 0); - bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); - bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], - bndTransparent(bnd_theme.textFieldTheme.outlineColor)); - if (state != BND_ACTIVE) { - cend = -1; - } - bndIconLabelCaret(ctx,x,y,w,h,iconid, - bndTextColor(&bnd_theme.textFieldTheme, state), BND_LABEL_FONT_SIZE, - text, bnd_theme.textFieldTheme.itemColor, cbegin, cend); -} - -void bndOptionButton(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, - const char *label) { - float ox, oy; - NVGcolor shade_top, shade_down; - - ox = x; - oy = y+h-BND_OPTION_HEIGHT-3; - - bndBevelInset(ctx,ox,oy, - BND_OPTION_WIDTH,BND_OPTION_HEIGHT, - BND_OPTION_RADIUS,BND_OPTION_RADIUS); - bndInnerColors(&shade_top, &shade_down, &bnd_theme.optionTheme, state, 1); - bndInnerBox(ctx,ox,oy, - BND_OPTION_WIDTH,BND_OPTION_HEIGHT, - BND_OPTION_RADIUS,BND_OPTION_RADIUS,BND_OPTION_RADIUS,BND_OPTION_RADIUS, - shade_top, shade_down); - bndOutlineBox(ctx,ox,oy, - BND_OPTION_WIDTH,BND_OPTION_HEIGHT, - BND_OPTION_RADIUS,BND_OPTION_RADIUS,BND_OPTION_RADIUS,BND_OPTION_RADIUS, - bndTransparent(bnd_theme.optionTheme.outlineColor)); - if (state == BND_ACTIVE) { - bndCheck(ctx,ox,oy, bndTransparent(bnd_theme.optionTheme.itemColor)); - } - bndIconLabelValue(ctx,x+12,y,w-12,h,-1, - bndTextColor(&bnd_theme.optionTheme, state), BND_LEFT, - BND_LABEL_FONT_SIZE, label, NULL); -} - -void bndChoiceButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - int iconid, const char *label) { - float cr[4]; - NVGcolor shade_top, shade_down; - - bndSelectCorners(cr, BND_OPTION_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); - bndInnerColors(&shade_top, &shade_down, &bnd_theme.choiceTheme, state, 1); - bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); - bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], - bndTransparent(bnd_theme.choiceTheme.outlineColor)); - bndIconLabelValue(ctx,x,y,w,h,iconid, - bndTextColor(&bnd_theme.choiceTheme, state), BND_LEFT, - BND_LABEL_FONT_SIZE, label, NULL); - bndUpDownArrow(ctx,x+w-10,y+10,5, - bndTransparent(bnd_theme.choiceTheme.itemColor)); -} - -void bndColorButton(NVGcontext *ctx, - float x, float y, float w, float h, int flags, NVGcolor color) { - float cr[4]; - bndSelectCorners(cr, BND_TOOL_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); - bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], color, color); - bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], - bndTransparent(bnd_theme.toolTheme.outlineColor)); -} - -void bndNumberField(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - const char *label, const char *value) { - float cr[4]; - NVGcolor shade_top, shade_down; - - bndSelectCorners(cr, BND_NUMBER_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); - bndInnerColors(&shade_top, &shade_down, &bnd_theme.numberFieldTheme, state, 0); - bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); - bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], - bndTransparent(bnd_theme.numberFieldTheme.outlineColor)); - bndIconLabelValue(ctx,x,y,w,h,-1, - bndTextColor(&bnd_theme.numberFieldTheme, state), BND_CENTER, - BND_LABEL_FONT_SIZE, label, value); - bndArrow(ctx,x+8,y+10,-BND_NUMBER_ARROW_SIZE, - bndTransparent(bnd_theme.numberFieldTheme.itemColor)); - bndArrow(ctx,x+w-8,y+10,BND_NUMBER_ARROW_SIZE, - bndTransparent(bnd_theme.numberFieldTheme.itemColor)); -} - -void bndSlider(NVGcontext *ctx, - float x, float y, float w, float h, int flags, BNDwidgetState state, - float progress, const char *label, const char *value) { - float cr[4]; - NVGcolor shade_top, shade_down; - - bndSelectCorners(cr, BND_NUMBER_RADIUS, flags); - bndBevelInset(ctx,x,y,w,h,cr[2],cr[3]); - bndInnerColors(&shade_top, &shade_down, &bnd_theme.sliderTheme, state, 0); - bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); - - if (state == BND_ACTIVE) { - shade_top = bndOffsetColor( - bnd_theme.sliderTheme.itemColor, bnd_theme.sliderTheme.shadeTop); - shade_down = bndOffsetColor( - bnd_theme.sliderTheme.itemColor, bnd_theme.sliderTheme.shadeDown); - } else { - shade_top = bndOffsetColor( - bnd_theme.sliderTheme.itemColor, bnd_theme.sliderTheme.shadeDown); - shade_down = bndOffsetColor( - bnd_theme.sliderTheme.itemColor, bnd_theme.sliderTheme.shadeTop); - } - nvgScissor(ctx,x,y,8+(w-8)*bnd_clamp(progress,0,1),h); - bndInnerBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); - nvgResetScissor(ctx); - - bndOutlineBox(ctx,x,y,w,h,cr[0],cr[1],cr[2],cr[3], - bndTransparent(bnd_theme.sliderTheme.outlineColor)); - bndIconLabelValue(ctx,x,y,w,h,-1, - bndTextColor(&bnd_theme.sliderTheme, state), BND_CENTER, - BND_LABEL_FONT_SIZE, label, value); -} - -void bndScrollBar(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, - float offset, float size) { - - bndBevelInset(ctx,x,y,w,h, - BND_SCROLLBAR_RADIUS, BND_SCROLLBAR_RADIUS); - bndInnerBox(ctx,x,y,w,h, - BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, - BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, - bndOffsetColor( - bnd_theme.scrollBarTheme.innerColor, 3*bnd_theme.scrollBarTheme.shadeDown), - bndOffsetColor( - bnd_theme.scrollBarTheme.innerColor, 3*bnd_theme.scrollBarTheme.shadeTop)); - bndOutlineBox(ctx,x,y,w,h, - BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, - BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, - bndTransparent(bnd_theme.scrollBarTheme.outlineColor)); - - NVGcolor itemColor = bndOffsetColor( - bnd_theme.scrollBarTheme.itemColor, - (state == BND_ACTIVE)?BND_SCROLLBAR_ACTIVE_SHADE:0); - - bndScrollHandleRect(&x,&y,&w,&h,offset,size); - - bndInnerBox(ctx,x,y,w,h, - BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, - BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, - bndOffsetColor( - itemColor, 3*bnd_theme.scrollBarTheme.shadeTop), - bndOffsetColor( - itemColor, 3*bnd_theme.scrollBarTheme.shadeDown)); - bndOutlineBox(ctx,x,y,w,h, - BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, - BND_SCROLLBAR_RADIUS,BND_SCROLLBAR_RADIUS, - bndTransparent(bnd_theme.scrollBarTheme.outlineColor)); -} - -void bndMenuBackground(NVGcontext *ctx, - float x, float y, float w, float h, int flags) { - float cr[4]; - NVGcolor shade_top, shade_down; - - bndSelectCorners(cr, BND_MENU_RADIUS, flags); - bndInnerColors(&shade_top, &shade_down, &bnd_theme.menuTheme, - BND_DEFAULT, 0); - bndInnerBox(ctx,x,y,w,h+1,cr[0],cr[1],cr[2],cr[3], shade_top, shade_down); - bndOutlineBox(ctx,x,y,w,h+1,cr[0],cr[1],cr[2],cr[3], - bndTransparent(bnd_theme.menuTheme.outlineColor)); - bndDropShadow(ctx,x,y,w,h,BND_MENU_RADIUS, - BND_SHADOW_FEATHER,BND_SHADOW_ALPHA); -} - -void bndTooltipBackground(NVGcontext *ctx, float x, float y, float w, float h) { - NVGcolor shade_top, shade_down; - - bndInnerColors(&shade_top, &shade_down, &bnd_theme.tooltipTheme, - BND_DEFAULT, 0); - bndInnerBox(ctx,x,y,w,h+1, - BND_MENU_RADIUS,BND_MENU_RADIUS,BND_MENU_RADIUS,BND_MENU_RADIUS, - shade_top, shade_down); - bndOutlineBox(ctx,x,y,w,h+1, - BND_MENU_RADIUS,BND_MENU_RADIUS,BND_MENU_RADIUS,BND_MENU_RADIUS, - bndTransparent(bnd_theme.tooltipTheme.outlineColor)); - bndDropShadow(ctx,x,y,w,h,BND_MENU_RADIUS, - BND_SHADOW_FEATHER,BND_SHADOW_ALPHA); -} - -void bndMenuLabel(NVGcontext *ctx, - float x, float y, float w, float h, int iconid, const char *label) { - bndIconLabelValue(ctx,x,y,w,h,iconid, - bnd_theme.menuTheme.textColor, BND_LEFT, - BND_LABEL_FONT_SIZE, label, NULL); -} - -void bndMenuItem(NVGcontext *ctx, - float x, float y, float w, float h, BNDwidgetState state, - int iconid, const char *label) { - if (state != BND_DEFAULT) { - bndInnerBox(ctx,x,y,w,h,0,0,0,0, - bndOffsetColor(bnd_theme.menuItemTheme.innerSelectedColor, - bnd_theme.menuItemTheme.shadeTop), - bndOffsetColor(bnd_theme.menuItemTheme.innerSelectedColor, - bnd_theme.menuItemTheme.shadeDown)); - state = BND_ACTIVE; - } - bndIconLabelValue(ctx,x,y,w,h,iconid, - bndTextColor(&bnd_theme.menuItemTheme, state), BND_LEFT, - BND_LABEL_FONT_SIZE, label, NULL); -} - -void bndNodePort(NVGcontext *ctx, float x, float y, BNDwidgetState state, - NVGcolor color) { - nvgBeginPath(ctx); - nvgCircle(ctx, x, y, BND_NODE_PORT_RADIUS); - nvgStrokeColor(ctx,bnd_theme.nodeTheme.wiresColor); - nvgStrokeWidth(ctx,1.0f); - nvgStroke(ctx); - nvgFillColor(ctx,(state != BND_DEFAULT)? - bndOffsetColor(color, BND_HOVER_SHADE):color); - nvgFill(ctx); -} - -void bndColoredNodeWire(NVGcontext *ctx, float x0, float y0, float x1, float y1, - NVGcolor color0, NVGcolor color1) { - float length = bnd_fmaxf(fabsf(x1 - x0),fabsf(y1 - y0)); - float delta = length*(float)bnd_theme.nodeTheme.noodleCurving/10.0f; - - nvgBeginPath(ctx); - nvgMoveTo(ctx, x0, y0); - nvgBezierTo(ctx, - x0 + delta, y0, - x1 - delta, y1, - x1, y1); - NVGcolor colorw = bnd_theme.nodeTheme.wiresColor; - colorw.a = (color0.a= 0) { - w += BND_ICON_SHEET_RES; - } - if (label && (bnd_font >= 0)) { - nvgFontFaceId(ctx, bnd_font); - nvgFontSize(ctx, BND_LABEL_FONT_SIZE); - w += nvgTextBounds(ctx, 1, 1, label, NULL, NULL); - } - return w; -} - -float bndLabelHeight(NVGcontext *ctx, int iconid, const char *label, float width) { - int h = BND_WIDGET_HEIGHT; - width -= BND_TEXT_RADIUS*2; - if (iconid >= 0) { - width -= BND_ICON_SHEET_RES; - } - if (label && (bnd_font >= 0)) { - nvgFontFaceId(ctx, bnd_font); - nvgFontSize(ctx, BND_LABEL_FONT_SIZE); - float bounds[4]; - nvgTextBoxBounds(ctx, 1, 1, width, label, NULL, bounds); - int bh = (int)(bounds[3] - bounds[1]) + BND_TEXT_PAD_DOWN; - if (bh > h) - h = bh; - } - return h; -} - -//////////////////////////////////////////////////////////////////////////////// - -void bndRoundedBox(NVGcontext *ctx, float x, float y, float w, float h, - float cr0, float cr1, float cr2, float cr3) { - float d; - - w = bnd_fmaxf(0, w); - h = bnd_fmaxf(0, h); - d = bnd_fminf(w, h); - - nvgMoveTo(ctx, x,y+h*0.5f); - nvgArcTo(ctx, x,y, x+w,y, bnd_fminf(cr0, d/2)); - nvgArcTo(ctx, x+w,y, x+w,y+h, bnd_fminf(cr1, d/2)); - nvgArcTo(ctx, x+w,y+h, x,y+h, bnd_fminf(cr2, d/2)); - nvgArcTo(ctx, x,y+h, x,y, bnd_fminf(cr3, d/2)); - nvgClosePath(ctx); -} - -NVGcolor bndTransparent(NVGcolor color) { - color.a *= BND_TRANSPARENT_ALPHA; - return color; -} - -NVGcolor bndOffsetColor(NVGcolor color, int delta) { - float offset = (float)delta / 255.0f; - return delta?( - nvgRGBAf( - bnd_clamp(color.r+offset,0,1), - bnd_clamp(color.g+offset,0,1), - bnd_clamp(color.b+offset,0,1), - color.a) - ):color; -} - -void bndBevel(NVGcontext *ctx, float x, float y, float w, float h) { - nvgStrokeWidth(ctx, 1); - - x += 0.5f; - y += 0.5f; - w -= 1; - h -= 1; - - nvgBeginPath(ctx); - nvgMoveTo(ctx, x, y+h); - nvgLineTo(ctx, x+w, y+h); - nvgLineTo(ctx, x+w, y); - nvgStrokeColor(ctx, bndTransparent( - bndOffsetColor(bnd_theme.backgroundColor, -BND_BEVEL_SHADE))); - nvgStroke(ctx); - - nvgBeginPath(ctx); - nvgMoveTo(ctx, x, y+h); - nvgLineTo(ctx, x, y); - nvgLineTo(ctx, x+w, y); - nvgStrokeColor(ctx, bndTransparent( - bndOffsetColor(bnd_theme.backgroundColor, BND_BEVEL_SHADE))); - nvgStroke(ctx); -} - -void bndBevelInset(NVGcontext *ctx, float x, float y, float w, float h, - float cr2, float cr3) { - float d; - - y -= 0.5f; - d = bnd_fminf(w, h); - cr2 = bnd_fminf(cr2, d/2); - cr3 = bnd_fminf(cr3, d/2); - - nvgBeginPath(ctx); - nvgMoveTo(ctx, x+w,y+h-cr2); - nvgArcTo(ctx, x+w,y+h, x,y+h, cr2); - nvgArcTo(ctx, x,y+h, x,y, cr3); - - NVGcolor bevelColor = bndOffsetColor(bnd_theme.backgroundColor, - BND_INSET_BEVEL_SHADE); - - nvgStrokeWidth(ctx, 1); - nvgStrokePaint(ctx, - nvgLinearGradient(ctx, - x,y+h-bnd_fmaxf(cr2,cr3)-1, - x,y+h-1, - nvgRGBAf(bevelColor.r, bevelColor.g, bevelColor.b, 0), - bevelColor)); - nvgStroke(ctx); -} - -void bndBackground(NVGcontext *ctx, float x, float y, float w, float h) { - nvgBeginPath(ctx); - nvgRect(ctx, x, y, w, h); - nvgFillColor(ctx, bnd_theme.backgroundColor); - nvgFill(ctx); -} - -void bndIcon(NVGcontext *ctx, float x, float y, int iconid) { - int ix, iy, u, v; - if (bnd_icon_image < 0) return; // no icons loaded - - ix = iconid & 0xff; - iy = (iconid>>8) & 0xff; - u = BND_ICON_SHEET_OFFSET_X + ix*BND_ICON_SHEET_GRID; - v = BND_ICON_SHEET_OFFSET_Y + iy*BND_ICON_SHEET_GRID; - - nvgBeginPath(ctx); - nvgRect(ctx,x,y,BND_ICON_SHEET_RES,BND_ICON_SHEET_RES); - nvgFillPaint(ctx, - nvgImagePattern(ctx,x-u,y-v, - BND_ICON_SHEET_WIDTH, - BND_ICON_SHEET_HEIGHT, - 0,bnd_icon_image,1)); - nvgFill(ctx); -} - -void bndDropShadow(NVGcontext *ctx, float x, float y, float w, float h, - float r, float feather, float alpha) { - - nvgBeginPath(ctx); - y += feather; - h -= feather; - - nvgMoveTo(ctx, x-feather, y-feather); - nvgLineTo(ctx, x, y-feather); - nvgLineTo(ctx, x, y+h-feather); - nvgArcTo(ctx, x,y+h,x+r,y+h,r); - nvgArcTo(ctx, x+w,y+h,x+w,y+h-r,r); - nvgLineTo(ctx, x+w, y-feather); - nvgLineTo(ctx, x+w+feather, y-feather); - nvgLineTo(ctx, x+w+feather, y+h+feather); - nvgLineTo(ctx, x-feather, y+h+feather); - nvgClosePath(ctx); - - nvgFillPaint(ctx, nvgBoxGradient(ctx, - x - feather*0.5f,y - feather*0.5f, - w + feather,h+feather, - r+feather*0.5f, - feather, - nvgRGBAf(0,0,0,alpha*alpha), - nvgRGBAf(0,0,0,0))); - nvgFill(ctx); -} - -void bndInnerBox(NVGcontext *ctx, float x, float y, float w, float h, - float cr0, float cr1, float cr2, float cr3, - NVGcolor shade_top, NVGcolor shade_down) { - nvgBeginPath(ctx); - bndRoundedBox(ctx,x+1,y+1,w-2,h-3,bnd_fmaxf(0,cr0-1), - bnd_fmaxf(0,cr1-1),bnd_fmaxf(0,cr2-1),bnd_fmaxf(0,cr3-1)); - nvgFillPaint(ctx,((h-2)>w)? - nvgLinearGradient(ctx,x,y,x+w,y,shade_top,shade_down): - nvgLinearGradient(ctx,x,y,x,y+h,shade_top,shade_down)); - nvgFill(ctx); -} - -void bndOutlineBox(NVGcontext *ctx, float x, float y, float w, float h, - float cr0, float cr1, float cr2, float cr3, NVGcolor color) { - nvgBeginPath(ctx); - bndRoundedBox(ctx,x+0.5f,y+0.5f,w-1,h-2,cr0,cr1,cr2,cr3); - nvgStrokeColor(ctx,color); - nvgStrokeWidth(ctx,1); - nvgStroke(ctx); -} - -void bndSelectCorners(float *radiuses, float r, int flags) { - radiuses[0] = (flags & BND_CORNER_TOP_LEFT)?0:r; - radiuses[1] = (flags & BND_CORNER_TOP_RIGHT)?0:r; - radiuses[2] = (flags & BND_CORNER_DOWN_RIGHT)?0:r; - radiuses[3] = (flags & BND_CORNER_DOWN_LEFT)?0:r; -} - -void bndInnerColors( - NVGcolor *shade_top, NVGcolor *shade_down, - const BNDwidgetTheme *theme, BNDwidgetState state, int flipActive) { - - switch(state) { - default: - case BND_DEFAULT: { - *shade_top = bndOffsetColor(theme->innerColor, theme->shadeTop); - *shade_down = bndOffsetColor(theme->innerColor, theme->shadeDown); - } break; - case BND_HOVER: { - NVGcolor color = bndOffsetColor(theme->innerColor, BND_HOVER_SHADE); - *shade_top = bndOffsetColor(color, theme->shadeTop); - *shade_down = bndOffsetColor(color, theme->shadeDown); - } break; - case BND_ACTIVE: { - *shade_top = bndOffsetColor(theme->innerSelectedColor, - flipActive?theme->shadeDown:theme->shadeTop); - *shade_down = bndOffsetColor(theme->innerSelectedColor, - flipActive?theme->shadeTop:theme->shadeDown); - } break; - } -} - -NVGcolor bndTextColor(const BNDwidgetTheme *theme, BNDwidgetState state) { - return (state == BND_ACTIVE)?theme->textSelectedColor:theme->textColor; -} - -void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, int align, float fontsize, const char *label, - const char *value) { - float pleft = BND_PAD_LEFT; - if (label) { - if (iconid >= 0) { - bndIcon(ctx,x+4,y+2,iconid); - pleft += BND_ICON_SHEET_RES; - } - - if (bnd_font < 0) return; - nvgFontFaceId(ctx, bnd_font); - nvgFontSize(ctx, fontsize); - nvgBeginPath(ctx); - nvgFillColor(ctx, color); - if (value) { - float label_width = nvgTextBounds(ctx, 1, 1, label, NULL, NULL); - float sep_width = nvgTextBounds(ctx, 1, 1, - BND_LABEL_SEPARATOR, NULL, NULL); - - nvgTextAlign(ctx, NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE); - x += pleft; - if (align == BND_CENTER) { - float width = label_width + sep_width - + nvgTextBounds(ctx, 1, 1, value, NULL, NULL); - x += ((w-BND_PAD_RIGHT-pleft)-width)*0.5f; - } - y += BND_WIDGET_HEIGHT-BND_TEXT_PAD_DOWN; - nvgText(ctx, x, y, label, NULL); - x += label_width; - nvgText(ctx, x, y, BND_LABEL_SEPARATOR, NULL); - x += sep_width; - nvgText(ctx, x, y, value, NULL); - } else { - nvgTextAlign(ctx, - (align==BND_LEFT)?(NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE): - (NVG_ALIGN_CENTER|NVG_ALIGN_BASELINE)); - nvgTextBox(ctx,x+pleft,y+BND_WIDGET_HEIGHT-BND_TEXT_PAD_DOWN, - w-BND_PAD_RIGHT-pleft,label, NULL); - } - } else if (iconid >= 0) { - bndIcon(ctx,x+2,y+2,iconid); - } -} - -void bndNodeIconLabel(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, NVGcolor shadowColor, - int align, float fontsize, const char *label) { - if (label && (bnd_font >= 0)) { - nvgFontFaceId(ctx, bnd_font); - nvgFontSize(ctx, fontsize); - nvgBeginPath(ctx); - nvgTextAlign(ctx, NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE); - nvgFillColor(ctx, shadowColor); - nvgFontBlur(ctx, BND_NODE_TITLE_FEATHER); - nvgTextBox(ctx,x+1,y+h+3-BND_TEXT_PAD_DOWN, - w,label, NULL); - nvgFillColor(ctx, color); - nvgFontBlur(ctx, 0); - nvgTextBox(ctx,x,y+h+2-BND_TEXT_PAD_DOWN, - w,label, NULL); - } - if (iconid >= 0) { - bndIcon(ctx,x+w-BND_ICON_SHEET_RES,y+3,iconid); - } -} - -int bndIconLabelTextPosition(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, float fontsize, const char *label, int px, int py) { - float bounds[4]; - float pleft = BND_TEXT_RADIUS; - if (!label) return -1; - if (iconid >= 0) - pleft += BND_ICON_SHEET_RES; - - if (bnd_font < 0) return -1; - - x += pleft; - y += BND_WIDGET_HEIGHT - BND_TEXT_PAD_DOWN; - - nvgFontFaceId(ctx, bnd_font); - nvgFontSize(ctx, fontsize); - nvgTextAlign(ctx, NVG_ALIGN_LEFT | NVG_ALIGN_BASELINE); - - w -= BND_TEXT_RADIUS + pleft; - - float asc, desc, lh; - static NVGtextRow rows[BND_MAX_ROWS]; - int nrows = nvgTextBreakLines( - ctx, label, NULL, w, rows, BND_MAX_ROWS); - if (nrows == 0) return 0; - nvgTextBoxBounds(ctx, x, y, w, label, NULL, bounds); - nvgTextMetrics(ctx, &asc, &desc, &lh); - - // calculate vertical position - int row = bnd_clamp((int)((float)(py - bounds[1]) / lh), 0, nrows - 1); - // search horizontal position - static NVGglyphPosition glyphs[BND_MAX_GLYPHS]; - int nglyphs = nvgTextGlyphPositions( - ctx, x, y, rows[row].start, rows[row].end + 1, glyphs, BND_MAX_GLYPHS); - int col, p = 0; - for (col = 0; col < nglyphs && glyphs[col].x < px; ++col) - p = glyphs[col].str - label; - // see if we should move one character further - if (col > 0 && col < nglyphs && glyphs[col].x - px < px - glyphs[col - 1].x) - p = glyphs[col].str - label; - return p; -} - -static void bndCaretPosition(NVGcontext *ctx, float x, float y, - float desc, float lineHeight, const char *caret, NVGtextRow *rows,int nrows, - int *cr, float *cx, float *cy) { - static NVGglyphPosition glyphs[BND_MAX_GLYPHS]; - int r,nglyphs; - for (r=0; r < nrows && rows[r].end < caret; ++r); - *cr = r; - *cx = x; - *cy = y-lineHeight-desc + r*lineHeight; - if (nrows == 0) return; - *cx = rows[r].minx; - nglyphs = nvgTextGlyphPositions( - ctx, x, y, rows[r].start, rows[r].end+1, glyphs, BND_MAX_GLYPHS); - for (int i=0; i < nglyphs; ++i) { - *cx=glyphs[i].x; - if (glyphs[i].str == caret) break; - } -} - -void bndIconLabelCaret(NVGcontext *ctx, float x, float y, float w, float h, - int iconid, NVGcolor color, float fontsize, const char *label, - NVGcolor caretcolor, int cbegin, int cend) { - float pleft = BND_TEXT_RADIUS; - if (!label) return; - if (iconid >= 0) { - bndIcon(ctx,x+4,y+2,iconid); - pleft += BND_ICON_SHEET_RES; - } - - if (bnd_font < 0) return; - - x+=pleft; - y+=BND_WIDGET_HEIGHT-BND_TEXT_PAD_DOWN; - - nvgFontFaceId(ctx, bnd_font); - nvgFontSize(ctx, fontsize); - nvgTextAlign(ctx, NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE); - - w -= BND_TEXT_RADIUS+pleft; - - if (cend >= cbegin) { - int c0r,c1r; - float c0x,c0y,c1x,c1y; - float desc,lh; - static NVGtextRow rows[BND_MAX_ROWS]; - int nrows = nvgTextBreakLines( - ctx, label, label+cend+1, w, rows, BND_MAX_ROWS); - nvgTextMetrics(ctx, NULL, &desc, &lh); - - bndCaretPosition(ctx, x, y, desc, lh, label+cbegin, - rows, nrows, &c0r, &c0x, &c0y); - bndCaretPosition(ctx, x, y, desc, lh, label+cend, - rows, nrows, &c1r, &c1x, &c1y); - - nvgBeginPath(ctx); - if (cbegin == cend) { - nvgFillColor(ctx, nvgRGBf(0.337,0.502,0.761)); - nvgRect(ctx, c0x-1, c0y, 2, lh+1); - } else { - nvgFillColor(ctx, caretcolor); - if (c0r == c1r) { - nvgRect(ctx, c0x-1, c0y, c1x-c0x+1, lh+1); - } else { - int blk=c1r-c0r-1; - nvgRect(ctx, c0x-1, c0y, x+w-c0x+1, lh+1); - nvgRect(ctx, x, c1y, c1x-x+1, lh+1); - - if (blk) - nvgRect(ctx, x, c0y+lh, w, blk*lh+1); - } - } - nvgFill(ctx); - } - - nvgBeginPath(ctx); - nvgFillColor(ctx, color); - nvgTextBox(ctx,x,y,w,label, NULL); -} - -void bndCheck(NVGcontext *ctx, float ox, float oy, NVGcolor color) { - nvgBeginPath(ctx); - nvgStrokeWidth(ctx,2); - nvgStrokeColor(ctx,color); - nvgLineCap(ctx,NVG_BUTT); - nvgLineJoin(ctx,NVG_MITER); - nvgMoveTo(ctx,ox+4,oy+5); - nvgLineTo(ctx,ox+7,oy+8); - nvgLineTo(ctx,ox+14,oy+1); - nvgStroke(ctx); -} - -void bndArrow(NVGcontext *ctx, float x, float y, float s, NVGcolor color) { - nvgBeginPath(ctx); - nvgMoveTo(ctx,x,y); - nvgLineTo(ctx,x-s,y+s); - nvgLineTo(ctx,x-s,y-s); - nvgClosePath(ctx); - nvgFillColor(ctx,color); - nvgFill(ctx); -} - -void bndUpDownArrow(NVGcontext *ctx, float x, float y, float s, NVGcolor color) { - float w; - - nvgBeginPath(ctx); - w = 1.1f*s; - nvgMoveTo(ctx,x,y-1); - nvgLineTo(ctx,x+0.5*w,y-s-1); - nvgLineTo(ctx,x+w,y-1); - nvgClosePath(ctx); - nvgMoveTo(ctx,x,y+1); - nvgLineTo(ctx,x+0.5*w,y+s+1); - nvgLineTo(ctx,x+w,y+1); - nvgClosePath(ctx); - nvgFillColor(ctx,color); - nvgFill(ctx); -} - -void bndNodeArrowDown(NVGcontext *ctx, float x, float y, float s, NVGcolor color) { - float w; - nvgBeginPath(ctx); - w = 1.0f*s; - nvgMoveTo(ctx,x,y); - nvgLineTo(ctx,x+0.5*w,y-s); - nvgLineTo(ctx,x-0.5*w,y-s); - nvgClosePath(ctx); - nvgFillColor(ctx,color); - nvgFill(ctx); -} - -void bndScrollHandleRect(float *x, float *y, float *w, float *h, - float offset, float size) { - size = bnd_clamp(size,0,1); - offset = bnd_clamp(offset,0,1); - if ((*h) > (*w)) { - float hs = bnd_fmaxf(size*(*h), (*w)+1); - *y = (*y) + ((*h)-hs)*offset; - *h = hs; - } else { - float ws = bnd_fmaxf(size*(*w), (*h)-1); - *x = (*x) + ((*w)-ws)*offset; - *w = ws; - } -} - -NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState state) { - switch(state) { - default: - case BND_DEFAULT: return nvgRGBf(0.5f,0.5f,0.5f); - case BND_HOVER: return theme->wireSelectColor; - case BND_ACTIVE: return theme->activeNodeColor; - } -} - -//////////////////////////////////////////////////////////////////////////////// - -#ifdef BND_INLINE -#undef BND_INLINE -#endif - -#endif // BLENDISH_IMPLEMENTATION diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/fontstash.h b/FCLauncher/src/main/jni/lwjgl/nanovg/fontstash.h deleted file mode 100644 index ce582464..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/fontstash.h +++ /dev/null @@ -1,1790 +0,0 @@ -// -// Copyright (c) 2009-2013 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#ifndef FONS_H -#define FONS_H - -#define FONS_INVALID -1 - -enum FONSflags { - FONS_ZERO_TOPLEFT = 1, - FONS_ZERO_BOTTOMLEFT = 2, -}; - -enum FONSalign { - // Horizontal align - FONS_ALIGN_LEFT = 1<<0, // Default - FONS_ALIGN_CENTER = 1<<1, - FONS_ALIGN_RIGHT = 1<<2, - // Vertical align - FONS_ALIGN_TOP = 1<<3, - FONS_ALIGN_MIDDLE = 1<<4, - FONS_ALIGN_BOTTOM = 1<<5, - FONS_ALIGN_BASELINE = 1<<6, // Default -}; - -enum FONSglyphBitmap { - FONS_GLYPH_BITMAP_OPTIONAL = 1, - FONS_GLYPH_BITMAP_REQUIRED = 2, -}; - -enum FONSerrorCode { - // Font atlas is full. - FONS_ATLAS_FULL = 1, - // Scratch memory used to render glyphs is full, requested size reported in 'val', you may need to bump up FONS_SCRATCH_BUF_SIZE. - FONS_SCRATCH_FULL = 2, - // Calls to fonsPushState has created too large stack, if you need deep state stack bump up FONS_MAX_STATES. - FONS_STATES_OVERFLOW = 3, - // Trying to pop too many states fonsPopState(). - FONS_STATES_UNDERFLOW = 4, -}; - -struct FONSparams { - int width, height; - unsigned char flags; - void* userPtr; - int (*renderCreate)(void* uptr, int width, int height); - int (*renderResize)(void* uptr, int width, int height); - void (*renderUpdate)(void* uptr, int* rect, const unsigned char* data); - void (*renderDraw)(void* uptr, const float* verts, const float* tcoords, const unsigned int* colors, int nverts); - void (*renderDelete)(void* uptr); -}; -typedef struct FONSparams FONSparams; - -struct FONSquad -{ - float x0,y0,s0,t0; - float x1,y1,s1,t1; -}; -typedef struct FONSquad FONSquad; - -struct FONStextIter { - float x, y, nextx, nexty, scale, spacing; - unsigned int codepoint; - short isize, iblur; - struct FONSfont* font; - int prevGlyphIndex; - const char* str; - const char* next; - const char* end; - unsigned int utf8state; - int bitmapOption; -}; -typedef struct FONStextIter FONStextIter; - -typedef struct FONScontext FONScontext; - -// Constructor and destructor. -FONScontext* fonsCreateInternal(FONSparams* params); -void fonsDeleteInternal(FONScontext* s); - -void fonsSetErrorCallback(FONScontext* s, void (*callback)(void* uptr, int error, int val), void* uptr); -// Returns current atlas size. -void fonsGetAtlasSize(FONScontext* s, int* width, int* height); -// Expands the atlas size. -int fonsExpandAtlas(FONScontext* s, int width, int height); -// Resets the whole stash. -int fonsResetAtlas(FONScontext* stash, int width, int height); - -// Add fonts -int fonsAddFont(FONScontext* s, const char* name, const char* path, int fontIndex); -int fonsAddFontMem(FONScontext* s, const char* name, unsigned char* data, int ndata, int freeData, int fontIndex); -int fonsGetFontByName(FONScontext* s, const char* name); - -// State handling -void fonsPushState(FONScontext* s); -void fonsPopState(FONScontext* s); -void fonsClearState(FONScontext* s); - -// State setting -void fonsSetSize(FONScontext* s, float size); -void fonsSetColor(FONScontext* s, unsigned int color); -void fonsSetSpacing(FONScontext* s, float spacing); -void fonsSetBlur(FONScontext* s, float blur); -void fonsSetAlign(FONScontext* s, int align); -void fonsSetFont(FONScontext* s, int font); - -// Draw text -float fonsDrawText(FONScontext* s, float x, float y, const char* string, const char* end); - -// Measure text -float fonsTextBounds(FONScontext* s, float x, float y, const char* string, const char* end, float* bounds); -void fonsLineBounds(FONScontext* s, float y, float* miny, float* maxy); -void fonsVertMetrics(FONScontext* s, float* ascender, float* descender, float* lineh); - -// Text iterator -int fonsTextIterInit(FONScontext* stash, FONStextIter* iter, float x, float y, const char* str, const char* end, int bitmapOption); -int fonsTextIterNext(FONScontext* stash, FONStextIter* iter, struct FONSquad* quad); - -// Pull texture changes -const unsigned char* fonsGetTextureData(FONScontext* stash, int* width, int* height); -int fonsValidateTexture(FONScontext* s, int* dirty); - -// Draws the stash texture for debugging -void fonsDrawDebug(FONScontext* s, float x, float y); - -#endif // FONTSTASH_H - - -#ifdef FONTSTASH_IMPLEMENTATION - -#define FONS_NOTUSED(v) (void)sizeof(v) - -#ifdef FONS_USE_FREETYPE - -#include -#include FT_FREETYPE_H -#include FT_ADVANCES_H -#include - -struct FONSttFontImpl { - FT_Face font; -}; -typedef struct FONSttFontImpl FONSttFontImpl; - -#else - -//static void* fons__tmpalloc(size_t size, void* up); -//static void fons__tmpfree(void* ptr, void* up); -//#define STBTT_malloc(x,u) fons__tmpalloc(x,u) -//#define STBTT_free(x,u) fons__tmpfree(x,u) -#include "lwjgl/stb/stb_truetype.h" - -struct FONSttFontImpl { - stbtt_fontinfo font; -}; -typedef struct FONSttFontImpl FONSttFontImpl; - -#endif - -#ifndef FONS_SCRATCH_BUF_SIZE -# define FONS_SCRATCH_BUF_SIZE 96000 -#endif -#ifndef FONS_HASH_LUT_SIZE -# define FONS_HASH_LUT_SIZE 256 -#endif -#ifndef FONS_INIT_FONTS -# define FONS_INIT_FONTS 4 -#endif -#ifndef FONS_INIT_GLYPHS -# define FONS_INIT_GLYPHS 256 -#endif -#ifndef FONS_INIT_ATLAS_NODES -# define FONS_INIT_ATLAS_NODES 256 -#endif -#ifndef FONS_VERTEX_COUNT -# define FONS_VERTEX_COUNT 1024 -#endif -#ifndef FONS_MAX_STATES -# define FONS_MAX_STATES 20 -#endif -#ifndef FONS_MAX_FALLBACKS -# define FONS_MAX_FALLBACKS 20 -#endif - -static unsigned int fons__hashint(unsigned int a) -{ - a += ~(a<<15); - a ^= (a>>10); - a += (a<<3); - a ^= (a>>6); - a += ~(a<<11); - a ^= (a>>16); - return a; -} - -static int fons__mini(int a, int b) -{ - return a < b ? a : b; -} - -static int fons__maxi(int a, int b) -{ - return a > b ? a : b; -} - -struct FONSglyph -{ - unsigned int codepoint; - int index; - int next; - short size, blur; - short x0,y0,x1,y1; - short xadv,xoff,yoff; -}; -typedef struct FONSglyph FONSglyph; - -struct FONSfont -{ - FONSttFontImpl font; - char name[64]; - unsigned char* data; - int dataSize; - unsigned char freeData; - float ascender; - float descender; - float lineh; - FONSglyph* glyphs; - int cglyphs; - int nglyphs; - int lut[FONS_HASH_LUT_SIZE]; - int fallbacks[FONS_MAX_FALLBACKS]; - int nfallbacks; -}; -typedef struct FONSfont FONSfont; - -struct FONSstate -{ - int font; - int align; - float size; - unsigned int color; - float blur; - float spacing; -}; -typedef struct FONSstate FONSstate; - -struct FONSatlasNode { - short x, y, width; -}; -typedef struct FONSatlasNode FONSatlasNode; - -struct FONSatlas -{ - int width, height; - FONSatlasNode* nodes; - int nnodes; - int cnodes; -}; -typedef struct FONSatlas FONSatlas; - -struct FONScontext -{ - FONSparams params; - float itw,ith; - unsigned char* texData; - int dirtyRect[4]; - FONSfont** fonts; - FONSatlas* atlas; - int cfonts; - int nfonts; - float verts[FONS_VERTEX_COUNT*2]; - float tcoords[FONS_VERTEX_COUNT*2]; - unsigned int colors[FONS_VERTEX_COUNT]; - int nverts; - unsigned char* scratch; - int nscratch; - FONSstate states[FONS_MAX_STATES]; - int nstates; - void (*handleError)(void* uptr, int error, int val); - void* errorUptr; -#ifdef FONS_USE_FREETYPE - FT_Library ftLibrary; -#endif -}; - -#ifdef FONS_USE_FREETYPE - -int fons__tt_init(FONScontext *context) -{ - FT_Error ftError; - FONS_NOTUSED(context); - ftError = FT_Init_FreeType(&context->ftLibrary); - return ftError == 0; -} - -int fons__tt_done(FONScontext *context) -{ - FT_Error ftError; - FONS_NOTUSED(context); - ftError = FT_Done_FreeType(context->ftLibrary); - return ftError == 0; -} - -int fons__tt_loadFont(FONScontext *context, FONSttFontImpl *font, unsigned char *data, int dataSize, int fontIndex) -{ - FT_Error ftError; - FONS_NOTUSED(context); - - ftError = FT_New_Memory_Face(context->ftLibrary, (const FT_Byte*)data, dataSize, fontIndex, &font->font); - return ftError == 0; -} - -void fons__tt_getFontVMetrics(FONSttFontImpl *font, int *ascent, int *descent, int *lineGap) -{ - *ascent = font->font->ascender; - *descent = font->font->descender; - *lineGap = font->font->height - (*ascent - *descent); -} - -float fons__tt_getPixelHeightScale(FONSttFontImpl *font, float size) -{ - return size / font->font->units_per_EM; -} - -int fons__tt_getGlyphIndex(FONSttFontImpl *font, int codepoint) -{ - return FT_Get_Char_Index(font->font, codepoint); -} - -int fons__tt_buildGlyphBitmap(FONSttFontImpl *font, int glyph, float size, float scale, - int *advance, int *lsb, int *x0, int *y0, int *x1, int *y1) -{ - FT_Error ftError; - FT_GlyphSlot ftGlyph; - FT_Fixed advFixed; - FONS_NOTUSED(scale); - - ftError = FT_Set_Pixel_Sizes(font->font, 0, size); - if (ftError) return 0; - ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT | FT_LOAD_TARGET_LIGHT); - if (ftError) return 0; - ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed); - if (ftError) return 0; - ftGlyph = font->font->glyph; - *advance = (int)advFixed; - *lsb = (int)ftGlyph->metrics.horiBearingX; - *x0 = ftGlyph->bitmap_left; - *x1 = *x0 + ftGlyph->bitmap.width; - *y0 = -ftGlyph->bitmap_top; - *y1 = *y0 + ftGlyph->bitmap.rows; - return 1; -} - -void fons__tt_renderGlyphBitmap(FONSttFontImpl *font, unsigned char *output, int outWidth, int outHeight, int outStride, - float scaleX, float scaleY, int glyph) -{ - FT_GlyphSlot ftGlyph = font->font->glyph; - int ftGlyphOffset = 0; - unsigned int x, y; - FONS_NOTUSED(outWidth); - FONS_NOTUSED(outHeight); - FONS_NOTUSED(scaleX); - FONS_NOTUSED(scaleY); - FONS_NOTUSED(glyph); // glyph has already been loaded by fons__tt_buildGlyphBitmap - - for ( y = 0; y < ftGlyph->bitmap.rows; y++ ) { - for ( x = 0; x < ftGlyph->bitmap.width; x++ ) { - output[(y * outStride) + x] = ftGlyph->bitmap.buffer[ftGlyphOffset++]; - } - } -} - -int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font, int glyph1, int glyph2) -{ - FT_Vector ftKerning; - FT_Get_Kerning(font->font, glyph1, glyph2, FT_KERNING_DEFAULT, &ftKerning); - return (int)((ftKerning.x + 32) >> 6); // Round up and convert to integer -} - -#else - -int fons__tt_init(FONScontext *context) -{ - FONS_NOTUSED(context); - return 1; -} - -int fons__tt_done(FONScontext *context) -{ - FONS_NOTUSED(context); - return 1; -} - -int fons__tt_loadFont(FONScontext *context, FONSttFontImpl *font, unsigned char *data, int dataSize, int fontIndex) -{ - int offset, stbError; - FONS_NOTUSED(dataSize); - - font->font.userdata = context; - offset = stbtt_GetFontOffsetForIndex(data, fontIndex); - if (offset == -1) { - stbError = 0; - } else { - stbError = stbtt_InitFont(&font->font, data, offset); - } - return stbError; -} - -void fons__tt_getFontVMetrics(FONSttFontImpl *font, int *ascent, int *descent, int *lineGap) -{ - stbtt_GetFontVMetrics(&font->font, ascent, descent, lineGap); -} - -float fons__tt_getPixelHeightScale(FONSttFontImpl *font, float size) -{ - return stbtt_ScaleForMappingEmToPixels(&font->font, size); -} - -int fons__tt_getGlyphIndex(FONSttFontImpl *font, int codepoint) -{ - return stbtt_FindGlyphIndex(&font->font, codepoint); -} - -int fons__tt_buildGlyphBitmap(FONSttFontImpl *font, int glyph, float size, float scale, - int *advance, int *lsb, int *x0, int *y0, int *x1, int *y1) -{ - FONS_NOTUSED(size); - stbtt_GetGlyphHMetrics(&font->font, glyph, advance, lsb); - stbtt_GetGlyphBitmapBox(&font->font, glyph, scale, scale, x0, y0, x1, y1); - return 1; -} - -void fons__tt_renderGlyphBitmap(FONSttFontImpl *font, unsigned char *output, int outWidth, int outHeight, int outStride, - float scaleX, float scaleY, int glyph) -{ - stbtt_MakeGlyphBitmap(&font->font, output, outWidth, outHeight, outStride, scaleX, scaleY, glyph); -} - -int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font, int glyph1, int glyph2) -{ - return stbtt_GetGlyphKernAdvance(&font->font, glyph1, glyph2); -} - -#endif - -#ifdef STB_TRUETYPE_IMPLEMENTATION - -/*static void* fons__tmpalloc(size_t size, void* up) -{ - unsigned char* ptr; - FONScontext* stash = (FONScontext*)up; - - // 16-byte align the returned pointer - size = (size + 0xf) & ~0xf; - - if (stash->nscratch+(int)size > FONS_SCRATCH_BUF_SIZE) { - if (stash->handleError) - stash->handleError(stash->errorUptr, FONS_SCRATCH_FULL, stash->nscratch+(int)size); - return NULL; - } - ptr = stash->scratch + stash->nscratch; - stash->nscratch += (int)size; - return ptr; -} - -static void fons__tmpfree(void* ptr, void* up) -{ - (void)ptr; - (void)up; - // empty -}*/ - -#endif // STB_TRUETYPE_IMPLEMENTATION - -// Copyright (c) 2008-2010 Bjoern Hoehrmann -// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details. - -#define FONS_UTF8_ACCEPT 0 -#define FONS_UTF8_REJECT 12 - -static unsigned int fons__decutf8(unsigned int* state, unsigned int* codep, unsigned int byte) -{ - static const unsigned char utf8d[] = { - // The first part of the table maps bytes to character classes that - // to reduce the size of the transition table and create bitmasks. - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, - - // The second part is a transition table that maps a combination - // of a state of the automaton and a character class to a state. - 0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12, - 12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12, - 12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12, - 12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12, - 12,36,12,12,12,12,12,12,12,12,12,12, - }; - - unsigned int type = utf8d[byte]; - - *codep = (*state != FONS_UTF8_ACCEPT) ? - (byte & 0x3fu) | (*codep << 6) : - (0xff >> type) & (byte); - - *state = utf8d[256 + *state + type]; - return *state; -} - -// Atlas based on Skyline Bin Packer by Jukka Jylänki - -static void fons__deleteAtlas(FONSatlas* atlas) -{ - if (atlas == NULL) return; - if (atlas->nodes != NULL) NVG_FREE(atlas->nodes); - NVG_FREE(atlas); -} - -static FONSatlas* fons__allocAtlas(int w, int h, int nnodes) -{ - FONSatlas* atlas = NULL; - - // Allocate memory for the font stash. - atlas = (FONSatlas*)NVG_MALLOC(sizeof(FONSatlas)); - if (atlas == NULL) goto error; - memset(atlas, 0, sizeof(FONSatlas)); - - atlas->width = w; - atlas->height = h; - - // Allocate space for skyline nodes - atlas->nodes = (FONSatlasNode*)NVG_MALLOC(sizeof(FONSatlasNode) * nnodes); - if (atlas->nodes == NULL) goto error; - memset(atlas->nodes, 0, sizeof(FONSatlasNode) * nnodes); - atlas->nnodes = 0; - atlas->cnodes = nnodes; - - // Init root node. - atlas->nodes[0].x = 0; - atlas->nodes[0].y = 0; - atlas->nodes[0].width = (short)w; - atlas->nnodes++; - - return atlas; - -error: - if (atlas) fons__deleteAtlas(atlas); - return NULL; -} - -static int fons__atlasInsertNode(FONSatlas* atlas, int idx, int x, int y, int w) -{ - int i; - // Insert node - if (atlas->nnodes+1 > atlas->cnodes) { - atlas->cnodes = atlas->cnodes == 0 ? 8 : atlas->cnodes * 2; - atlas->nodes = (FONSatlasNode*)NVG_REALLOC(atlas->nodes, sizeof(FONSatlasNode) * atlas->cnodes); - if (atlas->nodes == NULL) - return 0; - } - for (i = atlas->nnodes; i > idx; i--) - atlas->nodes[i] = atlas->nodes[i-1]; - atlas->nodes[idx].x = (short)x; - atlas->nodes[idx].y = (short)y; - atlas->nodes[idx].width = (short)w; - atlas->nnodes++; - - return 1; -} - -static void fons__atlasRemoveNode(FONSatlas* atlas, int idx) -{ - int i; - if (atlas->nnodes == 0) return; - for (i = idx; i < atlas->nnodes-1; i++) - atlas->nodes[i] = atlas->nodes[i+1]; - atlas->nnodes--; -} - -static void fons__atlasExpand(FONSatlas* atlas, int w, int h) -{ - // Insert node for empty space - if (w > atlas->width) - fons__atlasInsertNode(atlas, atlas->nnodes, atlas->width, 0, w - atlas->width); - atlas->width = w; - atlas->height = h; -} - -static void fons__atlasReset(FONSatlas* atlas, int w, int h) -{ - atlas->width = w; - atlas->height = h; - atlas->nnodes = 0; - - // Init root node. - atlas->nodes[0].x = 0; - atlas->nodes[0].y = 0; - atlas->nodes[0].width = (short)w; - atlas->nnodes++; -} - -static int fons__atlasAddSkylineLevel(FONSatlas* atlas, int idx, int x, int y, int w, int h) -{ - int i; - - // Insert new node - if (fons__atlasInsertNode(atlas, idx, x, y+h, w) == 0) - return 0; - - // Delete skyline segments that fall under the shadow of the new segment. - for (i = idx+1; i < atlas->nnodes; i++) { - if (atlas->nodes[i].x < atlas->nodes[i-1].x + atlas->nodes[i-1].width) { - int shrink = atlas->nodes[i-1].x + atlas->nodes[i-1].width - atlas->nodes[i].x; - atlas->nodes[i].x += (short)shrink; - atlas->nodes[i].width -= (short)shrink; - if (atlas->nodes[i].width <= 0) { - fons__atlasRemoveNode(atlas, i); - i--; - } else { - break; - } - } else { - break; - } - } - - // Merge same height skyline segments that are next to each other. - for (i = 0; i < atlas->nnodes-1; i++) { - if (atlas->nodes[i].y == atlas->nodes[i+1].y) { - atlas->nodes[i].width += atlas->nodes[i+1].width; - fons__atlasRemoveNode(atlas, i+1); - i--; - } - } - - return 1; -} - -static int fons__atlasRectFits(FONSatlas* atlas, int i, int w, int h) -{ - // Checks if there is enough space at the location of skyline span 'i', - // and return the max height of all skyline spans under that at that location, - // (think tetris block being dropped at that position). Or -1 if no space found. - int x = atlas->nodes[i].x; - int y = atlas->nodes[i].y; - int spaceLeft; - if (x + w > atlas->width) - return -1; - spaceLeft = w; - while (spaceLeft > 0) { - if (i == atlas->nnodes) return -1; - y = fons__maxi(y, atlas->nodes[i].y); - if (y + h > atlas->height) return -1; - spaceLeft -= atlas->nodes[i].width; - ++i; - } - return y; -} - -static int fons__atlasAddRect(FONSatlas* atlas, int rw, int rh, int* rx, int* ry) -{ - int besth = atlas->height, bestw = atlas->width, besti = -1; - int bestx = -1, besty = -1, i; - - // Bottom left fit heuristic. - for (i = 0; i < atlas->nnodes; i++) { - int y = fons__atlasRectFits(atlas, i, rw, rh); - if (y != -1) { - if (y + rh < besth || (y + rh == besth && atlas->nodes[i].width < bestw)) { - besti = i; - bestw = atlas->nodes[i].width; - besth = y + rh; - bestx = atlas->nodes[i].x; - besty = y; - } - } - } - - if (besti == -1) - return 0; - - // Perform the actual packing. - if (fons__atlasAddSkylineLevel(atlas, besti, bestx, besty, rw, rh) == 0) - return 0; - - *rx = bestx; - *ry = besty; - - return 1; -} - -static void fons__addWhiteRect(FONScontext* stash, int w, int h) -{ - int x, y, gx, gy; - unsigned char* dst; - if (fons__atlasAddRect(stash->atlas, w, h, &gx, &gy) == 0) - return; - - // Rasterize - dst = &stash->texData[gx + gy * stash->params.width]; - for (y = 0; y < h; y++) { - for (x = 0; x < w; x++) - dst[x] = 0xff; - dst += stash->params.width; - } - - stash->dirtyRect[0] = fons__mini(stash->dirtyRect[0], gx); - stash->dirtyRect[1] = fons__mini(stash->dirtyRect[1], gy); - stash->dirtyRect[2] = fons__maxi(stash->dirtyRect[2], gx+w); - stash->dirtyRect[3] = fons__maxi(stash->dirtyRect[3], gy+h); -} - -FONScontext* fonsCreateInternal(FONSparams* params) -{ - FONScontext* stash = NULL; - - // Allocate memory for the font stash. - stash = (FONScontext*)NVG_MALLOC(sizeof(FONScontext)); - if (stash == NULL) goto error; - memset(stash, 0, sizeof(FONScontext)); - - stash->params = *params; - - // Allocate scratch buffer. - stash->scratch = (unsigned char*)NVG_MALLOC(FONS_SCRATCH_BUF_SIZE); - if (stash->scratch == NULL) goto error; - - // Initialize implementation library - if (!fons__tt_init(stash)) goto error; - - if (stash->params.renderCreate != NULL) { - if (stash->params.renderCreate(stash->params.userPtr, stash->params.width, stash->params.height) == 0) - goto error; - } - - stash->atlas = fons__allocAtlas(stash->params.width, stash->params.height, FONS_INIT_ATLAS_NODES); - if (stash->atlas == NULL) goto error; - - // Allocate space for fonts. - stash->fonts = (FONSfont**)NVG_MALLOC(sizeof(FONSfont*) * FONS_INIT_FONTS); - if (stash->fonts == NULL) goto error; - memset(stash->fonts, 0, sizeof(FONSfont*) * FONS_INIT_FONTS); - stash->cfonts = FONS_INIT_FONTS; - stash->nfonts = 0; - - // Create texture for the cache. - stash->itw = 1.0f/stash->params.width; - stash->ith = 1.0f/stash->params.height; - stash->texData = (unsigned char*)NVG_MALLOC(stash->params.width * stash->params.height); - if (stash->texData == NULL) goto error; - memset(stash->texData, 0, stash->params.width * stash->params.height); - - stash->dirtyRect[0] = stash->params.width; - stash->dirtyRect[1] = stash->params.height; - stash->dirtyRect[2] = 0; - stash->dirtyRect[3] = 0; - - // Add white rect at 0,0 for debug drawing. - fons__addWhiteRect(stash, 2,2); - - fonsPushState(stash); - fonsClearState(stash); - - return stash; - -error: - fonsDeleteInternal(stash); - return NULL; -} - -static FONSstate* fons__getState(FONScontext* stash) -{ - return &stash->states[stash->nstates-1]; -} - -int fonsAddFallbackFont(FONScontext* stash, int base, int fallback) -{ - FONSfont* baseFont = stash->fonts[base]; - if (baseFont->nfallbacks < FONS_MAX_FALLBACKS) { - baseFont->fallbacks[baseFont->nfallbacks++] = fallback; - return 1; - } - return 0; -} - -void fonsResetFallbackFont(FONScontext* stash, int base) -{ - int i; - - FONSfont* baseFont = stash->fonts[base]; - baseFont->nfallbacks = 0; - baseFont->nglyphs = 0; - for (i = 0; i < FONS_HASH_LUT_SIZE; i++) - baseFont->lut[i] = -1; -} - -void fonsSetSize(FONScontext* stash, float size) -{ - fons__getState(stash)->size = size; -} - -void fonsSetColor(FONScontext* stash, unsigned int color) -{ - fons__getState(stash)->color = color; -} - -void fonsSetSpacing(FONScontext* stash, float spacing) -{ - fons__getState(stash)->spacing = spacing; -} - -void fonsSetBlur(FONScontext* stash, float blur) -{ - fons__getState(stash)->blur = blur; -} - -void fonsSetAlign(FONScontext* stash, int align) -{ - fons__getState(stash)->align = align; -} - -void fonsSetFont(FONScontext* stash, int font) -{ - fons__getState(stash)->font = font; -} - -void fonsPushState(FONScontext* stash) -{ - if (stash->nstates >= FONS_MAX_STATES) { - if (stash->handleError) - stash->handleError(stash->errorUptr, FONS_STATES_OVERFLOW, 0); - return; - } - if (stash->nstates > 0) - memcpy(&stash->states[stash->nstates], &stash->states[stash->nstates-1], sizeof(FONSstate)); - stash->nstates++; -} - -void fonsPopState(FONScontext* stash) -{ - if (stash->nstates <= 1) { - if (stash->handleError) - stash->handleError(stash->errorUptr, FONS_STATES_UNDERFLOW, 0); - return; - } - stash->nstates--; -} - -void fonsClearState(FONScontext* stash) -{ - FONSstate* state = fons__getState(stash); - state->size = 12.0f; - state->color = 0xffffffff; - state->font = 0; - state->blur = 0; - state->spacing = 0; - state->align = FONS_ALIGN_LEFT | FONS_ALIGN_BASELINE; -} - -static void fons__freeFont(FONSfont* font) -{ - if (font == NULL) return; - if (font->glyphs) NVG_FREE(font->glyphs); - if (font->freeData && font->data) NVG_FREE(font->data); - NVG_FREE(font); -} - -static int fons__allocFont(FONScontext* stash) -{ - FONSfont* font = NULL; - if (stash->nfonts+1 > stash->cfonts) { - stash->cfonts = stash->cfonts == 0 ? 8 : stash->cfonts * 2; - stash->fonts = (FONSfont**)NVG_REALLOC(stash->fonts, sizeof(FONSfont*) * stash->cfonts); - if (stash->fonts == NULL) - return -1; - } - font = (FONSfont*)NVG_MALLOC(sizeof(FONSfont)); - if (font == NULL) goto error; - memset(font, 0, sizeof(FONSfont)); - - font->glyphs = (FONSglyph*)NVG_MALLOC(sizeof(FONSglyph) * FONS_INIT_GLYPHS); - if (font->glyphs == NULL) goto error; - font->cglyphs = FONS_INIT_GLYPHS; - font->nglyphs = 0; - - stash->fonts[stash->nfonts++] = font; - return stash->nfonts-1; - -error: - fons__freeFont(font); - - return FONS_INVALID; -} - -int fonsAddFont(FONScontext* stash, const char* name, const char* path, int fontIndex) -{ - FILE* fp = 0; - int dataSize = 0; - size_t readed; - unsigned char* data = NULL; - - // Read in the font data. - fp = fopen(path, "rb"); - if (fp == NULL) goto error; - fseek(fp,0,SEEK_END); - dataSize = (int)ftell(fp); - fseek(fp,0,SEEK_SET); - data = (unsigned char*)NVG_MALLOC(dataSize); - if (data == NULL) goto error; - readed = fread(data, 1, dataSize, fp); - fclose(fp); - fp = 0; - if (readed != (size_t)dataSize) goto error; - - return fonsAddFontMem(stash, name, data, dataSize, 1, fontIndex); - -error: - if (data) NVG_FREE(data); - if (fp) fclose(fp); - return FONS_INVALID; -} - -int fonsAddFontMem(FONScontext* stash, const char* name, unsigned char* data, int dataSize, int freeData, int fontIndex) -{ - int i, ascent, descent, fh, lineGap; - FONSfont* font; - - int idx = fons__allocFont(stash); - if (idx == FONS_INVALID) - return FONS_INVALID; - - font = stash->fonts[idx]; - - strncpy(font->name, name, sizeof(font->name)); - font->name[sizeof(font->name)-1] = '\0'; - - // Init hash lookup. - for (i = 0; i < FONS_HASH_LUT_SIZE; ++i) - font->lut[i] = -1; - - // Read in the font data. - font->dataSize = dataSize; - font->data = data; - font->freeData = (unsigned char)freeData; - - // Init font - stash->nscratch = 0; - if (!fons__tt_loadFont(stash, &font->font, data, dataSize, fontIndex)) goto error; - - // Store normalized line height. The real line height is got - // by multiplying the lineh by font size. - fons__tt_getFontVMetrics( &font->font, &ascent, &descent, &lineGap); - ascent += lineGap; - fh = ascent - descent; - font->ascender = (float)ascent / (float)fh; - font->descender = (float)descent / (float)fh; - font->lineh = font->ascender - font->descender; - - return idx; - -error: - fons__freeFont(font); - stash->nfonts--; - return FONS_INVALID; -} - -int fonsGetFontByName(FONScontext* s, const char* name) -{ - int i; - for (i = 0; i < s->nfonts; i++) { - if (strcmp(s->fonts[i]->name, name) == 0) - return i; - } - return FONS_INVALID; -} - - -static FONSglyph* fons__allocGlyph(FONSfont* font) -{ - if (font->nglyphs+1 > font->cglyphs) { - font->cglyphs = font->cglyphs == 0 ? 8 : font->cglyphs * 2; - font->glyphs = (FONSglyph*)NVG_REALLOC(font->glyphs, sizeof(FONSglyph) * font->cglyphs); - if (font->glyphs == NULL) return NULL; - } - font->nglyphs++; - return &font->glyphs[font->nglyphs-1]; -} - - -// Based on Exponential blur, Jani Huhtanen, 2006 - -#define APREC 16 -#define ZPREC 7 - -static void fons__blurCols(unsigned char* dst, int w, int h, int dstStride, int alpha) -{ - int x, y; - for (y = 0; y < h; y++) { - int z = 0; // force zero border - for (x = 1; x < w; x++) { - z += (alpha * (((int)(dst[x]) << ZPREC) - z)) >> APREC; - dst[x] = (unsigned char)(z >> ZPREC); - } - dst[w-1] = 0; // force zero border - z = 0; - for (x = w-2; x >= 0; x--) { - z += (alpha * (((int)(dst[x]) << ZPREC) - z)) >> APREC; - dst[x] = (unsigned char)(z >> ZPREC); - } - dst[0] = 0; // force zero border - dst += dstStride; - } -} - -static void fons__blurRows(unsigned char* dst, int w, int h, int dstStride, int alpha) -{ - int x, y; - for (x = 0; x < w; x++) { - int z = 0; // force zero border - for (y = dstStride; y < h*dstStride; y += dstStride) { - z += (alpha * (((int)(dst[y]) << ZPREC) - z)) >> APREC; - dst[y] = (unsigned char)(z >> ZPREC); - } - dst[(h-1)*dstStride] = 0; // force zero border - z = 0; - for (y = (h-2)*dstStride; y >= 0; y -= dstStride) { - z += (alpha * (((int)(dst[y]) << ZPREC) - z)) >> APREC; - dst[y] = (unsigned char)(z >> ZPREC); - } - dst[0] = 0; // force zero border - dst++; - } -} - - -static void fons__blur(FONScontext* stash, unsigned char* dst, int w, int h, int dstStride, int blur) -{ - int alpha; - float sigma; - (void)stash; - - if (blur < 1) - return; - // Calculate the alpha such that 90% of the kernel is within the radius. (Kernel extends to infinity) - sigma = (float)blur * 0.57735f; // 1 / sqrt(3) - alpha = (int)((1< 20) iblur = 20; - pad = iblur+2; - - // Reset allocator. - stash->nscratch = 0; - - // Find code point and size. - h = fons__hashint(codepoint) & (FONS_HASH_LUT_SIZE-1); - i = font->lut[h]; - while (i != -1) { - if (font->glyphs[i].codepoint == codepoint && font->glyphs[i].size == isize && font->glyphs[i].blur == iblur) { - glyph = &font->glyphs[i]; - if (bitmapOption == FONS_GLYPH_BITMAP_OPTIONAL || (glyph->x0 >= 0 && glyph->y0 >= 0)) { - return glyph; - } - // At this point, glyph exists but the bitmap data is not yet created. - break; - } - i = font->glyphs[i].next; - } - - // Create a new glyph or rasterize bitmap data for a cached glyph. - g = fons__tt_getGlyphIndex(&font->font, codepoint); - // Try to find the glyph in fallback fonts. - if (g == 0) { - for (i = 0; i < font->nfallbacks; ++i) { - FONSfont* fallbackFont = stash->fonts[font->fallbacks[i]]; - int fallbackIndex = fons__tt_getGlyphIndex(&fallbackFont->font, codepoint); - if (fallbackIndex != 0) { - g = fallbackIndex; - renderFont = fallbackFont; - break; - } - } - // It is possible that we did not find a fallback glyph. - // In that case the glyph index 'g' is 0, and we'll proceed below and cache empty glyph. - } - scale = fons__tt_getPixelHeightScale(&renderFont->font, size); - fons__tt_buildGlyphBitmap(&renderFont->font, g, size, scale, &advance, &lsb, &x0, &y0, &x1, &y1); - gw = x1-x0 + pad*2; - gh = y1-y0 + pad*2; - - // Determines the spot to draw glyph in the atlas. - if (bitmapOption == FONS_GLYPH_BITMAP_REQUIRED) { - // Find free spot for the rect in the atlas - added = fons__atlasAddRect(stash->atlas, gw, gh, &gx, &gy); - if (added == 0 && stash->handleError != NULL) { - // Atlas is full, let the user to resize the atlas (or not), and try again. - stash->handleError(stash->errorUptr, FONS_ATLAS_FULL, 0); - added = fons__atlasAddRect(stash->atlas, gw, gh, &gx, &gy); - } - if (added == 0) return NULL; - } else { - // Negative coordinate indicates there is no bitmap data created. - gx = -1; - gy = -1; - } - - // Init glyph. - if (glyph == NULL) { - glyph = fons__allocGlyph(font); - glyph->codepoint = codepoint; - glyph->size = isize; - glyph->blur = iblur; - glyph->next = 0; - - // Insert char to hash lookup. - glyph->next = font->lut[h]; - font->lut[h] = font->nglyphs-1; - } - glyph->index = g; - glyph->x0 = (short)gx; - glyph->y0 = (short)gy; - glyph->x1 = (short)(glyph->x0+gw); - glyph->y1 = (short)(glyph->y0+gh); - glyph->xadv = (short)(scale * advance * 10.0f); - glyph->xoff = (short)(x0 - pad); - glyph->yoff = (short)(y0 - pad); - - if (bitmapOption == FONS_GLYPH_BITMAP_OPTIONAL) { - return glyph; - } - - // Rasterize - dst = &stash->texData[(glyph->x0+pad) + (glyph->y0+pad) * stash->params.width]; - fons__tt_renderGlyphBitmap(&renderFont->font, dst, gw-pad*2,gh-pad*2, stash->params.width, scale, scale, g); - - // Make sure there is one pixel empty border. - dst = &stash->texData[glyph->x0 + glyph->y0 * stash->params.width]; - for (y = 0; y < gh; y++) { - dst[y*stash->params.width] = 0; - dst[gw-1 + y*stash->params.width] = 0; - } - for (x = 0; x < gw; x++) { - dst[x] = 0; - dst[x + (gh-1)*stash->params.width] = 0; - } - - // Debug code to color the glyph background -/* unsigned char* fdst = &stash->texData[glyph->x0 + glyph->y0 * stash->params.width]; - for (y = 0; y < gh; y++) { - for (x = 0; x < gw; x++) { - int a = (int)fdst[x+y*stash->params.width] + 20; - if (a > 255) a = 255; - fdst[x+y*stash->params.width] = a; - } - }*/ - - // Blur - if (iblur > 0) { - stash->nscratch = 0; - bdst = &stash->texData[glyph->x0 + glyph->y0 * stash->params.width]; - fons__blur(stash, bdst, gw, gh, stash->params.width, iblur); - } - - stash->dirtyRect[0] = fons__mini(stash->dirtyRect[0], glyph->x0); - stash->dirtyRect[1] = fons__mini(stash->dirtyRect[1], glyph->y0); - stash->dirtyRect[2] = fons__maxi(stash->dirtyRect[2], glyph->x1); - stash->dirtyRect[3] = fons__maxi(stash->dirtyRect[3], glyph->y1); - - return glyph; -} - -static void fons__getQuad(FONScontext* stash, FONSfont* font, - int prevGlyphIndex, FONSglyph* glyph, - float scale, float spacing, float* x, float* y, FONSquad* q) -{ - float rx,ry,xoff,yoff,x0,y0,x1,y1; - - if (prevGlyphIndex != -1) { - float adv = fons__tt_getGlyphKernAdvance(&font->font, prevGlyphIndex, glyph->index) * scale; - *x += (int)(adv + spacing + 0.5f); - } - - // Each glyph has 2px border to allow good interpolation, - // one pixel to prevent leaking, and one to allow good interpolation for rendering. - // Inset the texture region by one pixel for correct interpolation. - xoff = (short)(glyph->xoff+1); - yoff = (short)(glyph->yoff+1); - x0 = (float)(glyph->x0+1); - y0 = (float)(glyph->y0+1); - x1 = (float)(glyph->x1-1); - y1 = (float)(glyph->y1-1); - - if (stash->params.flags & FONS_ZERO_TOPLEFT) { - rx = floorf(*x + xoff); - ry = floorf(*y + yoff); - - q->x0 = rx; - q->y0 = ry; - q->x1 = rx + x1 - x0; - q->y1 = ry + y1 - y0; - - q->s0 = x0 * stash->itw; - q->t0 = y0 * stash->ith; - q->s1 = x1 * stash->itw; - q->t1 = y1 * stash->ith; - } else { - rx = floorf(*x + xoff); - ry = floorf(*y - yoff); - - q->x0 = rx; - q->y0 = ry; - q->x1 = rx + x1 - x0; - q->y1 = ry - y1 + y0; - - q->s0 = x0 * stash->itw; - q->t0 = y0 * stash->ith; - q->s1 = x1 * stash->itw; - q->t1 = y1 * stash->ith; - } - - *x += (int)(glyph->xadv / 10.0f + 0.5f); -} - -static void fons__flush(FONScontext* stash) -{ - // Flush texture - if (stash->dirtyRect[0] < stash->dirtyRect[2] && stash->dirtyRect[1] < stash->dirtyRect[3]) { - if (stash->params.renderUpdate != NULL) - stash->params.renderUpdate(stash->params.userPtr, stash->dirtyRect, stash->texData); - // Reset dirty rect - stash->dirtyRect[0] = stash->params.width; - stash->dirtyRect[1] = stash->params.height; - stash->dirtyRect[2] = 0; - stash->dirtyRect[3] = 0; - } - - // Flush triangles - if (stash->nverts > 0) { - if (stash->params.renderDraw != NULL) - stash->params.renderDraw(stash->params.userPtr, stash->verts, stash->tcoords, stash->colors, stash->nverts); - stash->nverts = 0; - } -} - -static __inline void fons__vertex(FONScontext* stash, float x, float y, float s, float t, unsigned int c) -{ - stash->verts[stash->nverts*2+0] = x; - stash->verts[stash->nverts*2+1] = y; - stash->tcoords[stash->nverts*2+0] = s; - stash->tcoords[stash->nverts*2+1] = t; - stash->colors[stash->nverts] = c; - stash->nverts++; -} - -static float fons__getVertAlign(FONScontext* stash, FONSfont* font, int align, short isize) -{ - if (stash->params.flags & FONS_ZERO_TOPLEFT) { - if (align & FONS_ALIGN_TOP) { - return font->ascender * (float)isize/10.0f; - } else if (align & FONS_ALIGN_MIDDLE) { - return (font->ascender + font->descender) / 2.0f * (float)isize/10.0f; - } else if (align & FONS_ALIGN_BASELINE) { - return 0.0f; - } else if (align & FONS_ALIGN_BOTTOM) { - return font->descender * (float)isize/10.0f; - } - } else { - if (align & FONS_ALIGN_TOP) { - return -font->ascender * (float)isize/10.0f; - } else if (align & FONS_ALIGN_MIDDLE) { - return -(font->ascender + font->descender) / 2.0f * (float)isize/10.0f; - } else if (align & FONS_ALIGN_BASELINE) { - return 0.0f; - } else if (align & FONS_ALIGN_BOTTOM) { - return -font->descender * (float)isize/10.0f; - } - } - return 0.0; -} - -float fonsDrawText(FONScontext* stash, - float x, float y, - const char* str, const char* end) -{ - FONSstate* state = fons__getState(stash); - unsigned int codepoint; - unsigned int utf8state = 0; - FONSglyph* glyph = NULL; - FONSquad q; - int prevGlyphIndex = -1; - short isize = (short)(state->size*10.0f); - short iblur = (short)state->blur; - float scale; - FONSfont* font; - float width; - - if (stash == NULL) return x; - if (state->font < 0 || state->font >= stash->nfonts) return x; - font = stash->fonts[state->font]; - if (font->data == NULL) return x; - - scale = fons__tt_getPixelHeightScale(&font->font, (float)isize/10.0f); - - if (end == NULL) - end = str + strlen(str); - - // Align horizontally - if (state->align & FONS_ALIGN_LEFT) { - // empty - } else if (state->align & FONS_ALIGN_RIGHT) { - width = fonsTextBounds(stash, x,y, str, end, NULL); - x -= width; - } else if (state->align & FONS_ALIGN_CENTER) { - width = fonsTextBounds(stash, x,y, str, end, NULL); - x -= width * 0.5f; - } - // Align vertically. - y += fons__getVertAlign(stash, font, state->align, isize); - - for (; str != end; ++str) { - if (fons__decutf8(&utf8state, &codepoint, *(const unsigned char*)str)) - continue; - glyph = fons__getGlyph(stash, font, codepoint, isize, iblur, FONS_GLYPH_BITMAP_REQUIRED); - if (glyph != NULL) { - fons__getQuad(stash, font, prevGlyphIndex, glyph, scale, state->spacing, &x, &y, &q); - - if (stash->nverts+6 > FONS_VERTEX_COUNT) - fons__flush(stash); - - fons__vertex(stash, q.x0, q.y0, q.s0, q.t0, state->color); - fons__vertex(stash, q.x1, q.y1, q.s1, q.t1, state->color); - fons__vertex(stash, q.x1, q.y0, q.s1, q.t0, state->color); - - fons__vertex(stash, q.x0, q.y0, q.s0, q.t0, state->color); - fons__vertex(stash, q.x0, q.y1, q.s0, q.t1, state->color); - fons__vertex(stash, q.x1, q.y1, q.s1, q.t1, state->color); - } - prevGlyphIndex = glyph != NULL ? glyph->index : -1; - } - fons__flush(stash); - - return x; -} - -int fonsTextIterInit(FONScontext* stash, FONStextIter* iter, - float x, float y, const char* str, const char* end, int bitmapOption) -{ - FONSstate* state = fons__getState(stash); - float width; - - memset(iter, 0, sizeof(*iter)); - - if (stash == NULL) return 0; - if (state->font < 0 || state->font >= stash->nfonts) return 0; - iter->font = stash->fonts[state->font]; - if (iter->font->data == NULL) return 0; - - iter->isize = (short)(state->size*10.0f); - iter->iblur = (short)state->blur; - iter->scale = fons__tt_getPixelHeightScale(&iter->font->font, (float)iter->isize/10.0f); - - // Align horizontally - if (state->align & FONS_ALIGN_LEFT) { - // empty - } else if (state->align & FONS_ALIGN_RIGHT) { - width = fonsTextBounds(stash, x,y, str, end, NULL); - x -= width; - } else if (state->align & FONS_ALIGN_CENTER) { - width = fonsTextBounds(stash, x,y, str, end, NULL); - x -= width * 0.5f; - } - // Align vertically. - y += fons__getVertAlign(stash, iter->font, state->align, iter->isize); - - if (end == NULL) - end = str + strlen(str); - - iter->x = iter->nextx = x; - iter->y = iter->nexty = y; - iter->spacing = state->spacing; - iter->str = str; - iter->next = str; - iter->end = end; - iter->codepoint = 0; - iter->prevGlyphIndex = -1; - iter->bitmapOption = bitmapOption; - - return 1; -} - -int fonsTextIterNext(FONScontext* stash, FONStextIter* iter, FONSquad* quad) -{ - FONSglyph* glyph = NULL; - const char* str = iter->next; - iter->str = iter->next; - - if (str == iter->end) - return 0; - - for (; str != iter->end; str++) { - if (fons__decutf8(&iter->utf8state, &iter->codepoint, *(const unsigned char*)str)) - continue; - str++; - // Get glyph and quad - iter->x = iter->nextx; - iter->y = iter->nexty; - glyph = fons__getGlyph(stash, iter->font, iter->codepoint, iter->isize, iter->iblur, iter->bitmapOption); - // If the iterator was initialized with FONS_GLYPH_BITMAP_OPTIONAL, then the UV coordinates of the quad will be invalid. - if (glyph != NULL) - fons__getQuad(stash, iter->font, iter->prevGlyphIndex, glyph, iter->scale, iter->spacing, &iter->nextx, &iter->nexty, quad); - iter->prevGlyphIndex = glyph != NULL ? glyph->index : -1; - break; - } - iter->next = str; - - return 1; -} - -void fonsDrawDebug(FONScontext* stash, float x, float y) -{ - int i; - int w = stash->params.width; - int h = stash->params.height; - float u = w == 0 ? 0 : (1.0f / w); - float v = h == 0 ? 0 : (1.0f / h); - - if (stash->nverts+6+6 > FONS_VERTEX_COUNT) - fons__flush(stash); - - // Draw background - fons__vertex(stash, x+0, y+0, u, v, 0x0fffffff); - fons__vertex(stash, x+w, y+h, u, v, 0x0fffffff); - fons__vertex(stash, x+w, y+0, u, v, 0x0fffffff); - - fons__vertex(stash, x+0, y+0, u, v, 0x0fffffff); - fons__vertex(stash, x+0, y+h, u, v, 0x0fffffff); - fons__vertex(stash, x+w, y+h, u, v, 0x0fffffff); - - // Draw texture - fons__vertex(stash, x+0, y+0, 0, 0, 0xffffffff); - fons__vertex(stash, x+w, y+h, 1, 1, 0xffffffff); - fons__vertex(stash, x+w, y+0, 1, 0, 0xffffffff); - - fons__vertex(stash, x+0, y+0, 0, 0, 0xffffffff); - fons__vertex(stash, x+0, y+h, 0, 1, 0xffffffff); - fons__vertex(stash, x+w, y+h, 1, 1, 0xffffffff); - - // Drawbug draw atlas - for (i = 0; i < stash->atlas->nnodes; i++) { - FONSatlasNode* n = &stash->atlas->nodes[i]; - - if (stash->nverts+6 > FONS_VERTEX_COUNT) - fons__flush(stash); - - fons__vertex(stash, x+n->x+0, y+n->y+0, u, v, 0xc00000ff); - fons__vertex(stash, x+n->x+n->width, y+n->y+1, u, v, 0xc00000ff); - fons__vertex(stash, x+n->x+n->width, y+n->y+0, u, v, 0xc00000ff); - - fons__vertex(stash, x+n->x+0, y+n->y+0, u, v, 0xc00000ff); - fons__vertex(stash, x+n->x+0, y+n->y+1, u, v, 0xc00000ff); - fons__vertex(stash, x+n->x+n->width, y+n->y+1, u, v, 0xc00000ff); - } - - fons__flush(stash); -} - -float fonsTextBounds(FONScontext* stash, - float x, float y, - const char* str, const char* end, - float* bounds) -{ - FONSstate* state = fons__getState(stash); - unsigned int codepoint; - unsigned int utf8state = 0; - FONSquad q; - FONSglyph* glyph = NULL; - int prevGlyphIndex = -1; - short isize = (short)(state->size*10.0f); - short iblur = (short)state->blur; - float scale; - FONSfont* font; - float startx, advance; - float minx, miny, maxx, maxy; - - if (stash == NULL) return 0; - if (state->font < 0 || state->font >= stash->nfonts) return 0; - font = stash->fonts[state->font]; - if (font->data == NULL) return 0; - - scale = fons__tt_getPixelHeightScale(&font->font, (float)isize/10.0f); - - // Align vertically. - y += fons__getVertAlign(stash, font, state->align, isize); - - minx = maxx = x; - miny = maxy = y; - startx = x; - - if (end == NULL) - end = str + strlen(str); - - for (; str != end; ++str) { - if (fons__decutf8(&utf8state, &codepoint, *(const unsigned char*)str)) - continue; - glyph = fons__getGlyph(stash, font, codepoint, isize, iblur, FONS_GLYPH_BITMAP_OPTIONAL); - if (glyph != NULL) { - fons__getQuad(stash, font, prevGlyphIndex, glyph, scale, state->spacing, &x, &y, &q); - if (q.x0 < minx) minx = q.x0; - if (q.x1 > maxx) maxx = q.x1; - if (stash->params.flags & FONS_ZERO_TOPLEFT) { - if (q.y0 < miny) miny = q.y0; - if (q.y1 > maxy) maxy = q.y1; - } else { - if (q.y1 < miny) miny = q.y1; - if (q.y0 > maxy) maxy = q.y0; - } - } - prevGlyphIndex = glyph != NULL ? glyph->index : -1; - } - - advance = x - startx; - - // Align horizontally - if (state->align & FONS_ALIGN_LEFT) { - // empty - } else if (state->align & FONS_ALIGN_RIGHT) { - minx -= advance; - maxx -= advance; - } else if (state->align & FONS_ALIGN_CENTER) { - minx -= advance * 0.5f; - maxx -= advance * 0.5f; - } - - if (bounds) { - bounds[0] = minx; - bounds[1] = miny; - bounds[2] = maxx; - bounds[3] = maxy; - } - - return advance; -} - -void fonsVertMetrics(FONScontext* stash, - float* ascender, float* descender, float* lineh) -{ - FONSfont* font; - FONSstate* state = fons__getState(stash); - short isize; - - if (stash == NULL) return; - if (state->font < 0 || state->font >= stash->nfonts) return; - font = stash->fonts[state->font]; - isize = (short)(state->size*10.0f); - if (font->data == NULL) return; - - if (ascender) - *ascender = font->ascender*isize/10.0f; - if (descender) - *descender = font->descender*isize/10.0f; - if (lineh) - *lineh = font->lineh*isize/10.0f; -} - -void fonsLineBounds(FONScontext* stash, float y, float* miny, float* maxy) -{ - FONSfont* font; - FONSstate* state = fons__getState(stash); - short isize; - - if (stash == NULL) return; - if (state->font < 0 || state->font >= stash->nfonts) return; - font = stash->fonts[state->font]; - isize = (short)(state->size*10.0f); - if (font->data == NULL) return; - - y += fons__getVertAlign(stash, font, state->align, isize); - - if (stash->params.flags & FONS_ZERO_TOPLEFT) { - *miny = y - font->ascender * (float)isize/10.0f; - *maxy = *miny + font->lineh*isize/10.0f; - } else { - *maxy = y + font->descender * (float)isize/10.0f; - *miny = *maxy - font->lineh*isize/10.0f; - } -} - -const unsigned char* fonsGetTextureData(FONScontext* stash, int* width, int* height) -{ - if (width != NULL) - *width = stash->params.width; - if (height != NULL) - *height = stash->params.height; - return stash->texData; -} - -int fonsValidateTexture(FONScontext* stash, int* dirty) -{ - if (stash->dirtyRect[0] < stash->dirtyRect[2] && stash->dirtyRect[1] < stash->dirtyRect[3]) { - dirty[0] = stash->dirtyRect[0]; - dirty[1] = stash->dirtyRect[1]; - dirty[2] = stash->dirtyRect[2]; - dirty[3] = stash->dirtyRect[3]; - // Reset dirty rect - stash->dirtyRect[0] = stash->params.width; - stash->dirtyRect[1] = stash->params.height; - stash->dirtyRect[2] = 0; - stash->dirtyRect[3] = 0; - return 1; - } - return 0; -} - -void fonsDeleteInternal(FONScontext* stash) -{ - int i; - if (stash == NULL) return; - - if (stash->params.renderDelete) - stash->params.renderDelete(stash->params.userPtr); - - for (i = 0; i < stash->nfonts; ++i) - fons__freeFont(stash->fonts[i]); - - if (stash->atlas) fons__deleteAtlas(stash->atlas); - if (stash->fonts) NVG_FREE(stash->fonts); - if (stash->texData) NVG_FREE(stash->texData); - if (stash->scratch) NVG_FREE(stash->scratch); - fons__tt_done(stash); - NVG_FREE(stash); -} - -void fonsSetErrorCallback(FONScontext* stash, void (*callback)(void* uptr, int error, int val), void* uptr) -{ - if (stash == NULL) return; - stash->handleError = callback; - stash->errorUptr = uptr; -} - -void fonsGetAtlasSize(FONScontext* stash, int* width, int* height) -{ - if (stash == NULL) return; - *width = stash->params.width; - *height = stash->params.height; -} - -int fonsExpandAtlas(FONScontext* stash, int width, int height) -{ - int i, maxy = 0; - unsigned char* data = NULL; - if (stash == NULL) return 0; - - width = fons__maxi(width, stash->params.width); - height = fons__maxi(height, stash->params.height); - - if (width == stash->params.width && height == stash->params.height) - return 1; - - // Flush pending glyphs. - fons__flush(stash); - - // Create new texture - if (stash->params.renderResize != NULL) { - if (stash->params.renderResize(stash->params.userPtr, width, height) == 0) - return 0; - } - // Copy old texture data over. - data = (unsigned char*)NVG_MALLOC(width * height); - if (data == NULL) - return 0; - for (i = 0; i < stash->params.height; i++) { - unsigned char* dst = &data[i*width]; - unsigned char* src = &stash->texData[i*stash->params.width]; - memcpy(dst, src, stash->params.width); - if (width > stash->params.width) - memset(dst+stash->params.width, 0, width - stash->params.width); - } - if (height > stash->params.height) - memset(&data[stash->params.height * width], 0, (height - stash->params.height) * width); - - NVG_FREE(stash->texData); - stash->texData = data; - - // Increase atlas size - fons__atlasExpand(stash->atlas, width, height); - - // Add existing data as dirty. - for (i = 0; i < stash->atlas->nnodes; i++) - maxy = fons__maxi(maxy, stash->atlas->nodes[i].y); - stash->dirtyRect[0] = 0; - stash->dirtyRect[1] = 0; - stash->dirtyRect[2] = stash->params.width; - stash->dirtyRect[3] = maxy; - - stash->params.width = width; - stash->params.height = height; - stash->itw = 1.0f/stash->params.width; - stash->ith = 1.0f/stash->params.height; - - return 1; -} - -int fonsResetAtlas(FONScontext* stash, int width, int height) -{ - int i, j; - if (stash == NULL) return 0; - - // Flush pending glyphs. - fons__flush(stash); - - // Create new texture - if (stash->params.renderResize != NULL) { - if (stash->params.renderResize(stash->params.userPtr, width, height) == 0) - return 0; - } - - // Reset atlas - fons__atlasReset(stash->atlas, width, height); - - // Clear texture data. - stash->texData = (unsigned char*)NVG_REALLOC(stash->texData, width * height); - if (stash->texData == NULL) return 0; - memset(stash->texData, 0, width * height); - - // Reset dirty rect - stash->dirtyRect[0] = width; - stash->dirtyRect[1] = height; - stash->dirtyRect[2] = 0; - stash->dirtyRect[3] = 0; - - // Reset cached glyphs - for (i = 0; i < stash->nfonts; i++) { - FONSfont* font = stash->fonts[i]; - font->nglyphs = 0; - for (j = 0; j < FONS_HASH_LUT_SIZE; j++) - font->lut[j] = -1; - } - - stash->params.width = width; - stash->params.height = height; - stash->itw = 1.0f/stash->params.width; - stash->ith = 1.0f/stash->params.height; - - // Add white rect at 0,0 for debug drawing. - fons__addWhiteRect(stash, 2,2); - - return 1; -} - - -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/nanosvg.h b/FCLauncher/src/main/jni/lwjgl/nanovg/nanosvg.h deleted file mode 100644 index e917a347..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/nanosvg.h +++ /dev/null @@ -1,3167 +0,0 @@ -/* - * Copyright (c) 2013-14 Mikko Mononen memon@inside.org - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - * The SVG parser is based on Anti-Grain Geometry 2.4 SVG example - * Copyright (C) 2002-2004 Maxim Shemanarev (McSeem) (http://www.antigrain.com/) - * - * Arc calculation code based on canvg (https://code.google.com/p/canvg/) - * - * Bounding box calculation based on http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html - * - */ - -#ifndef NANOSVG_H -#define NANOSVG_H - -#ifndef NANOSVG_CPLUSPLUS -#ifdef __cplusplus -extern "C" { -#endif -#endif - -// NanoSVG is a simple stupid single-header-file SVG parse. The output of the parser is a list of cubic bezier shapes. -// -// The library suits well for anything from rendering scalable icons in your editor application to prototyping a game. -// -// NanoSVG supports a wide range of SVG features, but something may be missing, feel free to create a pull request! -// -// The shapes in the SVG images are transformed by the viewBox and converted to specified units. -// That is, you should get the same looking data as your designed in your favorite app. -// -// NanoSVG can return the paths in few different units. For example if you want to render an image, you may choose -// to get the paths in pixels, or if you are feeding the data into a CNC-cutter, you may want to use millimeters. -// -// The units passed to NanoSVG should be one of: 'px', 'pt', 'pc' 'mm', 'cm', or 'in'. -// DPI (dots-per-inch) controls how the unit conversion is done. -// -// If you don't know or care about the units stuff, "px" and 96 should get you going. - - -/* Example Usage: - // Load SVG - NSVGimage* image; - image = nsvgParseFromFile("test.svg", "px", 96); - printf("size: %f x %f\n", image->width, image->height); - // Use... - for (NSVGshape *shape = image->shapes; shape != NULL; shape = shape->next) { - for (NSVGpath *path = shape->paths; path != NULL; path = path->next) { - for (int i = 0; i < path->npts-1; i += 3) { - float* p = &path->pts[i*2]; - drawCubicBez(p[0],p[1], p[2],p[3], p[4],p[5], p[6],p[7]); - } - } - } - // Delete - nsvgDelete(image); -*/ - -enum NSVGpaintType { - NSVG_PAINT_UNDEF = -1, - NSVG_PAINT_NONE = 0, - NSVG_PAINT_COLOR = 1, - NSVG_PAINT_LINEAR_GRADIENT = 2, - NSVG_PAINT_RADIAL_GRADIENT = 3 -}; - -enum NSVGspreadType { - NSVG_SPREAD_PAD = 0, - NSVG_SPREAD_REFLECT = 1, - NSVG_SPREAD_REPEAT = 2 -}; - -enum NSVGlineJoin { - NSVG_JOIN_MITER = 0, - NSVG_JOIN_ROUND = 1, - NSVG_JOIN_BEVEL = 2 -}; - -enum NSVGlineCap { - NSVG_CAP_BUTT = 0, - NSVG_CAP_ROUND = 1, - NSVG_CAP_SQUARE = 2 -}; - -enum NSVGfillRule { - NSVG_FILLRULE_NONZERO = 0, - NSVG_FILLRULE_EVENODD = 1 -}; - -enum NSVGflags { - NSVG_FLAGS_VISIBLE = 0x01 -}; - -typedef struct NSVGgradientStop { - unsigned int color; - float offset; -} NSVGgradientStop; - -typedef struct NSVGgradient { - float xform[6]; - char spread; - float fx, fy; - int nstops; - NSVGgradientStop stops[1]; -} NSVGgradient; - -typedef struct NSVGpaint { - signed char type; - union { - unsigned int color; - NSVGgradient* gradient; - }; -} NSVGpaint; - -typedef struct NSVGpath -{ - float* pts; // Cubic bezier points: x0,y0, [cpx1,cpx1,cpx2,cpy2,x1,y1], ... - int npts; // Total number of bezier points. - char closed; // Flag indicating if shapes should be treated as closed. - float bounds[4]; // Tight bounding box of the shape [minx,miny,maxx,maxy]. - struct NSVGpath* next; // Pointer to next path, or NULL if last element. -} NSVGpath; - -typedef struct NSVGshape -{ - char id[64]; // Optional 'id' attr of the shape or its group - NSVGpaint fill; // Fill paint - NSVGpaint stroke; // Stroke paint - float opacity; // Opacity of the shape. - float strokeWidth; // Stroke width (scaled). - float strokeDashOffset; // Stroke dash offset (scaled). - float strokeDashArray[8]; // Stroke dash array (scaled). - char strokeDashCount; // Number of dash values in dash array. - char strokeLineJoin; // Stroke join type. - char strokeLineCap; // Stroke cap type. - float miterLimit; // Miter limit - char fillRule; // Fill rule, see NSVGfillRule. - unsigned char flags; // Logical or of NSVG_FLAGS_* flags - float bounds[4]; // Tight bounding box of the shape [minx,miny,maxx,maxy]. - char fillGradient[64]; // Optional 'id' of fill gradient - char strokeGradient[64]; // Optional 'id' of stroke gradient - float xform[6]; // Root transformation for fill/stroke gradient - NSVGpath* paths; // Linked list of paths in the image. - struct NSVGshape* next; // Pointer to next shape, or NULL if last element. -} NSVGshape; - -typedef struct NSVGimage -{ - float width; // Width of the image. - float height; // Height of the image. - NSVGshape* shapes; // Linked list of shapes in the image. -} NSVGimage; - -// Parses SVG file from a file, returns SVG image as paths. -NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi); - -// Parses SVG file from a null terminated string, returns SVG image as paths. -// Important note: changes the string. -NSVGimage* nsvgParse(char* input, const char* units, float dpi); - -// Duplicates a path. -NSVGpath* nsvgDuplicatePath(NSVGpath* p); - -// Deletes an image. -void nsvgDelete(NSVGimage* image); - -#ifndef NANOSVG_CPLUSPLUS -#ifdef __cplusplus -} -#endif -#endif - -#ifdef NANOSVG_IMPLEMENTATION - -#include -#include -#include -#include - -#define NSVG_PI (3.14159265358979323846264338327f) -#define NSVG_KAPPA90 (0.5522847493f) // Length proportional to radius of a cubic bezier handle for 90deg arcs. - -#define NSVG_ALIGN_MIN 0 -#define NSVG_ALIGN_MID 1 -#define NSVG_ALIGN_MAX 2 -#define NSVG_ALIGN_NONE 0 -#define NSVG_ALIGN_MEET 1 -#define NSVG_ALIGN_SLICE 2 - -#define NSVG_NOTUSED(v) do { (void)(1 ? (void)0 : ( (void)(v) ) ); } while(0) -#define NSVG_RGB(r, g, b) (((unsigned int)r) | ((unsigned int)g << 8) | ((unsigned int)b << 16)) -#define NSVG_RGBA(r, g, b, a) (((unsigned int)r) | ((unsigned int)g << 8) | ((unsigned int)b << 16) | ((unsigned int)a << 24)) - -#ifdef _MSC_VER - #pragma warning (disable: 4996) // Switch off security warnings - #pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings - #ifdef __cplusplus - #define NSVG_INLINE inline - #else - #define NSVG_INLINE - #endif -#else - #define NSVG_INLINE inline -#endif - - -static int nsvg__isspace(char c) -{ - return strchr(" \t\n\v\f\r", c) != 0; -} - -static int nsvg__isdigit(char c) -{ - return c >= '0' && c <= '9'; -} - -static NSVG_INLINE float nsvg__minf(float a, float b) { return a < b ? a : b; } -static NSVG_INLINE float nsvg__maxf(float a, float b) { return a > b ? a : b; } - - -// Simple XML parser - -#define NSVG_XML_TAG 1 -#define NSVG_XML_CONTENT 2 -#define NSVG_XML_MAX_ATTRIBS 256 - -static void nsvg__parseContent(char* s, - void (*contentCb)(void* ud, const char* s), - void* ud) -{ - // Trim start white spaces - while (*s && nsvg__isspace(*s)) s++; - if (!*s) return; - - if (contentCb) - (*contentCb)(ud, s); -} - -static void nsvg__parseElement(char* s, - void (*startelCb)(void* ud, const char* el, const char** attr), - void (*endelCb)(void* ud, const char* el), - void* ud) -{ - const char* attr[NSVG_XML_MAX_ATTRIBS]; - int nattr = 0; - char* name; - int start = 0; - int end = 0; - char quote; - - // Skip white space after the '<' - while (*s && nsvg__isspace(*s)) s++; - - // Check if the tag is end tag - if (*s == '/') { - s++; - end = 1; - } else { - start = 1; - } - - // Skip comments, data and preprocessor stuff. - if (!*s || *s == '?' || *s == '!') - return; - - // Get tag name - name = s; - while (*s && !nsvg__isspace(*s)) s++; - if (*s) { *s++ = '\0'; } - - // Get attribs - while (!end && *s && nattr < NSVG_XML_MAX_ATTRIBS-3) { - char* name = NULL; - char* value = NULL; - - // Skip white space before the attrib name - while (*s && nsvg__isspace(*s)) s++; - if (!*s) break; - if (*s == '/') { - end = 1; - break; - } - name = s; - // Find end of the attrib name. - while (*s && !nsvg__isspace(*s) && *s != '=') s++; - if (*s) { *s++ = '\0'; } - // Skip until the beginning of the value. - while (*s && *s != '\"' && *s != '\'') s++; - if (!*s) break; - quote = *s; - s++; - // Store value and find the end of it. - value = s; - while (*s && *s != quote) s++; - if (*s) { *s++ = '\0'; } - - // Store only well formed attributes - if (name && value) { - attr[nattr++] = name; - attr[nattr++] = value; - } - } - - // List terminator - attr[nattr++] = 0; - attr[nattr++] = 0; - - // Call callbacks. - if (start && startelCb) - (*startelCb)(ud, name, attr); - if (end && endelCb) - (*endelCb)(ud, name); -} - -int nsvg__parseXML(char* input, - void (*startelCb)(void* ud, const char* el, const char** attr), - void (*endelCb)(void* ud, const char* el), - void (*contentCb)(void* ud, const char* s), - void* ud) -{ - char* s = input; - char* mark = s; - int state = NSVG_XML_CONTENT; - while (*s) { - if (*s == '<' && state == NSVG_XML_CONTENT) { - // Start of a tag - *s++ = '\0'; - nsvg__parseContent(mark, contentCb, ud); - mark = s; - state = NSVG_XML_TAG; - } else if (*s == '>' && state == NSVG_XML_TAG) { - // Start of a content or new tag. - *s++ = '\0'; - nsvg__parseElement(mark, startelCb, endelCb, ud); - mark = s; - state = NSVG_XML_CONTENT; - } else { - s++; - } - } - - return 1; -} - - -/* Simple SVG parser. */ - -#define NSVG_MAX_ATTR 128 - -enum NSVGgradientUnits { - NSVG_USER_SPACE = 0, - NSVG_OBJECT_SPACE = 1 -}; - -#define NSVG_MAX_DASHES 8 - -enum NSVGunits { - NSVG_UNITS_USER, - NSVG_UNITS_PX, - NSVG_UNITS_PT, - NSVG_UNITS_PC, - NSVG_UNITS_MM, - NSVG_UNITS_CM, - NSVG_UNITS_IN, - NSVG_UNITS_PERCENT, - NSVG_UNITS_EM, - NSVG_UNITS_EX -}; - -typedef struct NSVGcoordinate { - float value; - int units; -} NSVGcoordinate; - -typedef struct NSVGlinearData { - NSVGcoordinate x1, y1, x2, y2; -} NSVGlinearData; - -typedef struct NSVGradialData { - NSVGcoordinate cx, cy, r, fx, fy; -} NSVGradialData; - -typedef struct NSVGgradientData -{ - char id[64]; - char ref[64]; - signed char type; - union { - NSVGlinearData linear; - NSVGradialData radial; - }; - char spread; - char units; - float xform[6]; - int nstops; - NSVGgradientStop* stops; - struct NSVGgradientData* next; -} NSVGgradientData; - -typedef struct NSVGattrib -{ - char id[64]; - float xform[6]; - unsigned int fillColor; - unsigned int strokeColor; - float opacity; - float fillOpacity; - float strokeOpacity; - char fillGradient[64]; - char strokeGradient[64]; - float strokeWidth; - float strokeDashOffset; - float strokeDashArray[NSVG_MAX_DASHES]; - int strokeDashCount; - char strokeLineJoin; - char strokeLineCap; - float miterLimit; - char fillRule; - float fontSize; - unsigned int stopColor; - float stopOpacity; - float stopOffset; - char hasFill; - char hasStroke; - char visible; -} NSVGattrib; - -typedef struct NSVGparser -{ - NSVGattrib attr[NSVG_MAX_ATTR]; - int attrHead; - float* pts; - int npts; - int cpts; - NSVGpath* plist; - NSVGimage* image; - NSVGgradientData* gradients; - NSVGshape* shapesTail; - float viewMinx, viewMiny, viewWidth, viewHeight; - int alignX, alignY, alignType; - float dpi; - char pathFlag; - char defsFlag; -} NSVGparser; - -static void nsvg__xformIdentity(float* t) -{ - t[0] = 1.0f; t[1] = 0.0f; - t[2] = 0.0f; t[3] = 1.0f; - t[4] = 0.0f; t[5] = 0.0f; -} - -static void nsvg__xformSetTranslation(float* t, float tx, float ty) -{ - t[0] = 1.0f; t[1] = 0.0f; - t[2] = 0.0f; t[3] = 1.0f; - t[4] = tx; t[5] = ty; -} - -static void nsvg__xformSetScale(float* t, float sx, float sy) -{ - t[0] = sx; t[1] = 0.0f; - t[2] = 0.0f; t[3] = sy; - t[4] = 0.0f; t[5] = 0.0f; -} - -static void nsvg__xformSetSkewX(float* t, float a) -{ - t[0] = 1.0f; t[1] = 0.0f; - t[2] = tanf(a); t[3] = 1.0f; - t[4] = 0.0f; t[5] = 0.0f; -} - -static void nsvg__xformSetSkewY(float* t, float a) -{ - t[0] = 1.0f; t[1] = tanf(a); - t[2] = 0.0f; t[3] = 1.0f; - t[4] = 0.0f; t[5] = 0.0f; -} - -static void nsvg__xformSetRotation(float* t, float a) -{ - float cs = cosf(a), sn = sinf(a); - t[0] = cs; t[1] = sn; - t[2] = -sn; t[3] = cs; - t[4] = 0.0f; t[5] = 0.0f; -} - -static void nsvg__xformMultiply(float* t, float* s) -{ - float t0 = t[0] * s[0] + t[1] * s[2]; - float t2 = t[2] * s[0] + t[3] * s[2]; - float t4 = t[4] * s[0] + t[5] * s[2] + s[4]; - t[1] = t[0] * s[1] + t[1] * s[3]; - t[3] = t[2] * s[1] + t[3] * s[3]; - t[5] = t[4] * s[1] + t[5] * s[3] + s[5]; - t[0] = t0; - t[2] = t2; - t[4] = t4; -} - -static void nsvg__xformInverse(float* inv, float* t) -{ - double invdet, det = (double)t[0] * t[3] - (double)t[2] * t[1]; - if (det > -1e-6 && det < 1e-6) { - nsvg__xformIdentity(t); - return; - } - invdet = 1.0 / det; - inv[0] = (float)(t[3] * invdet); - inv[2] = (float)(-t[2] * invdet); - inv[4] = (float)(((double)t[2] * t[5] - (double)t[3] * t[4]) * invdet); - inv[1] = (float)(-t[1] * invdet); - inv[3] = (float)(t[0] * invdet); - inv[5] = (float)(((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet); -} - -static void nsvg__xformPremultiply(float* t, float* s) -{ - float s2[6]; - memcpy(s2, s, sizeof(float)*6); - nsvg__xformMultiply(s2, t); - memcpy(t, s2, sizeof(float)*6); -} - -static void nsvg__xformPoint(float* dx, float* dy, float x, float y, float* t) -{ - *dx = x*t[0] + y*t[2] + t[4]; - *dy = x*t[1] + y*t[3] + t[5]; -} - -static void nsvg__xformVec(float* dx, float* dy, float x, float y, float* t) -{ - *dx = x*t[0] + y*t[2]; - *dy = x*t[1] + y*t[3]; -} - -#define NSVG_EPSILON (1e-12) - -static int nsvg__ptInBounds(float* pt, float* bounds) -{ - return pt[0] >= bounds[0] && pt[0] <= bounds[2] && pt[1] >= bounds[1] && pt[1] <= bounds[3]; -} - - -static double nsvg__evalBezier(double t, double p0, double p1, double p2, double p3) -{ - double it = 1.0-t; - return it*it*it*p0 + 3.0*it*it*t*p1 + 3.0*it*t*t*p2 + t*t*t*p3; -} - -static void nsvg__curveBounds(float* bounds, float* curve) -{ - int i, j, count; - double roots[2], a, b, c, b2ac, t, v; - float* v0 = &curve[0]; - float* v1 = &curve[2]; - float* v2 = &curve[4]; - float* v3 = &curve[6]; - - // Start the bounding box by end points - bounds[0] = nsvg__minf(v0[0], v3[0]); - bounds[1] = nsvg__minf(v0[1], v3[1]); - bounds[2] = nsvg__maxf(v0[0], v3[0]); - bounds[3] = nsvg__maxf(v0[1], v3[1]); - - // Bezier curve fits inside the convex hull of it's control points. - // If control points are inside the bounds, we're done. - if (nsvg__ptInBounds(v1, bounds) && nsvg__ptInBounds(v2, bounds)) - return; - - // Add bezier curve inflection points in X and Y. - for (i = 0; i < 2; i++) { - a = -3.0 * v0[i] + 9.0 * v1[i] - 9.0 * v2[i] + 3.0 * v3[i]; - b = 6.0 * v0[i] - 12.0 * v1[i] + 6.0 * v2[i]; - c = 3.0 * v1[i] - 3.0 * v0[i]; - count = 0; - if (fabs(a) < NSVG_EPSILON) { - if (fabs(b) > NSVG_EPSILON) { - t = -c / b; - if (t > NSVG_EPSILON && t < 1.0-NSVG_EPSILON) - roots[count++] = t; - } - } else { - b2ac = b*b - 4.0*c*a; - if (b2ac > NSVG_EPSILON) { - t = (-b + sqrt(b2ac)) / (2.0 * a); - if (t > NSVG_EPSILON && t < 1.0-NSVG_EPSILON) - roots[count++] = t; - t = (-b - sqrt(b2ac)) / (2.0 * a); - if (t > NSVG_EPSILON && t < 1.0-NSVG_EPSILON) - roots[count++] = t; - } - } - for (j = 0; j < count; j++) { - v = nsvg__evalBezier(roots[j], v0[i], v1[i], v2[i], v3[i]); - bounds[0+i] = nsvg__minf(bounds[0+i], (float)v); - bounds[2+i] = nsvg__maxf(bounds[2+i], (float)v); - } - } -} - -static NSVGparser* nsvg__createParser(void) -{ - NSVGparser* p; - p = (NSVGparser*)NVG_MALLOC(sizeof(NSVGparser)); - if (p == NULL) goto error; - memset(p, 0, sizeof(NSVGparser)); - - p->image = (NSVGimage*)NVG_MALLOC(sizeof(NSVGimage)); - if (p->image == NULL) goto error; - memset(p->image, 0, sizeof(NSVGimage)); - - // Init style - nsvg__xformIdentity(p->attr[0].xform); - memset(p->attr[0].id, 0, sizeof p->attr[0].id); - p->attr[0].fillColor = NSVG_RGB(0,0,0); - p->attr[0].strokeColor = NSVG_RGB(0,0,0); - p->attr[0].opacity = 1; - p->attr[0].fillOpacity = 1; - p->attr[0].strokeOpacity = 1; - p->attr[0].stopOpacity = 1; - p->attr[0].strokeWidth = 1; - p->attr[0].strokeLineJoin = NSVG_JOIN_MITER; - p->attr[0].strokeLineCap = NSVG_CAP_BUTT; - p->attr[0].miterLimit = 4; - p->attr[0].fillRule = NSVG_FILLRULE_NONZERO; - p->attr[0].hasFill = 1; - p->attr[0].visible = 1; - - return p; - -error: - if (p) { - if (p->image) NVG_FREE(p->image); - NVG_FREE(p); - } - return NULL; -} - -static void nsvg__deletePaths(NSVGpath* path) -{ - while (path) { - NSVGpath *next = path->next; - if (path->pts != NULL) - NVG_FREE(path->pts); - NVG_FREE(path); - path = next; - } -} - -static void nsvg__deletePaint(NSVGpaint* paint) -{ - if (paint->type == NSVG_PAINT_LINEAR_GRADIENT || paint->type == NSVG_PAINT_RADIAL_GRADIENT) - NVG_FREE(paint->gradient); -} - -static void nsvg__deleteGradientData(NSVGgradientData* grad) -{ - NSVGgradientData* next; - while (grad != NULL) { - next = grad->next; - NVG_FREE(grad->stops); - NVG_FREE(grad); - grad = next; - } -} - -static void nsvg__deleteParser(NSVGparser* p) -{ - if (p != NULL) { - nsvg__deletePaths(p->plist); - nsvg__deleteGradientData(p->gradients); - nsvgDelete(p->image); - NVG_FREE(p->pts); - NVG_FREE(p); - } -} - -static void nsvg__resetPath(NSVGparser* p) -{ - p->npts = 0; -} - -static void nsvg__addPoint(NSVGparser* p, float x, float y) -{ - if (p->npts+1 > p->cpts) { - p->cpts = p->cpts ? p->cpts*2 : 8; - p->pts = (float*)NVG_REALLOC(p->pts, p->cpts*2*sizeof(float)); - if (!p->pts) return; - } - p->pts[p->npts*2+0] = x; - p->pts[p->npts*2+1] = y; - p->npts++; -} - -static void nsvg__moveTo(NSVGparser* p, float x, float y) -{ - if (p->npts > 0) { - p->pts[(p->npts-1)*2+0] = x; - p->pts[(p->npts-1)*2+1] = y; - } else { - nsvg__addPoint(p, x, y); - } -} - -static void nsvg__lineTo(NSVGparser* p, float x, float y) -{ - float px,py, dx,dy; - if (p->npts > 0) { - px = p->pts[(p->npts-1)*2+0]; - py = p->pts[(p->npts-1)*2+1]; - dx = x - px; - dy = y - py; - nsvg__addPoint(p, px + dx/3.0f, py + dy/3.0f); - nsvg__addPoint(p, x - dx/3.0f, y - dy/3.0f); - nsvg__addPoint(p, x, y); - } -} - -static void nsvg__cubicBezTo(NSVGparser* p, float cpx1, float cpy1, float cpx2, float cpy2, float x, float y) -{ - if (p->npts > 0) { - nsvg__addPoint(p, cpx1, cpy1); - nsvg__addPoint(p, cpx2, cpy2); - nsvg__addPoint(p, x, y); - } -} - -static NSVGattrib* nsvg__getAttr(NSVGparser* p) -{ - return &p->attr[p->attrHead]; -} - -static void nsvg__pushAttr(NSVGparser* p) -{ - if (p->attrHead < NSVG_MAX_ATTR-1) { - p->attrHead++; - memcpy(&p->attr[p->attrHead], &p->attr[p->attrHead-1], sizeof(NSVGattrib)); - } -} - -static void nsvg__popAttr(NSVGparser* p) -{ - if (p->attrHead > 0) - p->attrHead--; -} - -static float nsvg__actualOrigX(NSVGparser* p) -{ - return p->viewMinx; -} - -static float nsvg__actualOrigY(NSVGparser* p) -{ - return p->viewMiny; -} - -static float nsvg__actualWidth(NSVGparser* p) -{ - return p->viewWidth; -} - -static float nsvg__actualHeight(NSVGparser* p) -{ - return p->viewHeight; -} - -static float nsvg__actualLength(NSVGparser* p) -{ - float w = nsvg__actualWidth(p), h = nsvg__actualHeight(p); - return sqrtf(w*w + h*h) / sqrtf(2.0f); -} - -static float nsvg__convertToPixels(NSVGparser* p, NSVGcoordinate c, float orig, float length) -{ - NSVGattrib* attr = nsvg__getAttr(p); - switch (c.units) { - case NSVG_UNITS_USER: return c.value; - case NSVG_UNITS_PX: return c.value; - case NSVG_UNITS_PT: return c.value / 72.0f * p->dpi; - case NSVG_UNITS_PC: return c.value / 6.0f * p->dpi; - case NSVG_UNITS_MM: return c.value / 25.4f * p->dpi; - case NSVG_UNITS_CM: return c.value / 2.54f * p->dpi; - case NSVG_UNITS_IN: return c.value * p->dpi; - case NSVG_UNITS_EM: return c.value * attr->fontSize; - case NSVG_UNITS_EX: return c.value * attr->fontSize * 0.52f; // x-height of Helvetica. - case NSVG_UNITS_PERCENT: return orig + c.value / 100.0f * length; - default: return c.value; - } - return c.value; -} - -static NSVGgradientData* nsvg__findGradientData(NSVGparser* p, const char* id) -{ - NSVGgradientData* grad = p->gradients; - if (id == NULL || *id == '\0') - return NULL; - while (grad != NULL) { - if (strcmp(grad->id, id) == 0) - return grad; - grad = grad->next; - } - return NULL; -} - -static NSVGgradient* nsvg__createGradient(NSVGparser* p, const char* id, const float* localBounds, float *xform, signed char* paintType) -{ - NSVGgradientData* data = NULL; - NSVGgradientData* ref = NULL; - NSVGgradientStop* stops = NULL; - NSVGgradient* grad; - float ox, oy, sw, sh, sl; - int nstops = 0; - int refIter; - - data = nsvg__findGradientData(p, id); - if (data == NULL) return NULL; - - // TODO: use ref to fill in all unset values too. - ref = data; - refIter = 0; - while (ref != NULL) { - NSVGgradientData* nextRef = NULL; - if (stops == NULL && ref->stops != NULL) { - stops = ref->stops; - nstops = ref->nstops; - break; - } - nextRef = nsvg__findGradientData(p, ref->ref); - if (nextRef == ref) break; // prevent infite loops on malformed data - ref = nextRef; - refIter++; - if (refIter > 32) break; // prevent infite loops on malformed data - } - if (stops == NULL) return NULL; - - grad = (NSVGgradient*)NVG_MALLOC(sizeof(NSVGgradient) + sizeof(NSVGgradientStop)*(nstops-1)); - if (grad == NULL) return NULL; - - // The shape width and height. - if (data->units == NSVG_OBJECT_SPACE) { - ox = localBounds[0]; - oy = localBounds[1]; - sw = localBounds[2] - localBounds[0]; - sh = localBounds[3] - localBounds[1]; - } else { - ox = nsvg__actualOrigX(p); - oy = nsvg__actualOrigY(p); - sw = nsvg__actualWidth(p); - sh = nsvg__actualHeight(p); - } - sl = sqrtf(sw*sw + sh*sh) / sqrtf(2.0f); - - if (data->type == NSVG_PAINT_LINEAR_GRADIENT) { - float x1, y1, x2, y2, dx, dy; - x1 = nsvg__convertToPixels(p, data->linear.x1, ox, sw); - y1 = nsvg__convertToPixels(p, data->linear.y1, oy, sh); - x2 = nsvg__convertToPixels(p, data->linear.x2, ox, sw); - y2 = nsvg__convertToPixels(p, data->linear.y2, oy, sh); - // Calculate transform aligned to the line - dx = x2 - x1; - dy = y2 - y1; - grad->xform[0] = dy; grad->xform[1] = -dx; - grad->xform[2] = dx; grad->xform[3] = dy; - grad->xform[4] = x1; grad->xform[5] = y1; - } else { - float cx, cy, fx, fy, r; - cx = nsvg__convertToPixels(p, data->radial.cx, ox, sw); - cy = nsvg__convertToPixels(p, data->radial.cy, oy, sh); - fx = nsvg__convertToPixels(p, data->radial.fx, ox, sw); - fy = nsvg__convertToPixels(p, data->radial.fy, oy, sh); - r = nsvg__convertToPixels(p, data->radial.r, 0, sl); - // Calculate transform aligned to the circle - grad->xform[0] = r; grad->xform[1] = 0; - grad->xform[2] = 0; grad->xform[3] = r; - grad->xform[4] = cx; grad->xform[5] = cy; - grad->fx = (fx - cx) / r; - grad->fy = (fy - cy) / r; - } - - nsvg__xformMultiply(grad->xform, data->xform); - nsvg__xformMultiply(grad->xform, xform); - - grad->spread = data->spread; - memcpy(grad->stops, stops, nstops*sizeof(NSVGgradientStop)); - grad->nstops = nstops; - - *paintType = data->type; - - return grad; -} - -static float nsvg__getAverageScale(float* t) -{ - float sx = sqrtf(t[0]*t[0] + t[2]*t[2]); - float sy = sqrtf(t[1]*t[1] + t[3]*t[3]); - return (sx + sy) * 0.5f; -} - -static void nsvg__getLocalBounds(float* bounds, NSVGshape *shape, float* xform) -{ - NSVGpath* path; - float curve[4*2], curveBounds[4]; - int i, first = 1; - for (path = shape->paths; path != NULL; path = path->next) { - nsvg__xformPoint(&curve[0], &curve[1], path->pts[0], path->pts[1], xform); - for (i = 0; i < path->npts-1; i += 3) { - nsvg__xformPoint(&curve[2], &curve[3], path->pts[(i+1)*2], path->pts[(i+1)*2+1], xform); - nsvg__xformPoint(&curve[4], &curve[5], path->pts[(i+2)*2], path->pts[(i+2)*2+1], xform); - nsvg__xformPoint(&curve[6], &curve[7], path->pts[(i+3)*2], path->pts[(i+3)*2+1], xform); - nsvg__curveBounds(curveBounds, curve); - if (first) { - bounds[0] = curveBounds[0]; - bounds[1] = curveBounds[1]; - bounds[2] = curveBounds[2]; - bounds[3] = curveBounds[3]; - first = 0; - } else { - bounds[0] = nsvg__minf(bounds[0], curveBounds[0]); - bounds[1] = nsvg__minf(bounds[1], curveBounds[1]); - bounds[2] = nsvg__maxf(bounds[2], curveBounds[2]); - bounds[3] = nsvg__maxf(bounds[3], curveBounds[3]); - } - curve[0] = curve[6]; - curve[1] = curve[7]; - } - } -} - -static void nsvg__addShape(NSVGparser* p) -{ - NSVGattrib* attr = nsvg__getAttr(p); - float scale = 1.0f; - NSVGshape* shape; - NSVGpath* path; - int i; - - if (p->plist == NULL) - return; - - shape = (NSVGshape*)NVG_MALLOC(sizeof(NSVGshape)); - if (shape == NULL) goto error; - memset(shape, 0, sizeof(NSVGshape)); - - memcpy(shape->id, attr->id, sizeof shape->id); - memcpy(shape->fillGradient, attr->fillGradient, sizeof shape->fillGradient); - memcpy(shape->strokeGradient, attr->strokeGradient, sizeof shape->strokeGradient); - memcpy(shape->xform, attr->xform, sizeof shape->xform); - scale = nsvg__getAverageScale(attr->xform); - shape->strokeWidth = attr->strokeWidth * scale; - shape->strokeDashOffset = attr->strokeDashOffset * scale; - shape->strokeDashCount = (char)attr->strokeDashCount; - for (i = 0; i < attr->strokeDashCount; i++) - shape->strokeDashArray[i] = attr->strokeDashArray[i] * scale; - shape->strokeLineJoin = attr->strokeLineJoin; - shape->strokeLineCap = attr->strokeLineCap; - shape->miterLimit = attr->miterLimit; - shape->fillRule = attr->fillRule; - shape->opacity = attr->opacity; - - shape->paths = p->plist; - p->plist = NULL; - - // Calculate shape bounds - shape->bounds[0] = shape->paths->bounds[0]; - shape->bounds[1] = shape->paths->bounds[1]; - shape->bounds[2] = shape->paths->bounds[2]; - shape->bounds[3] = shape->paths->bounds[3]; - for (path = shape->paths->next; path != NULL; path = path->next) { - shape->bounds[0] = nsvg__minf(shape->bounds[0], path->bounds[0]); - shape->bounds[1] = nsvg__minf(shape->bounds[1], path->bounds[1]); - shape->bounds[2] = nsvg__maxf(shape->bounds[2], path->bounds[2]); - shape->bounds[3] = nsvg__maxf(shape->bounds[3], path->bounds[3]); - } - - // Set fill - if (attr->hasFill == 0) { - shape->fill.type = NSVG_PAINT_NONE; - } else if (attr->hasFill == 1) { - shape->fill.type = NSVG_PAINT_COLOR; - shape->fill.color = attr->fillColor; - shape->fill.color |= (unsigned int)(attr->fillOpacity*255) << 24; - } else if (attr->hasFill == 2) { - shape->fill.type = NSVG_PAINT_UNDEF; - } - - // Set stroke - if (attr->hasStroke == 0) { - shape->stroke.type = NSVG_PAINT_NONE; - } else if (attr->hasStroke == 1) { - shape->stroke.type = NSVG_PAINT_COLOR; - shape->stroke.color = attr->strokeColor; - shape->stroke.color |= (unsigned int)(attr->strokeOpacity*255) << 24; - } else if (attr->hasStroke == 2) { - shape->stroke.type = NSVG_PAINT_UNDEF; - } - - // Set flags - shape->flags = (attr->visible ? NSVG_FLAGS_VISIBLE : 0x00); - - // Add to tail - if (p->image->shapes == NULL) - p->image->shapes = shape; - else - p->shapesTail->next = shape; - p->shapesTail = shape; - - return; - -error: - if (shape) NVG_FREE(shape); -} - -static void nsvg__addPath(NSVGparser* p, char closed) -{ - NSVGattrib* attr = nsvg__getAttr(p); - NSVGpath* path = NULL; - float bounds[4]; - float* curve; - int i; - - if (p->npts < 4) - return; - - if (closed) - nsvg__lineTo(p, p->pts[0], p->pts[1]); - - // Expect 1 + N*3 points (N = number of cubic bezier segments). - if ((p->npts % 3) != 1) - return; - - path = (NSVGpath*)NVG_MALLOC(sizeof(NSVGpath)); - if (path == NULL) goto error; - memset(path, 0, sizeof(NSVGpath)); - - path->pts = (float*)NVG_MALLOC(p->npts*2*sizeof(float)); - if (path->pts == NULL) goto error; - path->closed = closed; - path->npts = p->npts; - - // Transform path. - for (i = 0; i < p->npts; ++i) - nsvg__xformPoint(&path->pts[i*2], &path->pts[i*2+1], p->pts[i*2], p->pts[i*2+1], attr->xform); - - // Find bounds - for (i = 0; i < path->npts-1; i += 3) { - curve = &path->pts[i*2]; - nsvg__curveBounds(bounds, curve); - if (i == 0) { - path->bounds[0] = bounds[0]; - path->bounds[1] = bounds[1]; - path->bounds[2] = bounds[2]; - path->bounds[3] = bounds[3]; - } else { - path->bounds[0] = nsvg__minf(path->bounds[0], bounds[0]); - path->bounds[1] = nsvg__minf(path->bounds[1], bounds[1]); - path->bounds[2] = nsvg__maxf(path->bounds[2], bounds[2]); - path->bounds[3] = nsvg__maxf(path->bounds[3], bounds[3]); - } - } - - path->next = p->plist; - p->plist = path; - - return; - -error: - if (path != NULL) { - if (path->pts != NULL) NVG_FREE(path->pts); - NVG_FREE(path); - } -} - -// We roll our own string to float because the std library one uses locale and messes things up. -static double nsvg__atof(const char* s) -{ - char* cur = (char*)s; - char* end = NULL; - double res = 0.0, sign = 1.0; - long long intPart = 0, fracPart = 0; - char hasIntPart = 0, hasFracPart = 0; - - // Parse optional sign - if (*cur == '+') { - cur++; - } else if (*cur == '-') { - sign = -1; - cur++; - } - - // Parse integer part - if (nsvg__isdigit(*cur)) { - // Parse digit sequence - intPart = strtoll(cur, &end, 10); - if (cur != end) { - res = (double)intPart; - hasIntPart = 1; - cur = end; - } - } - - // Parse fractional part. - if (*cur == '.') { - cur++; // Skip '.' - if (nsvg__isdigit(*cur)) { - // Parse digit sequence - fracPart = strtoll(cur, &end, 10); - if (cur != end) { - res += (double)fracPart / pow(10.0, (double)(end - cur)); - hasFracPart = 1; - cur = end; - } - } - } - - // A valid number should have integer or fractional part. - if (!hasIntPart && !hasFracPart) - return 0.0; - - // Parse optional exponent - if (*cur == 'e' || *cur == 'E') { - long expPart = 0; - cur++; // skip 'E' - expPart = strtol(cur, &end, 10); // Parse digit sequence with sign - if (cur != end) { - res *= pow(10.0, (double)expPart); - } - } - - return res * sign; -} - - -static const char* nsvg__parseNumber(const char* s, char* it, const int size) -{ - const int last = size-1; - int i = 0; - - // sign - if (*s == '-' || *s == '+') { - if (i < last) it[i++] = *s; - s++; - } - // integer part - while (*s && nsvg__isdigit(*s)) { - if (i < last) it[i++] = *s; - s++; - } - if (*s == '.') { - // decimal point - if (i < last) it[i++] = *s; - s++; - // fraction part - while (*s && nsvg__isdigit(*s)) { - if (i < last) it[i++] = *s; - s++; - } - } - // exponent - if ((*s == 'e' || *s == 'E') && (s[1] != 'm' && s[1] != 'x')) { - if (i < last) it[i++] = *s; - s++; - if (*s == '-' || *s == '+') { - if (i < last) it[i++] = *s; - s++; - } - while (*s && nsvg__isdigit(*s)) { - if (i < last) it[i++] = *s; - s++; - } - } - it[i] = '\0'; - - return s; -} - -static const char* nsvg__getNextPathItemWhenArcFlag(const char* s, char* it) -{ - it[0] = '\0'; - while (*s && (nsvg__isspace(*s) || *s == ',')) s++; - if (!*s) return s; - if (*s == '0' || *s == '1') { - it[0] = *s++; - it[1] = '\0'; - return s; - } - return s; -} - -static const char* nsvg__getNextPathItem(const char* s, char* it) -{ - it[0] = '\0'; - // Skip white spaces and commas - while (*s && (nsvg__isspace(*s) || *s == ',')) s++; - if (!*s) return s; - if (*s == '-' || *s == '+' || *s == '.' || nsvg__isdigit(*s)) { - s = nsvg__parseNumber(s, it, 64); - } else { - // Parse command - it[0] = *s++; - it[1] = '\0'; - return s; - } - - return s; -} - -static unsigned int nsvg__parseColorHex(const char* str) -{ - unsigned int r=0, g=0, b=0; - if (sscanf(str, "#%2x%2x%2x", &r, &g, &b) == 3 ) // 2 digit hex - return NSVG_RGB(r, g, b); - if (sscanf(str, "#%1x%1x%1x", &r, &g, &b) == 3 ) // 1 digit hex, e.g. #abc -> 0xccbbaa - return NSVG_RGB(r*17, g*17, b*17); // same effect as (r<<4|r), (g<<4|g), .. - return NSVG_RGB(128, 128, 128); -} - -// Parse rgb color. The pointer 'str' must point at "rgb(" (4+ characters). -// This function returns gray (rgb(128, 128, 128) == '#808080') on parse errors -// for backwards compatibility. Note: other image viewers return black instead. - -static unsigned int nsvg__parseColorRGB(const char* str) -{ - int i; - unsigned int rgbi[3]; - float rgbf[3]; - // try decimal integers first - if (sscanf(str, "rgb(%u, %u, %u)", &rgbi[0], &rgbi[1], &rgbi[2]) != 3) { - // integers failed, try percent values (float, locale independent) - const char delimiter[3] = {',', ',', ')'}; - str += 4; // skip "rgb(" - for (i = 0; i < 3; i++) { - while (*str && (nsvg__isspace(*str))) str++; // skip leading spaces - if (*str == '+') str++; // skip '+' (don't allow '-') - if (!*str) break; - rgbf[i] = nsvg__atof(str); - - // Note 1: it would be great if nsvg__atof() returned how many - // bytes it consumed but it doesn't. We need to skip the number, - // the '%' character, spaces, and the delimiter ',' or ')'. - - // Note 2: The following code does not allow values like "33.%", - // i.e. a decimal point w/o fractional part, but this is consistent - // with other image viewers, e.g. firefox, chrome, eog, gimp. - - while (*str && nsvg__isdigit(*str)) str++; // skip integer part - if (*str == '.') { - str++; - if (!nsvg__isdigit(*str)) break; // error: no digit after '.' - while (*str && nsvg__isdigit(*str)) str++; // skip fractional part - } - if (*str == '%') str++; else break; - while (nsvg__isspace(*str)) str++; - if (*str == delimiter[i]) str++; - else break; - } - if (i == 3) { - rgbi[0] = roundf(rgbf[0] * 2.55f); - rgbi[1] = roundf(rgbf[1] * 2.55f); - rgbi[2] = roundf(rgbf[2] * 2.55f); - } else { - rgbi[0] = rgbi[1] = rgbi[2] = 128; - } - } - // clip values as the CSS spec requires - for (i = 0; i < 3; i++) { - if (rgbi[i] > 255) rgbi[i] = 255; - } - return NSVG_RGB(rgbi[0], rgbi[1], rgbi[2]); -} - -static unsigned int nsvg__parseColorRGBA(const char* str) -{ - int i; - unsigned int rgbai[4]; - float rgbaf[4]; - // try decimal integers first - if (sscanf(str, "rgba(%u, %u, %u, %u)", &rgbai[0], &rgbai[1], &rgbai[2], &rgbai[3]) != 4) { - // integers failed, try percent values (float, locale independent) - const char delimiter[4] = {',', ',', ',', ')'}; - str += 5; // skip "rgba(" - for (i = 0; i < 4; i++) { - while (*str && (nsvg__isspace(*str))) str++; // skip leading spaces - if (*str == '+') str++; // skip '+' (don't allow '-') - if (!*str) break; - rgbaf[i] = nsvg__atof(str); - - // Note 1: it would be great if nsvg__atof() returned how many - // bytes it consumed but it doesn't. We need to skip the number, - // the '%' character, spaces, and the delimiter ',' or ')'. - - // Note 2: The following code does not allow values like "33.%", - // i.e. a decimal point w/o fractional part, but this is consistent - // with other image viewers, e.g. firefox, chrome, eog, gimp. - - while (*str && nsvg__isdigit(*str)) str++; // skip integer part - if (*str == '.') { - str++; - if (!nsvg__isdigit(*str)) break; // error: no digit after '.' - while (*str && nsvg__isdigit(*str)) str++; // skip fractional part - } - if (*str == '%') str++; else break; - while (nsvg__isspace(*str)) str++; - if (*str == delimiter[i]) str++; - else break; - } - if (i == 4) { - rgbai[0] = roundf(rgbaf[0] * 2.55f); - rgbai[1] = roundf(rgbaf[1] * 2.55f); - rgbai[2] = roundf(rgbaf[2] * 2.55f); - rgbai[3] = roundf(rgbaf[3] * 2.55f); - } else { - rgbai[0] = rgbai[1] = rgbai[2] = 128; - rgbai[3] = 255; - } - } - // clip values as the CSS spec requires - for (i = 0; i < 4; i++) { - if (rgbai[i] > 255) rgbai[i] = 255; - } - return NSVG_RGBA(rgbai[0], rgbai[1], rgbai[2], rgbai[3]); -} - -typedef struct NSVGNamedColor { - const char* name; - unsigned int color; -} NSVGNamedColor; - -NSVGNamedColor nsvg__colors[] = { - - { "red", NSVG_RGB(255, 0, 0) }, - { "green", NSVG_RGB( 0, 128, 0) }, - { "blue", NSVG_RGB( 0, 0, 255) }, - { "yellow", NSVG_RGB(255, 255, 0) }, - { "cyan", NSVG_RGB( 0, 255, 255) }, - { "magenta", NSVG_RGB(255, 0, 255) }, - { "black", NSVG_RGB( 0, 0, 0) }, - { "grey", NSVG_RGB(128, 128, 128) }, - { "gray", NSVG_RGB(128, 128, 128) }, - { "white", NSVG_RGB(255, 255, 255) }, - -#ifdef NANOSVG_ALL_COLOR_KEYWORDS - { "aliceblue", NSVG_RGB(240, 248, 255) }, - { "antiquewhite", NSVG_RGB(250, 235, 215) }, - { "aqua", NSVG_RGB( 0, 255, 255) }, - { "aquamarine", NSVG_RGB(127, 255, 212) }, - { "azure", NSVG_RGB(240, 255, 255) }, - { "beige", NSVG_RGB(245, 245, 220) }, - { "bisque", NSVG_RGB(255, 228, 196) }, - { "blanchedalmond", NSVG_RGB(255, 235, 205) }, - { "blueviolet", NSVG_RGB(138, 43, 226) }, - { "brown", NSVG_RGB(165, 42, 42) }, - { "burlywood", NSVG_RGB(222, 184, 135) }, - { "cadetblue", NSVG_RGB( 95, 158, 160) }, - { "chartreuse", NSVG_RGB(127, 255, 0) }, - { "chocolate", NSVG_RGB(210, 105, 30) }, - { "coral", NSVG_RGB(255, 127, 80) }, - { "cornflowerblue", NSVG_RGB(100, 149, 237) }, - { "cornsilk", NSVG_RGB(255, 248, 220) }, - { "crimson", NSVG_RGB(220, 20, 60) }, - { "darkblue", NSVG_RGB( 0, 0, 139) }, - { "darkcyan", NSVG_RGB( 0, 139, 139) }, - { "darkgoldenrod", NSVG_RGB(184, 134, 11) }, - { "darkgray", NSVG_RGB(169, 169, 169) }, - { "darkgreen", NSVG_RGB( 0, 100, 0) }, - { "darkgrey", NSVG_RGB(169, 169, 169) }, - { "darkkhaki", NSVG_RGB(189, 183, 107) }, - { "darkmagenta", NSVG_RGB(139, 0, 139) }, - { "darkolivegreen", NSVG_RGB( 85, 107, 47) }, - { "darkorange", NSVG_RGB(255, 140, 0) }, - { "darkorchid", NSVG_RGB(153, 50, 204) }, - { "darkred", NSVG_RGB(139, 0, 0) }, - { "darksalmon", NSVG_RGB(233, 150, 122) }, - { "darkseagreen", NSVG_RGB(143, 188, 143) }, - { "darkslateblue", NSVG_RGB( 72, 61, 139) }, - { "darkslategray", NSVG_RGB( 47, 79, 79) }, - { "darkslategrey", NSVG_RGB( 47, 79, 79) }, - { "darkturquoise", NSVG_RGB( 0, 206, 209) }, - { "darkviolet", NSVG_RGB(148, 0, 211) }, - { "deeppink", NSVG_RGB(255, 20, 147) }, - { "deepskyblue", NSVG_RGB( 0, 191, 255) }, - { "dimgray", NSVG_RGB(105, 105, 105) }, - { "dimgrey", NSVG_RGB(105, 105, 105) }, - { "dodgerblue", NSVG_RGB( 30, 144, 255) }, - { "firebrick", NSVG_RGB(178, 34, 34) }, - { "floralwhite", NSVG_RGB(255, 250, 240) }, - { "forestgreen", NSVG_RGB( 34, 139, 34) }, - { "fuchsia", NSVG_RGB(255, 0, 255) }, - { "gainsboro", NSVG_RGB(220, 220, 220) }, - { "ghostwhite", NSVG_RGB(248, 248, 255) }, - { "gold", NSVG_RGB(255, 215, 0) }, - { "goldenrod", NSVG_RGB(218, 165, 32) }, - { "greenyellow", NSVG_RGB(173, 255, 47) }, - { "honeydew", NSVG_RGB(240, 255, 240) }, - { "hotpink", NSVG_RGB(255, 105, 180) }, - { "indianred", NSVG_RGB(205, 92, 92) }, - { "indigo", NSVG_RGB( 75, 0, 130) }, - { "ivory", NSVG_RGB(255, 255, 240) }, - { "khaki", NSVG_RGB(240, 230, 140) }, - { "lavender", NSVG_RGB(230, 230, 250) }, - { "lavenderblush", NSVG_RGB(255, 240, 245) }, - { "lawngreen", NSVG_RGB(124, 252, 0) }, - { "lemonchiffon", NSVG_RGB(255, 250, 205) }, - { "lightblue", NSVG_RGB(173, 216, 230) }, - { "lightcoral", NSVG_RGB(240, 128, 128) }, - { "lightcyan", NSVG_RGB(224, 255, 255) }, - { "lightgoldenrodyellow", NSVG_RGB(250, 250, 210) }, - { "lightgray", NSVG_RGB(211, 211, 211) }, - { "lightgreen", NSVG_RGB(144, 238, 144) }, - { "lightgrey", NSVG_RGB(211, 211, 211) }, - { "lightpink", NSVG_RGB(255, 182, 193) }, - { "lightsalmon", NSVG_RGB(255, 160, 122) }, - { "lightseagreen", NSVG_RGB( 32, 178, 170) }, - { "lightskyblue", NSVG_RGB(135, 206, 250) }, - { "lightslategray", NSVG_RGB(119, 136, 153) }, - { "lightslategrey", NSVG_RGB(119, 136, 153) }, - { "lightsteelblue", NSVG_RGB(176, 196, 222) }, - { "lightyellow", NSVG_RGB(255, 255, 224) }, - { "lime", NSVG_RGB( 0, 255, 0) }, - { "limegreen", NSVG_RGB( 50, 205, 50) }, - { "linen", NSVG_RGB(250, 240, 230) }, - { "maroon", NSVG_RGB(128, 0, 0) }, - { "mediumaquamarine", NSVG_RGB(102, 205, 170) }, - { "mediumblue", NSVG_RGB( 0, 0, 205) }, - { "mediumorchid", NSVG_RGB(186, 85, 211) }, - { "mediumpurple", NSVG_RGB(147, 112, 219) }, - { "mediumseagreen", NSVG_RGB( 60, 179, 113) }, - { "mediumslateblue", NSVG_RGB(123, 104, 238) }, - { "mediumspringgreen", NSVG_RGB( 0, 250, 154) }, - { "mediumturquoise", NSVG_RGB( 72, 209, 204) }, - { "mediumvioletred", NSVG_RGB(199, 21, 133) }, - { "midnightblue", NSVG_RGB( 25, 25, 112) }, - { "mintcream", NSVG_RGB(245, 255, 250) }, - { "mistyrose", NSVG_RGB(255, 228, 225) }, - { "moccasin", NSVG_RGB(255, 228, 181) }, - { "navajowhite", NSVG_RGB(255, 222, 173) }, - { "navy", NSVG_RGB( 0, 0, 128) }, - { "oldlace", NSVG_RGB(253, 245, 230) }, - { "olive", NSVG_RGB(128, 128, 0) }, - { "olivedrab", NSVG_RGB(107, 142, 35) }, - { "orange", NSVG_RGB(255, 165, 0) }, - { "orangered", NSVG_RGB(255, 69, 0) }, - { "orchid", NSVG_RGB(218, 112, 214) }, - { "palegoldenrod", NSVG_RGB(238, 232, 170) }, - { "palegreen", NSVG_RGB(152, 251, 152) }, - { "paleturquoise", NSVG_RGB(175, 238, 238) }, - { "palevioletred", NSVG_RGB(219, 112, 147) }, - { "papayawhip", NSVG_RGB(255, 239, 213) }, - { "peachpuff", NSVG_RGB(255, 218, 185) }, - { "peru", NSVG_RGB(205, 133, 63) }, - { "pink", NSVG_RGB(255, 192, 203) }, - { "plum", NSVG_RGB(221, 160, 221) }, - { "powderblue", NSVG_RGB(176, 224, 230) }, - { "purple", NSVG_RGB(128, 0, 128) }, - { "rosybrown", NSVG_RGB(188, 143, 143) }, - { "royalblue", NSVG_RGB( 65, 105, 225) }, - { "saddlebrown", NSVG_RGB(139, 69, 19) }, - { "salmon", NSVG_RGB(250, 128, 114) }, - { "sandybrown", NSVG_RGB(244, 164, 96) }, - { "seagreen", NSVG_RGB( 46, 139, 87) }, - { "seashell", NSVG_RGB(255, 245, 238) }, - { "sienna", NSVG_RGB(160, 82, 45) }, - { "silver", NSVG_RGB(192, 192, 192) }, - { "skyblue", NSVG_RGB(135, 206, 235) }, - { "slateblue", NSVG_RGB(106, 90, 205) }, - { "slategray", NSVG_RGB(112, 128, 144) }, - { "slategrey", NSVG_RGB(112, 128, 144) }, - { "snow", NSVG_RGB(255, 250, 250) }, - { "springgreen", NSVG_RGB( 0, 255, 127) }, - { "steelblue", NSVG_RGB( 70, 130, 180) }, - { "tan", NSVG_RGB(210, 180, 140) }, - { "teal", NSVG_RGB( 0, 128, 128) }, - { "thistle", NSVG_RGB(216, 191, 216) }, - { "tomato", NSVG_RGB(255, 99, 71) }, - { "turquoise", NSVG_RGB( 64, 224, 208) }, - { "violet", NSVG_RGB(238, 130, 238) }, - { "wheat", NSVG_RGB(245, 222, 179) }, - { "whitesmoke", NSVG_RGB(245, 245, 245) }, - { "yellowgreen", NSVG_RGB(154, 205, 50) }, -#endif -}; - -static unsigned int nsvg__parseColorName(const char* str) -{ - int i, ncolors = sizeof(nsvg__colors) / sizeof(NSVGNamedColor); - - for (i = 0; i < ncolors; i++) { - if (strcmp(nsvg__colors[i].name, str) == 0) { - return nsvg__colors[i].color; - } - } - - return NSVG_RGB(128, 128, 128); -} - -static unsigned int nsvg__parseColor(const char* str) -{ - size_t len = 0; - while(*str == ' ') ++str; - len = strlen(str); - if (len >= 1 && *str == '#') - return nsvg__parseColorHex(str); - else if (len >= 4 && str[0] == 'r' && str[1] == 'g' && str[2] == 'b' && str[3] == '(') - return nsvg__parseColorRGB(str); - else if (len >= 5 && str[0] == 'r' && str[1] == 'g' && str[2] == 'b' && str[3] == 'a' && str[4] == '(') - return nsvg__parseColorRGBA(str); - return nsvg__parseColorName(str); -} - -static float nsvg__parseOpacity(const char* str) -{ - float val = nsvg__atof(str); - if (val < 0.0f) val = 0.0f; - if (val > 1.0f) val = 1.0f; - return val; -} - -static float nsvg__parseMiterLimit(const char* str) -{ - float val = nsvg__atof(str); - if (val < 0.0f) val = 0.0f; - return val; -} - -static int nsvg__parseUnits(const char* units) -{ - if (units[0] == 'p' && units[1] == 'x') - return NSVG_UNITS_PX; - else if (units[0] == 'p' && units[1] == 't') - return NSVG_UNITS_PT; - else if (units[0] == 'p' && units[1] == 'c') - return NSVG_UNITS_PC; - else if (units[0] == 'm' && units[1] == 'm') - return NSVG_UNITS_MM; - else if (units[0] == 'c' && units[1] == 'm') - return NSVG_UNITS_CM; - else if (units[0] == 'i' && units[1] == 'n') - return NSVG_UNITS_IN; - else if (units[0] == '%') - return NSVG_UNITS_PERCENT; - else if (units[0] == 'e' && units[1] == 'm') - return NSVG_UNITS_EM; - else if (units[0] == 'e' && units[1] == 'x') - return NSVG_UNITS_EX; - return NSVG_UNITS_USER; -} - -static int nsvg__isCoordinate(const char* s) -{ - // optional sign - if (*s == '-' || *s == '+') - s++; - // must have at least one digit, or start by a dot - return (nsvg__isdigit(*s) || *s == '.'); -} - -static NSVGcoordinate nsvg__parseCoordinateRaw(const char* str) -{ - NSVGcoordinate coord = {0, NSVG_UNITS_USER}; - char buf[64]; - coord.units = nsvg__parseUnits(nsvg__parseNumber(str, buf, 64)); - coord.value = nsvg__atof(buf); - return coord; -} - -static NSVGcoordinate nsvg__coord(float v, int units) -{ - NSVGcoordinate coord = {v, units}; - return coord; -} - -static float nsvg__parseCoordinate(NSVGparser* p, const char* str, float orig, float length) -{ - NSVGcoordinate coord = nsvg__parseCoordinateRaw(str); - return nsvg__convertToPixels(p, coord, orig, length); -} - -static int nsvg__parseTransformArgs(const char* str, float* args, int maxNa, int* na) -{ - const char* end; - const char* ptr; - char it[64]; - - *na = 0; - ptr = str; - while (*ptr && *ptr != '(') ++ptr; - if (*ptr == 0) - return 1; - end = ptr; - while (*end && *end != ')') ++end; - if (*end == 0) - return 1; - - while (ptr < end) { - if (*ptr == '-' || *ptr == '+' || *ptr == '.' || nsvg__isdigit(*ptr)) { - if (*na >= maxNa) return 0; - ptr = nsvg__parseNumber(ptr, it, 64); - args[(*na)++] = (float)nsvg__atof(it); - } else { - ++ptr; - } - } - return (int)(end - str); -} - - -static int nsvg__parseMatrix(float* xform, const char* str) -{ - float t[6]; - int na = 0; - int len = nsvg__parseTransformArgs(str, t, 6, &na); - if (na != 6) return len; - memcpy(xform, t, sizeof(float)*6); - return len; -} - -static int nsvg__parseTranslate(float* xform, const char* str) -{ - float args[2]; - float t[6]; - int na = 0; - int len = nsvg__parseTransformArgs(str, args, 2, &na); - if (na == 1) args[1] = 0.0; - - nsvg__xformSetTranslation(t, args[0], args[1]); - memcpy(xform, t, sizeof(float)*6); - return len; -} - -static int nsvg__parseScale(float* xform, const char* str) -{ - float args[2]; - int na = 0; - float t[6]; - int len = nsvg__parseTransformArgs(str, args, 2, &na); - if (na == 1) args[1] = args[0]; - nsvg__xformSetScale(t, args[0], args[1]); - memcpy(xform, t, sizeof(float)*6); - return len; -} - -static int nsvg__parseSkewX(float* xform, const char* str) -{ - float args[1]; - int na = 0; - float t[6]; - int len = nsvg__parseTransformArgs(str, args, 1, &na); - nsvg__xformSetSkewX(t, args[0]/180.0f*NSVG_PI); - memcpy(xform, t, sizeof(float)*6); - return len; -} - -static int nsvg__parseSkewY(float* xform, const char* str) -{ - float args[1]; - int na = 0; - float t[6]; - int len = nsvg__parseTransformArgs(str, args, 1, &na); - nsvg__xformSetSkewY(t, args[0]/180.0f*NSVG_PI); - memcpy(xform, t, sizeof(float)*6); - return len; -} - -static int nsvg__parseRotate(float* xform, const char* str) -{ - float args[3]; - int na = 0; - float m[6]; - float t[6]; - int len = nsvg__parseTransformArgs(str, args, 3, &na); - if (na == 1) - args[1] = args[2] = 0.0f; - nsvg__xformIdentity(m); - - if (na > 1) { - nsvg__xformSetTranslation(t, -args[1], -args[2]); - nsvg__xformMultiply(m, t); - } - - nsvg__xformSetRotation(t, args[0]/180.0f*NSVG_PI); - nsvg__xformMultiply(m, t); - - if (na > 1) { - nsvg__xformSetTranslation(t, args[1], args[2]); - nsvg__xformMultiply(m, t); - } - - memcpy(xform, m, sizeof(float)*6); - - return len; -} - -static void nsvg__parseTransform(float* xform, const char* str) -{ - float t[6]; - int len; - nsvg__xformIdentity(xform); - while (*str) - { - if (strncmp(str, "matrix", 6) == 0) - len = nsvg__parseMatrix(t, str); - else if (strncmp(str, "translate", 9) == 0) - len = nsvg__parseTranslate(t, str); - else if (strncmp(str, "scale", 5) == 0) - len = nsvg__parseScale(t, str); - else if (strncmp(str, "rotate", 6) == 0) - len = nsvg__parseRotate(t, str); - else if (strncmp(str, "skewX", 5) == 0) - len = nsvg__parseSkewX(t, str); - else if (strncmp(str, "skewY", 5) == 0) - len = nsvg__parseSkewY(t, str); - else{ - ++str; - continue; - } - if (len != 0) { - str += len; - } else { - ++str; - continue; - } - - nsvg__xformPremultiply(xform, t); - } -} - -static void nsvg__parseUrl(char* id, const char* str) -{ - int i = 0; - str += 4; // "url("; - if (*str && *str == '#') - str++; - while (i < 63 && *str && *str != ')') { - id[i] = *str++; - i++; - } - id[i] = '\0'; -} - -static char nsvg__parseLineCap(const char* str) -{ - if (strcmp(str, "butt") == 0) - return NSVG_CAP_BUTT; - else if (strcmp(str, "round") == 0) - return NSVG_CAP_ROUND; - else if (strcmp(str, "square") == 0) - return NSVG_CAP_SQUARE; - // TODO: handle inherit. - return NSVG_CAP_BUTT; -} - -static char nsvg__parseLineJoin(const char* str) -{ - if (strcmp(str, "miter") == 0) - return NSVG_JOIN_MITER; - else if (strcmp(str, "round") == 0) - return NSVG_JOIN_ROUND; - else if (strcmp(str, "bevel") == 0) - return NSVG_JOIN_BEVEL; - // TODO: handle inherit. - return NSVG_JOIN_MITER; -} - -static char nsvg__parseFillRule(const char* str) -{ - if (strcmp(str, "nonzero") == 0) - return NSVG_FILLRULE_NONZERO; - else if (strcmp(str, "evenodd") == 0) - return NSVG_FILLRULE_EVENODD; - // TODO: handle inherit. - return NSVG_FILLRULE_NONZERO; -} - -static const char* nsvg__getNextDashItem(const char* s, char* it) -{ - int n = 0; - it[0] = '\0'; - // Skip white spaces and commas - while (*s && (nsvg__isspace(*s) || *s == ',')) s++; - // Advance until whitespace, comma or end. - while (*s && (!nsvg__isspace(*s) && *s != ',')) { - if (n < 63) - it[n++] = *s; - s++; - } - it[n++] = '\0'; - return s; -} - -static int nsvg__parseStrokeDashArray(NSVGparser* p, const char* str, float* strokeDashArray) -{ - char item[64]; - int count = 0, i; - float sum = 0.0f; - - // Handle "none" - if (str[0] == 'n') - return 0; - - // Parse dashes - while (*str) { - str = nsvg__getNextDashItem(str, item); - if (!*item) break; - if (count < NSVG_MAX_DASHES) - strokeDashArray[count++] = fabsf(nsvg__parseCoordinate(p, item, 0.0f, nsvg__actualLength(p))); - } - - for (i = 0; i < count; i++) - sum += strokeDashArray[i]; - if (sum <= 1e-6f) - count = 0; - - return count; -} - -static void nsvg__parseStyle(NSVGparser* p, const char* str); - -static int nsvg__parseAttr(NSVGparser* p, const char* name, const char* value) -{ - float xform[6]; - NSVGattrib* attr = nsvg__getAttr(p); - if (!attr) return 0; - - if (strcmp(name, "style") == 0) { - nsvg__parseStyle(p, value); - } else if (strcmp(name, "display") == 0) { - if (strcmp(value, "none") == 0) - attr->visible = 0; - // Don't reset ->visible on display:inline, one display:none hides the whole subtree - - } else if (strcmp(name, "fill") == 0) { - if (strcmp(value, "none") == 0) { - attr->hasFill = 0; - } else if (strncmp(value, "url(", 4) == 0) { - attr->hasFill = 2; - nsvg__parseUrl(attr->fillGradient, value); - } else { - attr->hasFill = 1; - attr->fillColor = nsvg__parseColor(value); - // if the fillColor has an alpha value then use it to - // set the fillOpacity - if (attr->fillColor & 0xFF000000) { - attr->fillOpacity = ((attr->fillColor >> 24) & 0xFF) / 255.0; - // remove the alpha value from the color - attr->fillColor &= 0x00FFFFFF; - } - } - } else if (strcmp(name, "opacity") == 0) { - attr->opacity = nsvg__parseOpacity(value); - } else if (strcmp(name, "fill-opacity") == 0) { - attr->fillOpacity = nsvg__parseOpacity(value); - } else if (strcmp(name, "stroke") == 0) { - if (strcmp(value, "none") == 0) { - attr->hasStroke = 0; - } else if (strncmp(value, "url(", 4) == 0) { - attr->hasStroke = 2; - nsvg__parseUrl(attr->strokeGradient, value); - } else { - attr->hasStroke = 1; - attr->strokeColor = nsvg__parseColor(value); - // if the strokeColor has an alpha value then use it to - // set the strokeOpacity - if (attr->strokeColor & 0xFF000000) { - attr->strokeOpacity = ((attr->strokeColor >> 24) & 0xFF) / 255.0; - // remove the alpha value from the color - attr->strokeColor &= 0x00FFFFFF; - } - } - } else if (strcmp(name, "stroke-width") == 0) { - attr->strokeWidth = nsvg__parseCoordinate(p, value, 0.0f, nsvg__actualLength(p)); - } else if (strcmp(name, "stroke-dasharray") == 0) { - attr->strokeDashCount = nsvg__parseStrokeDashArray(p, value, attr->strokeDashArray); - } else if (strcmp(name, "stroke-dashoffset") == 0) { - attr->strokeDashOffset = nsvg__parseCoordinate(p, value, 0.0f, nsvg__actualLength(p)); - } else if (strcmp(name, "stroke-opacity") == 0) { - attr->strokeOpacity = nsvg__parseOpacity(value); - } else if (strcmp(name, "stroke-linecap") == 0) { - attr->strokeLineCap = nsvg__parseLineCap(value); - } else if (strcmp(name, "stroke-linejoin") == 0) { - attr->strokeLineJoin = nsvg__parseLineJoin(value); - } else if (strcmp(name, "stroke-miterlimit") == 0) { - attr->miterLimit = nsvg__parseMiterLimit(value); - } else if (strcmp(name, "fill-rule") == 0) { - attr->fillRule = nsvg__parseFillRule(value); - } else if (strcmp(name, "font-size") == 0) { - attr->fontSize = nsvg__parseCoordinate(p, value, 0.0f, nsvg__actualLength(p)); - } else if (strcmp(name, "transform") == 0) { - nsvg__parseTransform(xform, value); - nsvg__xformPremultiply(attr->xform, xform); - } else if (strcmp(name, "stop-color") == 0) { - attr->stopColor = nsvg__parseColor(value); - } else if (strcmp(name, "stop-opacity") == 0) { - attr->stopOpacity = nsvg__parseOpacity(value); - } else if (strcmp(name, "offset") == 0) { - attr->stopOffset = nsvg__parseCoordinate(p, value, 0.0f, 1.0f); - } else if (strcmp(name, "id") == 0) { - strncpy(attr->id, value, 63); - attr->id[63] = '\0'; - } else { - return 0; - } - return 1; -} - -static int nsvg__parseNameValue(NSVGparser* p, const char* start, const char* end) -{ - const char* str; - const char* val; - char name[512]; - char value[512]; - int n; - - str = start; - while (str < end && *str != ':') ++str; - - val = str; - - // Right Trim - while (str > start && (*str == ':' || nsvg__isspace(*str))) --str; - ++str; - - n = (int)(str - start); - if (n > 511) n = 511; - if (n) memcpy(name, start, n); - name[n] = 0; - - while (val < end && (*val == ':' || nsvg__isspace(*val))) ++val; - - n = (int)(end - val); - if (n > 511) n = 511; - if (n) memcpy(value, val, n); - value[n] = 0; - - return nsvg__parseAttr(p, name, value); -} - -static void nsvg__parseStyle(NSVGparser* p, const char* str) -{ - const char* start; - const char* end; - - while (*str) { - // Left Trim - while(*str && nsvg__isspace(*str)) ++str; - start = str; - while(*str && *str != ';') ++str; - end = str; - - // Right Trim - while (end > start && (*end == ';' || nsvg__isspace(*end))) --end; - ++end; - - nsvg__parseNameValue(p, start, end); - if (*str) ++str; - } -} - -static void nsvg__parseAttribs(NSVGparser* p, const char** attr) -{ - int i; - for (i = 0; attr[i]; i += 2) - { - if (strcmp(attr[i], "style") == 0) - nsvg__parseStyle(p, attr[i + 1]); - else - nsvg__parseAttr(p, attr[i], attr[i + 1]); - } -} - -static int nsvg__getArgsPerElement(char cmd) -{ - switch (cmd) { - case 'v': - case 'V': - case 'h': - case 'H': - return 1; - case 'm': - case 'M': - case 'l': - case 'L': - case 't': - case 'T': - return 2; - case 'q': - case 'Q': - case 's': - case 'S': - return 4; - case 'c': - case 'C': - return 6; - case 'a': - case 'A': - return 7; - case 'z': - case 'Z': - return 0; - } - return -1; -} - -static void nsvg__pathMoveTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) -{ - if (rel) { - *cpx += args[0]; - *cpy += args[1]; - } else { - *cpx = args[0]; - *cpy = args[1]; - } - nsvg__moveTo(p, *cpx, *cpy); -} - -static void nsvg__pathLineTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) -{ - if (rel) { - *cpx += args[0]; - *cpy += args[1]; - } else { - *cpx = args[0]; - *cpy = args[1]; - } - nsvg__lineTo(p, *cpx, *cpy); -} - -static void nsvg__pathHLineTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) -{ - if (rel) - *cpx += args[0]; - else - *cpx = args[0]; - nsvg__lineTo(p, *cpx, *cpy); -} - -static void nsvg__pathVLineTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) -{ - if (rel) - *cpy += args[0]; - else - *cpy = args[0]; - nsvg__lineTo(p, *cpx, *cpy); -} - -static void nsvg__pathCubicBezTo(NSVGparser* p, float* cpx, float* cpy, - float* cpx2, float* cpy2, float* args, int rel) -{ - float x2, y2, cx1, cy1, cx2, cy2; - - if (rel) { - cx1 = *cpx + args[0]; - cy1 = *cpy + args[1]; - cx2 = *cpx + args[2]; - cy2 = *cpy + args[3]; - x2 = *cpx + args[4]; - y2 = *cpy + args[5]; - } else { - cx1 = args[0]; - cy1 = args[1]; - cx2 = args[2]; - cy2 = args[3]; - x2 = args[4]; - y2 = args[5]; - } - - nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2); - - *cpx2 = cx2; - *cpy2 = cy2; - *cpx = x2; - *cpy = y2; -} - -static void nsvg__pathCubicBezShortTo(NSVGparser* p, float* cpx, float* cpy, - float* cpx2, float* cpy2, float* args, int rel) -{ - float x1, y1, x2, y2, cx1, cy1, cx2, cy2; - - x1 = *cpx; - y1 = *cpy; - if (rel) { - cx2 = *cpx + args[0]; - cy2 = *cpy + args[1]; - x2 = *cpx + args[2]; - y2 = *cpy + args[3]; - } else { - cx2 = args[0]; - cy2 = args[1]; - x2 = args[2]; - y2 = args[3]; - } - - cx1 = 2*x1 - *cpx2; - cy1 = 2*y1 - *cpy2; - - nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2); - - *cpx2 = cx2; - *cpy2 = cy2; - *cpx = x2; - *cpy = y2; -} - -static void nsvg__pathQuadBezTo(NSVGparser* p, float* cpx, float* cpy, - float* cpx2, float* cpy2, float* args, int rel) -{ - float x1, y1, x2, y2, cx, cy; - float cx1, cy1, cx2, cy2; - - x1 = *cpx; - y1 = *cpy; - if (rel) { - cx = *cpx + args[0]; - cy = *cpy + args[1]; - x2 = *cpx + args[2]; - y2 = *cpy + args[3]; - } else { - cx = args[0]; - cy = args[1]; - x2 = args[2]; - y2 = args[3]; - } - - // Convert to cubic bezier - cx1 = x1 + 2.0f/3.0f*(cx - x1); - cy1 = y1 + 2.0f/3.0f*(cy - y1); - cx2 = x2 + 2.0f/3.0f*(cx - x2); - cy2 = y2 + 2.0f/3.0f*(cy - y2); - - nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2); - - *cpx2 = cx; - *cpy2 = cy; - *cpx = x2; - *cpy = y2; -} - -static void nsvg__pathQuadBezShortTo(NSVGparser* p, float* cpx, float* cpy, - float* cpx2, float* cpy2, float* args, int rel) -{ - float x1, y1, x2, y2, cx, cy; - float cx1, cy1, cx2, cy2; - - x1 = *cpx; - y1 = *cpy; - if (rel) { - x2 = *cpx + args[0]; - y2 = *cpy + args[1]; - } else { - x2 = args[0]; - y2 = args[1]; - } - - cx = 2*x1 - *cpx2; - cy = 2*y1 - *cpy2; - - // Convert to cubix bezier - cx1 = x1 + 2.0f/3.0f*(cx - x1); - cy1 = y1 + 2.0f/3.0f*(cy - y1); - cx2 = x2 + 2.0f/3.0f*(cx - x2); - cy2 = y2 + 2.0f/3.0f*(cy - y2); - - nsvg__cubicBezTo(p, cx1,cy1, cx2,cy2, x2,y2); - - *cpx2 = cx; - *cpy2 = cy; - *cpx = x2; - *cpy = y2; -} - -static float nsvg__sqr(float x) { return x*x; } -static float nsvg__vmag(float x, float y) { return sqrtf(x*x + y*y); } - -static float nsvg__vecrat(float ux, float uy, float vx, float vy) -{ - return (ux*vx + uy*vy) / (nsvg__vmag(ux,uy) * nsvg__vmag(vx,vy)); -} - -static float nsvg__vecang(float ux, float uy, float vx, float vy) -{ - float r = nsvg__vecrat(ux,uy, vx,vy); - if (r < -1.0f) r = -1.0f; - if (r > 1.0f) r = 1.0f; - return ((ux*vy < uy*vx) ? -1.0f : 1.0f) * acosf(r); -} - -static void nsvg__pathArcTo(NSVGparser* p, float* cpx, float* cpy, float* args, int rel) -{ - // Ported from canvg (https://code.google.com/p/canvg/) - float rx, ry, rotx; - float x1, y1, x2, y2, cx, cy, dx, dy, d; - float x1p, y1p, cxp, cyp, s, sa, sb; - float ux, uy, vx, vy, a1, da; - float x, y, tanx, tany, a, px = 0, py = 0, ptanx = 0, ptany = 0, t[6]; - float sinrx, cosrx; - int fa, fs; - int i, ndivs; - float hda, kappa; - - rx = fabsf(args[0]); // y radius - ry = fabsf(args[1]); // x radius - rotx = args[2] / 180.0f * NSVG_PI; // x rotation angle - fa = fabsf(args[3]) > 1e-6 ? 1 : 0; // Large arc - fs = fabsf(args[4]) > 1e-6 ? 1 : 0; // Sweep direction - x1 = *cpx; // start point - y1 = *cpy; - if (rel) { // end point - x2 = *cpx + args[5]; - y2 = *cpy + args[6]; - } else { - x2 = args[5]; - y2 = args[6]; - } - - dx = x1 - x2; - dy = y1 - y2; - d = sqrtf(dx*dx + dy*dy); - if (d < 1e-6f || rx < 1e-6f || ry < 1e-6f) { - // The arc degenerates to a line - nsvg__lineTo(p, x2, y2); - *cpx = x2; - *cpy = y2; - return; - } - - sinrx = sinf(rotx); - cosrx = cosf(rotx); - - // Convert to center point parameterization. - // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes - // 1) Compute x1', y1' - x1p = cosrx * dx / 2.0f + sinrx * dy / 2.0f; - y1p = -sinrx * dx / 2.0f + cosrx * dy / 2.0f; - d = nsvg__sqr(x1p)/nsvg__sqr(rx) + nsvg__sqr(y1p)/nsvg__sqr(ry); - if (d > 1) { - d = sqrtf(d); - rx *= d; - ry *= d; - } - // 2) Compute cx', cy' - s = 0.0f; - sa = nsvg__sqr(rx)*nsvg__sqr(ry) - nsvg__sqr(rx)*nsvg__sqr(y1p) - nsvg__sqr(ry)*nsvg__sqr(x1p); - sb = nsvg__sqr(rx)*nsvg__sqr(y1p) + nsvg__sqr(ry)*nsvg__sqr(x1p); - if (sa < 0.0f) sa = 0.0f; - if (sb > 0.0f) - s = sqrtf(sa / sb); - if (fa == fs) - s = -s; - cxp = s * rx * y1p / ry; - cyp = s * -ry * x1p / rx; - - // 3) Compute cx,cy from cx',cy' - cx = (x1 + x2)/2.0f + cosrx*cxp - sinrx*cyp; - cy = (y1 + y2)/2.0f + sinrx*cxp + cosrx*cyp; - - // 4) Calculate theta1, and delta theta. - ux = (x1p - cxp) / rx; - uy = (y1p - cyp) / ry; - vx = (-x1p - cxp) / rx; - vy = (-y1p - cyp) / ry; - a1 = nsvg__vecang(1.0f,0.0f, ux,uy); // Initial angle - da = nsvg__vecang(ux,uy, vx,vy); // Delta angle - -// if (vecrat(ux,uy,vx,vy) <= -1.0f) da = NSVG_PI; -// if (vecrat(ux,uy,vx,vy) >= 1.0f) da = 0; - - if (fs == 0 && da > 0) - da -= 2 * NSVG_PI; - else if (fs == 1 && da < 0) - da += 2 * NSVG_PI; - - // Approximate the arc using cubic spline segments. - t[0] = cosrx; t[1] = sinrx; - t[2] = -sinrx; t[3] = cosrx; - t[4] = cx; t[5] = cy; - - // Split arc into max 90 degree segments. - // The loop assumes an iteration per end point (including start and end), this +1. - ndivs = (int)(fabsf(da) / (NSVG_PI*0.5f) + 1.0f); - hda = (da / (float)ndivs) / 2.0f; - // Fix for ticket #179: division by 0: avoid cotangens around 0 (infinite) - if ((hda < 1e-3f) && (hda > -1e-3f)) - hda *= 0.5f; - else - hda = (1.0f - cosf(hda)) / sinf(hda); - kappa = fabsf(4.0f / 3.0f * hda); - if (da < 0.0f) - kappa = -kappa; - - for (i = 0; i <= ndivs; i++) { - a = a1 + da * ((float)i/(float)ndivs); - dx = cosf(a); - dy = sinf(a); - nsvg__xformPoint(&x, &y, dx*rx, dy*ry, t); // position - nsvg__xformVec(&tanx, &tany, -dy*rx * kappa, dx*ry * kappa, t); // tangent - if (i > 0) - nsvg__cubicBezTo(p, px+ptanx,py+ptany, x-tanx, y-tany, x, y); - px = x; - py = y; - ptanx = tanx; - ptany = tany; - } - - *cpx = x2; - *cpy = y2; -} - -static void nsvg__parsePath(NSVGparser* p, const char** attr) -{ - const char* s = NULL; - char cmd = '\0'; - float args[10]; - int nargs; - int rargs = 0; - char initPoint; - float cpx, cpy, cpx2, cpy2; - const char* tmp[4]; - char closedFlag; - int i; - char item[64]; - - for (i = 0; attr[i]; i += 2) { - if (strcmp(attr[i], "d") == 0) { - s = attr[i + 1]; - } else { - tmp[0] = attr[i]; - tmp[1] = attr[i + 1]; - tmp[2] = 0; - tmp[3] = 0; - nsvg__parseAttribs(p, tmp); - } - } - - if (s) { - nsvg__resetPath(p); - cpx = 0; cpy = 0; - cpx2 = 0; cpy2 = 0; - initPoint = 0; - closedFlag = 0; - nargs = 0; - - while (*s) { - item[0] = '\0'; - if ((cmd == 'A' || cmd == 'a') && (nargs == 3 || nargs == 4)) - s = nsvg__getNextPathItemWhenArcFlag(s, item); - if (!*item) - s = nsvg__getNextPathItem(s, item); - if (!*item) break; - if (cmd != '\0' && nsvg__isCoordinate(item)) { - if (nargs < 10) - args[nargs++] = (float)nsvg__atof(item); - if (nargs >= rargs) { - switch (cmd) { - case 'm': - case 'M': - nsvg__pathMoveTo(p, &cpx, &cpy, args, cmd == 'm' ? 1 : 0); - // Moveto can be followed by multiple coordinate pairs, - // which should be treated as linetos. - cmd = (cmd == 'm') ? 'l' : 'L'; - rargs = nsvg__getArgsPerElement(cmd); - cpx2 = cpx; cpy2 = cpy; - initPoint = 1; - break; - case 'l': - case 'L': - nsvg__pathLineTo(p, &cpx, &cpy, args, cmd == 'l' ? 1 : 0); - cpx2 = cpx; cpy2 = cpy; - break; - case 'H': - case 'h': - nsvg__pathHLineTo(p, &cpx, &cpy, args, cmd == 'h' ? 1 : 0); - cpx2 = cpx; cpy2 = cpy; - break; - case 'V': - case 'v': - nsvg__pathVLineTo(p, &cpx, &cpy, args, cmd == 'v' ? 1 : 0); - cpx2 = cpx; cpy2 = cpy; - break; - case 'C': - case 'c': - nsvg__pathCubicBezTo(p, &cpx, &cpy, &cpx2, &cpy2, args, cmd == 'c' ? 1 : 0); - break; - case 'S': - case 's': - nsvg__pathCubicBezShortTo(p, &cpx, &cpy, &cpx2, &cpy2, args, cmd == 's' ? 1 : 0); - break; - case 'Q': - case 'q': - nsvg__pathQuadBezTo(p, &cpx, &cpy, &cpx2, &cpy2, args, cmd == 'q' ? 1 : 0); - break; - case 'T': - case 't': - nsvg__pathQuadBezShortTo(p, &cpx, &cpy, &cpx2, &cpy2, args, cmd == 't' ? 1 : 0); - break; - case 'A': - case 'a': - nsvg__pathArcTo(p, &cpx, &cpy, args, cmd == 'a' ? 1 : 0); - cpx2 = cpx; cpy2 = cpy; - break; - default: - if (nargs >= 2) { - cpx = args[nargs-2]; - cpy = args[nargs-1]; - cpx2 = cpx; cpy2 = cpy; - } - break; - } - nargs = 0; - } - } else { - cmd = item[0]; - if (cmd == 'M' || cmd == 'm') { - // Commit path. - if (p->npts > 0) - nsvg__addPath(p, closedFlag); - // Start new subpath. - nsvg__resetPath(p); - closedFlag = 0; - nargs = 0; - } else if (initPoint == 0) { - // Do not allow other commands until initial point has been set (moveTo called once). - cmd = '\0'; - } - if (cmd == 'Z' || cmd == 'z') { - closedFlag = 1; - // Commit path. - if (p->npts > 0) { - // Move current point to first point - cpx = p->pts[0]; - cpy = p->pts[1]; - cpx2 = cpx; cpy2 = cpy; - nsvg__addPath(p, closedFlag); - } - // Start new subpath. - nsvg__resetPath(p); - nsvg__moveTo(p, cpx, cpy); - closedFlag = 0; - nargs = 0; - } - rargs = nsvg__getArgsPerElement(cmd); - if (rargs == -1) { - // Command not recognized - cmd = '\0'; - rargs = 0; - } - } - } - // Commit path. - if (p->npts) - nsvg__addPath(p, closedFlag); - } - - nsvg__addShape(p); -} - -static void nsvg__parseRect(NSVGparser* p, const char** attr) -{ - float x = 0.0f; - float y = 0.0f; - float w = 0.0f; - float h = 0.0f; - float rx = -1.0f; // marks not set - float ry = -1.0f; - int i; - - for (i = 0; attr[i]; i += 2) { - if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { - if (strcmp(attr[i], "x") == 0) x = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); - if (strcmp(attr[i], "y") == 0) y = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); - if (strcmp(attr[i], "width") == 0) w = nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualWidth(p)); - if (strcmp(attr[i], "height") == 0) h = nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualHeight(p)); - if (strcmp(attr[i], "rx") == 0) rx = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualWidth(p))); - if (strcmp(attr[i], "ry") == 0) ry = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualHeight(p))); - } - } - - if (rx < 0.0f && ry > 0.0f) rx = ry; - if (ry < 0.0f && rx > 0.0f) ry = rx; - if (rx < 0.0f) rx = 0.0f; - if (ry < 0.0f) ry = 0.0f; - if (rx > w/2.0f) rx = w/2.0f; - if (ry > h/2.0f) ry = h/2.0f; - - if (w != 0.0f && h != 0.0f) { - nsvg__resetPath(p); - - if (rx < 0.00001f || ry < 0.0001f) { - nsvg__moveTo(p, x, y); - nsvg__lineTo(p, x+w, y); - nsvg__lineTo(p, x+w, y+h); - nsvg__lineTo(p, x, y+h); - } else { - // Rounded rectangle - nsvg__moveTo(p, x+rx, y); - nsvg__lineTo(p, x+w-rx, y); - nsvg__cubicBezTo(p, x+w-rx*(1-NSVG_KAPPA90), y, x+w, y+ry*(1-NSVG_KAPPA90), x+w, y+ry); - nsvg__lineTo(p, x+w, y+h-ry); - nsvg__cubicBezTo(p, x+w, y+h-ry*(1-NSVG_KAPPA90), x+w-rx*(1-NSVG_KAPPA90), y+h, x+w-rx, y+h); - nsvg__lineTo(p, x+rx, y+h); - nsvg__cubicBezTo(p, x+rx*(1-NSVG_KAPPA90), y+h, x, y+h-ry*(1-NSVG_KAPPA90), x, y+h-ry); - nsvg__lineTo(p, x, y+ry); - nsvg__cubicBezTo(p, x, y+ry*(1-NSVG_KAPPA90), x+rx*(1-NSVG_KAPPA90), y, x+rx, y); - } - - nsvg__addPath(p, 1); - - nsvg__addShape(p); - } -} - -static void nsvg__parseCircle(NSVGparser* p, const char** attr) -{ - float cx = 0.0f; - float cy = 0.0f; - float r = 0.0f; - int i; - - for (i = 0; attr[i]; i += 2) { - if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { - if (strcmp(attr[i], "cx") == 0) cx = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); - if (strcmp(attr[i], "cy") == 0) cy = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); - if (strcmp(attr[i], "r") == 0) r = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualLength(p))); - } - } - - if (r > 0.0f) { - nsvg__resetPath(p); - - nsvg__moveTo(p, cx+r, cy); - nsvg__cubicBezTo(p, cx+r, cy+r*NSVG_KAPPA90, cx+r*NSVG_KAPPA90, cy+r, cx, cy+r); - nsvg__cubicBezTo(p, cx-r*NSVG_KAPPA90, cy+r, cx-r, cy+r*NSVG_KAPPA90, cx-r, cy); - nsvg__cubicBezTo(p, cx-r, cy-r*NSVG_KAPPA90, cx-r*NSVG_KAPPA90, cy-r, cx, cy-r); - nsvg__cubicBezTo(p, cx+r*NSVG_KAPPA90, cy-r, cx+r, cy-r*NSVG_KAPPA90, cx+r, cy); - - nsvg__addPath(p, 1); - - nsvg__addShape(p); - } -} - -static void nsvg__parseEllipse(NSVGparser* p, const char** attr) -{ - float cx = 0.0f; - float cy = 0.0f; - float rx = 0.0f; - float ry = 0.0f; - int i; - - for (i = 0; attr[i]; i += 2) { - if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { - if (strcmp(attr[i], "cx") == 0) cx = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); - if (strcmp(attr[i], "cy") == 0) cy = nsvg__parseCoordinate(p, attr[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); - if (strcmp(attr[i], "rx") == 0) rx = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualWidth(p))); - if (strcmp(attr[i], "ry") == 0) ry = fabsf(nsvg__parseCoordinate(p, attr[i+1], 0.0f, nsvg__actualHeight(p))); - } - } - - if (rx > 0.0f && ry > 0.0f) { - - nsvg__resetPath(p); - - nsvg__moveTo(p, cx+rx, cy); - nsvg__cubicBezTo(p, cx+rx, cy+ry*NSVG_KAPPA90, cx+rx*NSVG_KAPPA90, cy+ry, cx, cy+ry); - nsvg__cubicBezTo(p, cx-rx*NSVG_KAPPA90, cy+ry, cx-rx, cy+ry*NSVG_KAPPA90, cx-rx, cy); - nsvg__cubicBezTo(p, cx-rx, cy-ry*NSVG_KAPPA90, cx-rx*NSVG_KAPPA90, cy-ry, cx, cy-ry); - nsvg__cubicBezTo(p, cx+rx*NSVG_KAPPA90, cy-ry, cx+rx, cy-ry*NSVG_KAPPA90, cx+rx, cy); - - nsvg__addPath(p, 1); - - nsvg__addShape(p); - } -} - -static void nsvg__parseLine(NSVGparser* p, const char** attr) -{ - float x1 = 0.0; - float y1 = 0.0; - float x2 = 0.0; - float y2 = 0.0; - int i; - - for (i = 0; attr[i]; i += 2) { - if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { - if (strcmp(attr[i], "x1") == 0) x1 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); - if (strcmp(attr[i], "y1") == 0) y1 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); - if (strcmp(attr[i], "x2") == 0) x2 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); - if (strcmp(attr[i], "y2") == 0) y2 = nsvg__parseCoordinate(p, attr[i + 1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); - } - } - - nsvg__resetPath(p); - - nsvg__moveTo(p, x1, y1); - nsvg__lineTo(p, x2, y2); - - nsvg__addPath(p, 0); - - nsvg__addShape(p); -} - -static void nsvg__parsePoly(NSVGparser* p, const char** attr, int closeFlag) -{ - int i; - const char* s; - float args[2]; - int nargs, npts = 0; - char item[64]; - - nsvg__resetPath(p); - - for (i = 0; attr[i]; i += 2) { - if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { - if (strcmp(attr[i], "points") == 0) { - s = attr[i + 1]; - nargs = 0; - while (*s) { - s = nsvg__getNextPathItem(s, item); - args[nargs++] = (float)nsvg__atof(item); - if (nargs >= 2) { - if (npts == 0) - nsvg__moveTo(p, args[0], args[1]); - else - nsvg__lineTo(p, args[0], args[1]); - nargs = 0; - npts++; - } - } - } - } - } - - nsvg__addPath(p, (char)closeFlag); - - nsvg__addShape(p); -} - -static void nsvg__parseSVG(NSVGparser* p, const char** attr) -{ - int i; - for (i = 0; attr[i]; i += 2) { - if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { - if (strcmp(attr[i], "width") == 0) { - p->image->width = nsvg__parseCoordinate(p, attr[i + 1], 0.0f, 0.0f); - } else if (strcmp(attr[i], "height") == 0) { - p->image->height = nsvg__parseCoordinate(p, attr[i + 1], 0.0f, 0.0f); - } else if (strcmp(attr[i], "viewBox") == 0) { - const char *s = attr[i + 1]; - char buf[64]; - s = nsvg__parseNumber(s, buf, 64); - p->viewMinx = nsvg__atof(buf); - while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; - if (!*s) return; - s = nsvg__parseNumber(s, buf, 64); - p->viewMiny = nsvg__atof(buf); - while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; - if (!*s) return; - s = nsvg__parseNumber(s, buf, 64); - p->viewWidth = nsvg__atof(buf); - while (*s && (nsvg__isspace(*s) || *s == '%' || *s == ',')) s++; - if (!*s) return; - s = nsvg__parseNumber(s, buf, 64); - p->viewHeight = nsvg__atof(buf); - } else if (strcmp(attr[i], "preserveAspectRatio") == 0) { - if (strstr(attr[i + 1], "none") != 0) { - // No uniform scaling - p->alignType = NSVG_ALIGN_NONE; - } else { - // Parse X align - if (strstr(attr[i + 1], "xMin") != 0) - p->alignX = NSVG_ALIGN_MIN; - else if (strstr(attr[i + 1], "xMid") != 0) - p->alignX = NSVG_ALIGN_MID; - else if (strstr(attr[i + 1], "xMax") != 0) - p->alignX = NSVG_ALIGN_MAX; - // Parse X align - if (strstr(attr[i + 1], "yMin") != 0) - p->alignY = NSVG_ALIGN_MIN; - else if (strstr(attr[i + 1], "yMid") != 0) - p->alignY = NSVG_ALIGN_MID; - else if (strstr(attr[i + 1], "yMax") != 0) - p->alignY = NSVG_ALIGN_MAX; - // Parse meet/slice - p->alignType = NSVG_ALIGN_MEET; - if (strstr(attr[i + 1], "slice") != 0) - p->alignType = NSVG_ALIGN_SLICE; - } - } - } - } -} - -static void nsvg__parseGradient(NSVGparser* p, const char** attr, signed char type) -{ - int i; - NSVGgradientData* grad = (NSVGgradientData*)NVG_MALLOC(sizeof(NSVGgradientData)); - if (grad == NULL) return; - memset(grad, 0, sizeof(NSVGgradientData)); - grad->units = NSVG_OBJECT_SPACE; - grad->type = type; - if (grad->type == NSVG_PAINT_LINEAR_GRADIENT) { - grad->linear.x1 = nsvg__coord(0.0f, NSVG_UNITS_PERCENT); - grad->linear.y1 = nsvg__coord(0.0f, NSVG_UNITS_PERCENT); - grad->linear.x2 = nsvg__coord(100.0f, NSVG_UNITS_PERCENT); - grad->linear.y2 = nsvg__coord(0.0f, NSVG_UNITS_PERCENT); - } else if (grad->type == NSVG_PAINT_RADIAL_GRADIENT) { - grad->radial.cx = nsvg__coord(50.0f, NSVG_UNITS_PERCENT); - grad->radial.cy = nsvg__coord(50.0f, NSVG_UNITS_PERCENT); - grad->radial.r = nsvg__coord(50.0f, NSVG_UNITS_PERCENT); - } - - nsvg__xformIdentity(grad->xform); - - for (i = 0; attr[i]; i += 2) { - if (strcmp(attr[i], "id") == 0) { - strncpy(grad->id, attr[i+1], 63); - grad->id[63] = '\0'; - } else if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) { - if (strcmp(attr[i], "gradientUnits") == 0) { - if (strcmp(attr[i+1], "objectBoundingBox") == 0) - grad->units = NSVG_OBJECT_SPACE; - else - grad->units = NSVG_USER_SPACE; - } else if (strcmp(attr[i], "gradientTransform") == 0) { - nsvg__parseTransform(grad->xform, attr[i + 1]); - } else if (strcmp(attr[i], "cx") == 0) { - grad->radial.cx = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "cy") == 0) { - grad->radial.cy = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "r") == 0) { - grad->radial.r = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "fx") == 0) { - grad->radial.fx = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "fy") == 0) { - grad->radial.fy = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "x1") == 0) { - grad->linear.x1 = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "y1") == 0) { - grad->linear.y1 = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "x2") == 0) { - grad->linear.x2 = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "y2") == 0) { - grad->linear.y2 = nsvg__parseCoordinateRaw(attr[i + 1]); - } else if (strcmp(attr[i], "spreadMethod") == 0) { - if (strcmp(attr[i+1], "pad") == 0) - grad->spread = NSVG_SPREAD_PAD; - else if (strcmp(attr[i+1], "reflect") == 0) - grad->spread = NSVG_SPREAD_REFLECT; - else if (strcmp(attr[i+1], "repeat") == 0) - grad->spread = NSVG_SPREAD_REPEAT; - } else if (strcmp(attr[i], "xlink:href") == 0) { - const char *href = attr[i+1]; - strncpy(grad->ref, href+1, 62); - grad->ref[62] = '\0'; - } - } - } - - grad->next = p->gradients; - p->gradients = grad; -} - -static void nsvg__parseGradientStop(NSVGparser* p, const char** attr) -{ - NSVGattrib* curAttr = nsvg__getAttr(p); - NSVGgradientData* grad; - NSVGgradientStop* stop; - int i, idx; - - curAttr->stopOffset = 0; - curAttr->stopColor = 0; - curAttr->stopOpacity = 1.0f; - - for (i = 0; attr[i]; i += 2) { - nsvg__parseAttr(p, attr[i], attr[i + 1]); - } - - // Add stop to the last gradient. - grad = p->gradients; - if (grad == NULL) return; - - grad->nstops++; - grad->stops = (NSVGgradientStop*)NVG_REALLOC(grad->stops, sizeof(NSVGgradientStop)*grad->nstops); - if (grad->stops == NULL) return; - - // Insert - idx = grad->nstops-1; - for (i = 0; i < grad->nstops-1; i++) { - if (curAttr->stopOffset < grad->stops[i].offset) { - idx = i; - break; - } - } - if (idx != grad->nstops-1) { - for (i = grad->nstops-1; i > idx; i--) - grad->stops[i] = grad->stops[i-1]; - } - - stop = &grad->stops[idx]; - stop->color = curAttr->stopColor; - stop->color |= (unsigned int)(curAttr->stopOpacity*255) << 24; - stop->offset = curAttr->stopOffset; -} - -static void nsvg__startElement(void* ud, const char* el, const char** attr) -{ - NSVGparser* p = (NSVGparser*)ud; - - if (p->defsFlag) { - // Skip everything but gradients in defs - if (strcmp(el, "linearGradient") == 0) { - nsvg__parseGradient(p, attr, NSVG_PAINT_LINEAR_GRADIENT); - } else if (strcmp(el, "radialGradient") == 0) { - nsvg__parseGradient(p, attr, NSVG_PAINT_RADIAL_GRADIENT); - } else if (strcmp(el, "stop") == 0) { - nsvg__parseGradientStop(p, attr); - } - return; - } - - if (strcmp(el, "g") == 0) { - nsvg__pushAttr(p); - nsvg__parseAttribs(p, attr); - } else if (strcmp(el, "path") == 0) { - if (p->pathFlag) // Do not allow nested paths. - return; - nsvg__pushAttr(p); - nsvg__parsePath(p, attr); - nsvg__popAttr(p); - } else if (strcmp(el, "rect") == 0) { - nsvg__pushAttr(p); - nsvg__parseRect(p, attr); - nsvg__popAttr(p); - } else if (strcmp(el, "circle") == 0) { - nsvg__pushAttr(p); - nsvg__parseCircle(p, attr); - nsvg__popAttr(p); - } else if (strcmp(el, "ellipse") == 0) { - nsvg__pushAttr(p); - nsvg__parseEllipse(p, attr); - nsvg__popAttr(p); - } else if (strcmp(el, "line") == 0) { - nsvg__pushAttr(p); - nsvg__parseLine(p, attr); - nsvg__popAttr(p); - } else if (strcmp(el, "polyline") == 0) { - nsvg__pushAttr(p); - nsvg__parsePoly(p, attr, 0); - nsvg__popAttr(p); - } else if (strcmp(el, "polygon") == 0) { - nsvg__pushAttr(p); - nsvg__parsePoly(p, attr, 1); - nsvg__popAttr(p); - } else if (strcmp(el, "linearGradient") == 0) { - nsvg__parseGradient(p, attr, NSVG_PAINT_LINEAR_GRADIENT); - } else if (strcmp(el, "radialGradient") == 0) { - nsvg__parseGradient(p, attr, NSVG_PAINT_RADIAL_GRADIENT); - } else if (strcmp(el, "stop") == 0) { - nsvg__parseGradientStop(p, attr); - } else if (strcmp(el, "defs") == 0) { - p->defsFlag = 1; - } else if (strcmp(el, "svg") == 0) { - nsvg__parseSVG(p, attr); - } -} - -static void nsvg__endElement(void* ud, const char* el) -{ - NSVGparser* p = (NSVGparser*)ud; - - if (strcmp(el, "g") == 0) { - nsvg__popAttr(p); - } else if (strcmp(el, "path") == 0) { - p->pathFlag = 0; - } else if (strcmp(el, "defs") == 0) { - p->defsFlag = 0; - } -} - -static void nsvg__content(void* ud, const char* s) -{ - NSVG_NOTUSED(ud); - NSVG_NOTUSED(s); - // empty -} - -static void nsvg__imageBounds(NSVGparser* p, float* bounds) -{ - NSVGshape* shape; - shape = p->image->shapes; - if (shape == NULL) { - bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0; - return; - } - bounds[0] = shape->bounds[0]; - bounds[1] = shape->bounds[1]; - bounds[2] = shape->bounds[2]; - bounds[3] = shape->bounds[3]; - for (shape = shape->next; shape != NULL; shape = shape->next) { - bounds[0] = nsvg__minf(bounds[0], shape->bounds[0]); - bounds[1] = nsvg__minf(bounds[1], shape->bounds[1]); - bounds[2] = nsvg__maxf(bounds[2], shape->bounds[2]); - bounds[3] = nsvg__maxf(bounds[3], shape->bounds[3]); - } -} - -static float nsvg__viewAlign(float content, float container, int type) -{ - if (type == NSVG_ALIGN_MIN) - return 0; - else if (type == NSVG_ALIGN_MAX) - return container - content; - // mid - return (container - content) * 0.5f; -} - -static void nsvg__scaleGradient(NSVGgradient* grad, float tx, float ty, float sx, float sy) -{ - float t[6]; - nsvg__xformSetTranslation(t, tx, ty); - nsvg__xformMultiply (grad->xform, t); - - nsvg__xformSetScale(t, sx, sy); - nsvg__xformMultiply (grad->xform, t); -} - -static void nsvg__scaleToViewbox(NSVGparser* p, const char* units) -{ - NSVGshape* shape; - NSVGpath* path; - float tx, ty, sx, sy, us, bounds[4], t[6], avgs; - int i; - float* pt; - - // Guess image size if not set completely. - nsvg__imageBounds(p, bounds); - - if (p->viewWidth == 0) { - if (p->image->width > 0) { - p->viewWidth = p->image->width; - } else { - p->viewMinx = bounds[0]; - p->viewWidth = bounds[2] - bounds[0]; - } - } - if (p->viewHeight == 0) { - if (p->image->height > 0) { - p->viewHeight = p->image->height; - } else { - p->viewMiny = bounds[1]; - p->viewHeight = bounds[3] - bounds[1]; - } - } - if (p->image->width == 0) - p->image->width = p->viewWidth; - if (p->image->height == 0) - p->image->height = p->viewHeight; - - tx = -p->viewMinx; - ty = -p->viewMiny; - sx = p->viewWidth > 0 ? p->image->width / p->viewWidth : 0; - sy = p->viewHeight > 0 ? p->image->height / p->viewHeight : 0; - // Unit scaling - us = 1.0f / nsvg__convertToPixels(p, nsvg__coord(1.0f, nsvg__parseUnits(units)), 0.0f, 1.0f); - - // Fix aspect ratio - if (p->alignType == NSVG_ALIGN_MEET) { - // fit whole image into viewbox - sx = sy = nsvg__minf(sx, sy); - tx += nsvg__viewAlign(p->viewWidth*sx, p->image->width, p->alignX) / sx; - ty += nsvg__viewAlign(p->viewHeight*sy, p->image->height, p->alignY) / sy; - } else if (p->alignType == NSVG_ALIGN_SLICE) { - // fill whole viewbox with image - sx = sy = nsvg__maxf(sx, sy); - tx += nsvg__viewAlign(p->viewWidth*sx, p->image->width, p->alignX) / sx; - ty += nsvg__viewAlign(p->viewHeight*sy, p->image->height, p->alignY) / sy; - } - - // Transform - sx *= us; - sy *= us; - avgs = (sx+sy) / 2.0f; - for (shape = p->image->shapes; shape != NULL; shape = shape->next) { - shape->bounds[0] = (shape->bounds[0] + tx) * sx; - shape->bounds[1] = (shape->bounds[1] + ty) * sy; - shape->bounds[2] = (shape->bounds[2] + tx) * sx; - shape->bounds[3] = (shape->bounds[3] + ty) * sy; - for (path = shape->paths; path != NULL; path = path->next) { - path->bounds[0] = (path->bounds[0] + tx) * sx; - path->bounds[1] = (path->bounds[1] + ty) * sy; - path->bounds[2] = (path->bounds[2] + tx) * sx; - path->bounds[3] = (path->bounds[3] + ty) * sy; - for (i =0; i < path->npts; i++) { - pt = &path->pts[i*2]; - pt[0] = (pt[0] + tx) * sx; - pt[1] = (pt[1] + ty) * sy; - } - } - - if (shape->fill.type == NSVG_PAINT_LINEAR_GRADIENT || shape->fill.type == NSVG_PAINT_RADIAL_GRADIENT) { - nsvg__scaleGradient(shape->fill.gradient, tx,ty, sx,sy); - memcpy(t, shape->fill.gradient->xform, sizeof(float)*6); - nsvg__xformInverse(shape->fill.gradient->xform, t); - } - if (shape->stroke.type == NSVG_PAINT_LINEAR_GRADIENT || shape->stroke.type == NSVG_PAINT_RADIAL_GRADIENT) { - nsvg__scaleGradient(shape->stroke.gradient, tx,ty, sx,sy); - memcpy(t, shape->stroke.gradient->xform, sizeof(float)*6); - nsvg__xformInverse(shape->stroke.gradient->xform, t); - } - - shape->strokeWidth *= avgs; - shape->strokeDashOffset *= avgs; - for (i = 0; i < shape->strokeDashCount; i++) - shape->strokeDashArray[i] *= avgs; - } -} - -static void nsvg__createGradients(NSVGparser* p) -{ - NSVGshape* shape; - - for (shape = p->image->shapes; shape != NULL; shape = shape->next) { - if (shape->fill.type == NSVG_PAINT_UNDEF) { - if (shape->fillGradient[0] != '\0') { - float inv[6], localBounds[4]; - nsvg__xformInverse(inv, shape->xform); - nsvg__getLocalBounds(localBounds, shape, inv); - shape->fill.gradient = nsvg__createGradient(p, shape->fillGradient, localBounds, shape->xform, &shape->fill.type); - } - if (shape->fill.type == NSVG_PAINT_UNDEF) { - shape->fill.type = NSVG_PAINT_NONE; - } - } - if (shape->stroke.type == NSVG_PAINT_UNDEF) { - if (shape->strokeGradient[0] != '\0') { - float inv[6], localBounds[4]; - nsvg__xformInverse(inv, shape->xform); - nsvg__getLocalBounds(localBounds, shape, inv); - shape->stroke.gradient = nsvg__createGradient(p, shape->strokeGradient, localBounds, shape->xform, &shape->stroke.type); - } - if (shape->stroke.type == NSVG_PAINT_UNDEF) { - shape->stroke.type = NSVG_PAINT_NONE; - } - } - } -} - -NSVGimage* nsvgParse(char* input, const char* units, float dpi) -{ - NSVGparser* p; - NSVGimage* ret = 0; - - p = nsvg__createParser(); - if (p == NULL) { - return NULL; - } - p->dpi = dpi; - - nsvg__parseXML(input, nsvg__startElement, nsvg__endElement, nsvg__content, p); - - // Create gradients after all definitions have been parsed - nsvg__createGradients(p); - - // Scale to viewBox - nsvg__scaleToViewbox(p, units); - - ret = p->image; - p->image = NULL; - - nsvg__deleteParser(p); - - return ret; -} - -NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi) -{ - FILE* fp = NULL; - size_t size; - char* data = NULL; - NSVGimage* image = NULL; - - fp = fopen(filename, "rb"); - if (!fp) goto error; - fseek(fp, 0, SEEK_END); - size = ftell(fp); - fseek(fp, 0, SEEK_SET); - data = (char*)NVG_MALLOC(size+1); - if (data == NULL) goto error; - if (fread(data, 1, size, fp) != size) goto error; - data[size] = '\0'; // Must be null terminated. - fclose(fp); - image = nsvgParse(data, units, dpi); - NVG_FREE(data); - - return image; - -error: - if (fp) fclose(fp); - if (data) NVG_FREE(data); - if (image) nsvgDelete(image); - return NULL; -} - -NSVGpath* nsvgDuplicatePath(NSVGpath* p) -{ - NSVGpath* res = NULL; - - if (p == NULL) - return NULL; - - res = (NSVGpath*)NVG_MALLOC(sizeof(NSVGpath)); - if (res == NULL) goto error; - memset(res, 0, sizeof(NSVGpath)); - - res->pts = (float*)NVG_MALLOC(p->npts*2*sizeof(float)); - if (res->pts == NULL) goto error; - memcpy(res->pts, p->pts, p->npts * sizeof(float) * 2); - res->npts = p->npts; - - memcpy(res->bounds, p->bounds, sizeof(p->bounds)); - - res->closed = p->closed; - - return res; - -error: - if (res != NULL) { - NVG_FREE(res->pts); - NVG_FREE(res); - } - return NULL; -} - -void nsvgDelete(NSVGimage* image) -{ - NSVGshape *snext, *shape; - if (image == NULL) return; - shape = image->shapes; - while (shape != NULL) { - snext = shape->next; - nsvg__deletePaths(shape->paths); - nsvg__deletePaint(&shape->fill); - nsvg__deletePaint(&shape->stroke); - NVG_FREE(shape); - shape = snext; - } - NVG_FREE(image); -} - -#endif // NANOSVG_IMPLEMENTATION - -#endif // NANOSVG_H diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/nanosvgrast.h b/FCLauncher/src/main/jni/lwjgl/nanovg/nanosvgrast.h deleted file mode 100644 index 7ca64ad9..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/nanosvgrast.h +++ /dev/null @@ -1,1458 +0,0 @@ -/* - * Copyright (c) 2013-14 Mikko Mononen memon@inside.org - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - * The polygon rasterization is heavily based on stb_truetype rasterizer - * by Sean Barrett - http://nothings.org/ - * - */ - -#ifndef NANOSVGRAST_H -#define NANOSVGRAST_H - -#include "nanosvg.h" - -#ifndef NANOSVGRAST_CPLUSPLUS -#ifdef __cplusplus -extern "C" { -#endif -#endif - -typedef struct NSVGrasterizer NSVGrasterizer; - -/* Example Usage: - // Load SVG - NSVGimage* image; - image = nsvgParseFromFile("test.svg", "px", 96); - - // Create rasterizer (can be used to render multiple images). - struct NSVGrasterizer* rast = nsvgCreateRasterizer(); - // Allocate memory for image - unsigned char* img = malloc(w*h*4); - // Rasterize - nsvgRasterize(rast, image, 0,0,1, img, w, h, w*4); -*/ - -// Allocated rasterizer context. -NSVGrasterizer* nsvgCreateRasterizer(void); - -// Rasterizes SVG image, returns RGBA image (non-premultiplied alpha) -// r - pointer to rasterizer context -// image - pointer to image to rasterize -// tx,ty - image offset (applied after scaling) -// scale - image scale -// dst - pointer to destination image data, 4 bytes per pixel (RGBA) -// w - width of the image to render -// h - height of the image to render -// stride - number of bytes per scaleline in the destination buffer -void nsvgRasterize(NSVGrasterizer* r, - NSVGimage* image, float tx, float ty, float scale, - unsigned char* dst, int w, int h, int stride); - -// Deletes rasterizer context. -void nsvgDeleteRasterizer(NSVGrasterizer*); - - -#ifndef NANOSVGRAST_CPLUSPLUS -#ifdef __cplusplus -} -#endif -#endif - -#ifdef NANOSVGRAST_IMPLEMENTATION - -#include -#include -#include - -#define NSVG__SUBSAMPLES 5 -#define NSVG__FIXSHIFT 10 -#define NSVG__FIX (1 << NSVG__FIXSHIFT) -#define NSVG__FIXMASK (NSVG__FIX-1) -#define NSVG__MEMPAGE_SIZE 1024 - -typedef struct NSVGedge { - float x0,y0, x1,y1; - int dir; - struct NSVGedge* next; -} NSVGedge; - -typedef struct NSVGpoint { - float x, y; - float dx, dy; - float len; - float dmx, dmy; - unsigned char flags; -} NSVGpoint; - -typedef struct NSVGactiveEdge { - int x,dx; - float ey; - int dir; - struct NSVGactiveEdge *next; -} NSVGactiveEdge; - -typedef struct NSVGmemPage { - unsigned char mem[NSVG__MEMPAGE_SIZE]; - int size; - struct NSVGmemPage* next; -} NSVGmemPage; - -typedef struct NSVGcachedPaint { - signed char type; - char spread; - float xform[6]; - unsigned int colors[256]; -} NSVGcachedPaint; - -struct NSVGrasterizer -{ - float px, py; - - float tessTol; - float distTol; - - NSVGedge* edges; - int nedges; - int cedges; - - NSVGpoint* points; - int npoints; - int cpoints; - - NSVGpoint* points2; - int npoints2; - int cpoints2; - - NSVGactiveEdge* freelist; - NSVGmemPage* pages; - NSVGmemPage* curpage; - - unsigned char* scanline; - int cscanline; - - unsigned char* bitmap; - int width, height, stride; -}; - -NSVGrasterizer* nsvgCreateRasterizer(void) -{ - NSVGrasterizer* r = (NSVGrasterizer*)NVG_MALLOC(sizeof(NSVGrasterizer)); - if (r == NULL) goto error; - memset(r, 0, sizeof(NSVGrasterizer)); - - r->tessTol = 0.25f; - r->distTol = 0.01f; - - return r; - -error: - nsvgDeleteRasterizer(r); - return NULL; -} - -void nsvgDeleteRasterizer(NSVGrasterizer* r) -{ - NSVGmemPage* p; - - if (r == NULL) return; - - p = r->pages; - while (p != NULL) { - NSVGmemPage* next = p->next; - NVG_FREE(p); - p = next; - } - - if (r->edges) NVG_FREE(r->edges); - if (r->points) NVG_FREE(r->points); - if (r->points2) NVG_FREE(r->points2); - if (r->scanline) NVG_FREE(r->scanline); - - NVG_FREE(r); -} - -static NSVGmemPage* nsvg__nextPage(NSVGrasterizer* r, NSVGmemPage* cur) -{ - NSVGmemPage *newp; - - // If using existing chain, return the next page in chain - if (cur != NULL && cur->next != NULL) { - return cur->next; - } - - // Alloc new page - newp = (NSVGmemPage*)NVG_MALLOC(sizeof(NSVGmemPage)); - if (newp == NULL) return NULL; - memset(newp, 0, sizeof(NSVGmemPage)); - - // Add to linked list - if (cur != NULL) - cur->next = newp; - else - r->pages = newp; - - return newp; -} - -static void nsvg__resetPool(NSVGrasterizer* r) -{ - NSVGmemPage* p = r->pages; - while (p != NULL) { - p->size = 0; - p = p->next; - } - r->curpage = r->pages; -} - -static unsigned char* nsvg__alloc(NSVGrasterizer* r, int size) -{ - unsigned char* buf; - if (size > NSVG__MEMPAGE_SIZE) return NULL; - if (r->curpage == NULL || r->curpage->size+size > NSVG__MEMPAGE_SIZE) { - r->curpage = nsvg__nextPage(r, r->curpage); - } - buf = &r->curpage->mem[r->curpage->size]; - r->curpage->size += size; - return buf; -} - -static int nsvg__ptEquals(float x1, float y1, float x2, float y2, float tol) -{ - float dx = x2 - x1; - float dy = y2 - y1; - return dx*dx + dy*dy < tol*tol; -} - -static void nsvg__addPathPoint(NSVGrasterizer* r, float x, float y, int flags) -{ - NSVGpoint* pt; - - if (r->npoints > 0) { - pt = &r->points[r->npoints-1]; - if (nsvg__ptEquals(pt->x,pt->y, x,y, r->distTol)) { - pt->flags = (unsigned char)(pt->flags | flags); - return; - } - } - - if (r->npoints+1 > r->cpoints) { - r->cpoints = r->cpoints > 0 ? r->cpoints * 2 : 64; - r->points = (NSVGpoint*)NVG_REALLOC(r->points, sizeof(NSVGpoint) * r->cpoints); - if (r->points == NULL) return; - } - - pt = &r->points[r->npoints]; - pt->x = x; - pt->y = y; - pt->flags = (unsigned char)flags; - r->npoints++; -} - -static void nsvg__appendPathPoint(NSVGrasterizer* r, NSVGpoint pt) -{ - if (r->npoints+1 > r->cpoints) { - r->cpoints = r->cpoints > 0 ? r->cpoints * 2 : 64; - r->points = (NSVGpoint*)NVG_REALLOC(r->points, sizeof(NSVGpoint) * r->cpoints); - if (r->points == NULL) return; - } - r->points[r->npoints] = pt; - r->npoints++; -} - -static void nsvg__duplicatePoints(NSVGrasterizer* r) -{ - if (r->npoints > r->cpoints2) { - r->cpoints2 = r->npoints; - r->points2 = (NSVGpoint*)NVG_REALLOC(r->points2, sizeof(NSVGpoint) * r->cpoints2); - if (r->points2 == NULL) return; - } - - memcpy(r->points2, r->points, sizeof(NSVGpoint) * r->npoints); - r->npoints2 = r->npoints; -} - -static void nsvg__addEdge(NSVGrasterizer* r, float x0, float y0, float x1, float y1) -{ - NSVGedge* e; - - // Skip horizontal edges - if (y0 == y1) - return; - - if (r->nedges+1 > r->cedges) { - r->cedges = r->cedges > 0 ? r->cedges * 2 : 64; - r->edges = (NSVGedge*)NVG_REALLOC(r->edges, sizeof(NSVGedge) * r->cedges); - if (r->edges == NULL) return; - } - - e = &r->edges[r->nedges]; - r->nedges++; - - if (y0 < y1) { - e->x0 = x0; - e->y0 = y0; - e->x1 = x1; - e->y1 = y1; - e->dir = 1; - } else { - e->x0 = x1; - e->y0 = y1; - e->x1 = x0; - e->y1 = y0; - e->dir = -1; - } -} - -static float nsvg__normalize(float *x, float* y) -{ - float d = sqrtf((*x)*(*x) + (*y)*(*y)); - if (d > 1e-6f) { - float id = 1.0f / d; - *x *= id; - *y *= id; - } - return d; -} - -static float nsvg__absf(float x) { return x < 0 ? -x : x; } - -static void nsvg__flattenCubicBez(NSVGrasterizer* r, - float x1, float y1, float x2, float y2, - float x3, float y3, float x4, float y4, - int level, int type) -{ - float x12,y12,x23,y23,x34,y34,x123,y123,x234,y234,x1234,y1234; - float dx,dy,d2,d3; - - if (level > 10) return; - - x12 = (x1+x2)*0.5f; - y12 = (y1+y2)*0.5f; - x23 = (x2+x3)*0.5f; - y23 = (y2+y3)*0.5f; - x34 = (x3+x4)*0.5f; - y34 = (y3+y4)*0.5f; - x123 = (x12+x23)*0.5f; - y123 = (y12+y23)*0.5f; - - dx = x4 - x1; - dy = y4 - y1; - d2 = nsvg__absf(((x2 - x4) * dy - (y2 - y4) * dx)); - d3 = nsvg__absf(((x3 - x4) * dy - (y3 - y4) * dx)); - - if ((d2 + d3)*(d2 + d3) < r->tessTol * (dx*dx + dy*dy)) { - nsvg__addPathPoint(r, x4, y4, type); - return; - } - - x234 = (x23+x34)*0.5f; - y234 = (y23+y34)*0.5f; - x1234 = (x123+x234)*0.5f; - y1234 = (y123+y234)*0.5f; - - nsvg__flattenCubicBez(r, x1,y1, x12,y12, x123,y123, x1234,y1234, level+1, 0); - nsvg__flattenCubicBez(r, x1234,y1234, x234,y234, x34,y34, x4,y4, level+1, type); -} - -static void nsvg__flattenShape(NSVGrasterizer* r, NSVGshape* shape, float scale) -{ - int i, j; - NSVGpath* path; - - for (path = shape->paths; path != NULL; path = path->next) { - r->npoints = 0; - // Flatten path - nsvg__addPathPoint(r, path->pts[0]*scale, path->pts[1]*scale, 0); - for (i = 0; i < path->npts-1; i += 3) { - float* p = &path->pts[i*2]; - nsvg__flattenCubicBez(r, p[0]*scale,p[1]*scale, p[2]*scale,p[3]*scale, p[4]*scale,p[5]*scale, p[6]*scale,p[7]*scale, 0, 0); - } - // Close path - nsvg__addPathPoint(r, path->pts[0]*scale, path->pts[1]*scale, 0); - // Build edges - for (i = 0, j = r->npoints-1; i < r->npoints; j = i++) - nsvg__addEdge(r, r->points[j].x, r->points[j].y, r->points[i].x, r->points[i].y); - } -} - -enum NSVGpointFlags -{ - NSVG_PT_CORNER = 0x01, - NSVG_PT_BEVEL = 0x02, - NSVG_PT_LEFT = 0x04 -}; - -static void nsvg__initClosed(NSVGpoint* left, NSVGpoint* right, NSVGpoint* p0, NSVGpoint* p1, float lineWidth) -{ - float w = lineWidth * 0.5f; - float dx = p1->x - p0->x; - float dy = p1->y - p0->y; - float len = nsvg__normalize(&dx, &dy); - float px = p0->x + dx*len*0.5f, py = p0->y + dy*len*0.5f; - float dlx = dy, dly = -dx; - float lx = px - dlx*w, ly = py - dly*w; - float rx = px + dlx*w, ry = py + dly*w; - left->x = lx; left->y = ly; - right->x = rx; right->y = ry; -} - -static void nsvg__buttCap(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right, NSVGpoint* p, float dx, float dy, float lineWidth, int connect) -{ - float w = lineWidth * 0.5f; - float px = p->x, py = p->y; - float dlx = dy, dly = -dx; - float lx = px - dlx*w, ly = py - dly*w; - float rx = px + dlx*w, ry = py + dly*w; - - nsvg__addEdge(r, lx, ly, rx, ry); - - if (connect) { - nsvg__addEdge(r, left->x, left->y, lx, ly); - nsvg__addEdge(r, rx, ry, right->x, right->y); - } - left->x = lx; left->y = ly; - right->x = rx; right->y = ry; -} - -static void nsvg__squareCap(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right, NSVGpoint* p, float dx, float dy, float lineWidth, int connect) -{ - float w = lineWidth * 0.5f; - float px = p->x - dx*w, py = p->y - dy*w; - float dlx = dy, dly = -dx; - float lx = px - dlx*w, ly = py - dly*w; - float rx = px + dlx*w, ry = py + dly*w; - - nsvg__addEdge(r, lx, ly, rx, ry); - - if (connect) { - nsvg__addEdge(r, left->x, left->y, lx, ly); - nsvg__addEdge(r, rx, ry, right->x, right->y); - } - left->x = lx; left->y = ly; - right->x = rx; right->y = ry; -} - -#ifndef NSVG_PI -#define NSVG_PI (3.14159265358979323846264338327f) -#endif - -static void nsvg__roundCap(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right, NSVGpoint* p, float dx, float dy, float lineWidth, int ncap, int connect) -{ - int i; - float w = lineWidth * 0.5f; - float px = p->x, py = p->y; - float dlx = dy, dly = -dx; - float lx = 0, ly = 0, rx = 0, ry = 0, prevx = 0, prevy = 0; - - for (i = 0; i < ncap; i++) { - float a = (float)i/(float)(ncap-1)*NSVG_PI; - float ax = cosf(a) * w, ay = sinf(a) * w; - float x = px - dlx*ax - dx*ay; - float y = py - dly*ax - dy*ay; - - if (i > 0) - nsvg__addEdge(r, prevx, prevy, x, y); - - prevx = x; - prevy = y; - - if (i == 0) { - lx = x; ly = y; - } else if (i == ncap-1) { - rx = x; ry = y; - } - } - - if (connect) { - nsvg__addEdge(r, left->x, left->y, lx, ly); - nsvg__addEdge(r, rx, ry, right->x, right->y); - } - - left->x = lx; left->y = ly; - right->x = rx; right->y = ry; -} - -static void nsvg__bevelJoin(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right, NSVGpoint* p0, NSVGpoint* p1, float lineWidth) -{ - float w = lineWidth * 0.5f; - float dlx0 = p0->dy, dly0 = -p0->dx; - float dlx1 = p1->dy, dly1 = -p1->dx; - float lx0 = p1->x - (dlx0 * w), ly0 = p1->y - (dly0 * w); - float rx0 = p1->x + (dlx0 * w), ry0 = p1->y + (dly0 * w); - float lx1 = p1->x - (dlx1 * w), ly1 = p1->y - (dly1 * w); - float rx1 = p1->x + (dlx1 * w), ry1 = p1->y + (dly1 * w); - - nsvg__addEdge(r, lx0, ly0, left->x, left->y); - nsvg__addEdge(r, lx1, ly1, lx0, ly0); - - nsvg__addEdge(r, right->x, right->y, rx0, ry0); - nsvg__addEdge(r, rx0, ry0, rx1, ry1); - - left->x = lx1; left->y = ly1; - right->x = rx1; right->y = ry1; -} - -static void nsvg__miterJoin(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right, NSVGpoint* p0, NSVGpoint* p1, float lineWidth) -{ - float w = lineWidth * 0.5f; - float dlx0 = p0->dy, dly0 = -p0->dx; - float dlx1 = p1->dy, dly1 = -p1->dx; - float lx0, rx0, lx1, rx1; - float ly0, ry0, ly1, ry1; - - if (p1->flags & NSVG_PT_LEFT) { - lx0 = lx1 = p1->x - p1->dmx * w; - ly0 = ly1 = p1->y - p1->dmy * w; - nsvg__addEdge(r, lx1, ly1, left->x, left->y); - - rx0 = p1->x + (dlx0 * w); - ry0 = p1->y + (dly0 * w); - rx1 = p1->x + (dlx1 * w); - ry1 = p1->y + (dly1 * w); - nsvg__addEdge(r, right->x, right->y, rx0, ry0); - nsvg__addEdge(r, rx0, ry0, rx1, ry1); - } else { - lx0 = p1->x - (dlx0 * w); - ly0 = p1->y - (dly0 * w); - lx1 = p1->x - (dlx1 * w); - ly1 = p1->y - (dly1 * w); - nsvg__addEdge(r, lx0, ly0, left->x, left->y); - nsvg__addEdge(r, lx1, ly1, lx0, ly0); - - rx0 = rx1 = p1->x + p1->dmx * w; - ry0 = ry1 = p1->y + p1->dmy * w; - nsvg__addEdge(r, right->x, right->y, rx1, ry1); - } - - left->x = lx1; left->y = ly1; - right->x = rx1; right->y = ry1; -} - -static void nsvg__roundJoin(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right, NSVGpoint* p0, NSVGpoint* p1, float lineWidth, int ncap) -{ - int i, n; - float w = lineWidth * 0.5f; - float dlx0 = p0->dy, dly0 = -p0->dx; - float dlx1 = p1->dy, dly1 = -p1->dx; - float a0 = atan2f(dly0, dlx0); - float a1 = atan2f(dly1, dlx1); - float da = a1 - a0; - float lx, ly, rx, ry; - - if (da < NSVG_PI) da += NSVG_PI*2; - if (da > NSVG_PI) da -= NSVG_PI*2; - - n = (int)ceilf((nsvg__absf(da) / NSVG_PI) * (float)ncap); - if (n < 2) n = 2; - if (n > ncap) n = ncap; - - lx = left->x; - ly = left->y; - rx = right->x; - ry = right->y; - - for (i = 0; i < n; i++) { - float u = (float)i/(float)(n-1); - float a = a0 + u*da; - float ax = cosf(a) * w, ay = sinf(a) * w; - float lx1 = p1->x - ax, ly1 = p1->y - ay; - float rx1 = p1->x + ax, ry1 = p1->y + ay; - - nsvg__addEdge(r, lx1, ly1, lx, ly); - nsvg__addEdge(r, rx, ry, rx1, ry1); - - lx = lx1; ly = ly1; - rx = rx1; ry = ry1; - } - - left->x = lx; left->y = ly; - right->x = rx; right->y = ry; -} - -static void nsvg__straightJoin(NSVGrasterizer* r, NSVGpoint* left, NSVGpoint* right, NSVGpoint* p1, float lineWidth) -{ - float w = lineWidth * 0.5f; - float lx = p1->x - (p1->dmx * w), ly = p1->y - (p1->dmy * w); - float rx = p1->x + (p1->dmx * w), ry = p1->y + (p1->dmy * w); - - nsvg__addEdge(r, lx, ly, left->x, left->y); - nsvg__addEdge(r, right->x, right->y, rx, ry); - - left->x = lx; left->y = ly; - right->x = rx; right->y = ry; -} - -static int nsvg__curveDivs(float r, float arc, float tol) -{ - float da = acosf(r / (r + tol)) * 2.0f; - int divs = (int)ceilf(arc / da); - if (divs < 2) divs = 2; - return divs; -} - -static void nsvg__expandStroke(NSVGrasterizer* r, NSVGpoint* points, int npoints, int closed, int lineJoin, int lineCap, float lineWidth) -{ - int ncap = nsvg__curveDivs(lineWidth*0.5f, NSVG_PI, r->tessTol); // Calculate divisions per half circle. - NSVGpoint left = {0,0,0,0,0,0,0,0}, right = {0,0,0,0,0,0,0,0}, firstLeft = {0,0,0,0,0,0,0,0}, firstRight = {0,0,0,0,0,0,0,0}; - NSVGpoint* p0, *p1; - int j, s, e; - - // Build stroke edges - if (closed) { - // Looping - p0 = &points[npoints-1]; - p1 = &points[0]; - s = 0; - e = npoints; - } else { - // Add cap - p0 = &points[0]; - p1 = &points[1]; - s = 1; - e = npoints-1; - } - - if (closed) { - nsvg__initClosed(&left, &right, p0, p1, lineWidth); - firstLeft = left; - firstRight = right; - } else { - // Add cap - float dx = p1->x - p0->x; - float dy = p1->y - p0->y; - nsvg__normalize(&dx, &dy); - if (lineCap == NSVG_CAP_BUTT) - nsvg__buttCap(r, &left, &right, p0, dx, dy, lineWidth, 0); - else if (lineCap == NSVG_CAP_SQUARE) - nsvg__squareCap(r, &left, &right, p0, dx, dy, lineWidth, 0); - else if (lineCap == NSVG_CAP_ROUND) - nsvg__roundCap(r, &left, &right, p0, dx, dy, lineWidth, ncap, 0); - } - - for (j = s; j < e; ++j) { - if (p1->flags & NSVG_PT_CORNER) { - if (lineJoin == NSVG_JOIN_ROUND) - nsvg__roundJoin(r, &left, &right, p0, p1, lineWidth, ncap); - else if (lineJoin == NSVG_JOIN_BEVEL || (p1->flags & NSVG_PT_BEVEL)) - nsvg__bevelJoin(r, &left, &right, p0, p1, lineWidth); - else - nsvg__miterJoin(r, &left, &right, p0, p1, lineWidth); - } else { - nsvg__straightJoin(r, &left, &right, p1, lineWidth); - } - p0 = p1++; - } - - if (closed) { - // Loop it - nsvg__addEdge(r, firstLeft.x, firstLeft.y, left.x, left.y); - nsvg__addEdge(r, right.x, right.y, firstRight.x, firstRight.y); - } else { - // Add cap - float dx = p1->x - p0->x; - float dy = p1->y - p0->y; - nsvg__normalize(&dx, &dy); - if (lineCap == NSVG_CAP_BUTT) - nsvg__buttCap(r, &right, &left, p1, -dx, -dy, lineWidth, 1); - else if (lineCap == NSVG_CAP_SQUARE) - nsvg__squareCap(r, &right, &left, p1, -dx, -dy, lineWidth, 1); - else if (lineCap == NSVG_CAP_ROUND) - nsvg__roundCap(r, &right, &left, p1, -dx, -dy, lineWidth, ncap, 1); - } -} - -static void nsvg__prepareStroke(NSVGrasterizer* r, float miterLimit, int lineJoin) -{ - int i, j; - NSVGpoint* p0, *p1; - - p0 = &r->points[r->npoints-1]; - p1 = &r->points[0]; - for (i = 0; i < r->npoints; i++) { - // Calculate segment direction and length - p0->dx = p1->x - p0->x; - p0->dy = p1->y - p0->y; - p0->len = nsvg__normalize(&p0->dx, &p0->dy); - // Advance - p0 = p1++; - } - - // calculate joins - p0 = &r->points[r->npoints-1]; - p1 = &r->points[0]; - for (j = 0; j < r->npoints; j++) { - float dlx0, dly0, dlx1, dly1, dmr2, cross; - dlx0 = p0->dy; - dly0 = -p0->dx; - dlx1 = p1->dy; - dly1 = -p1->dx; - // Calculate extrusions - p1->dmx = (dlx0 + dlx1) * 0.5f; - p1->dmy = (dly0 + dly1) * 0.5f; - dmr2 = p1->dmx*p1->dmx + p1->dmy*p1->dmy; - if (dmr2 > 0.000001f) { - float s2 = 1.0f / dmr2; - if (s2 > 600.0f) { - s2 = 600.0f; - } - p1->dmx *= s2; - p1->dmy *= s2; - } - - // Clear flags, but keep the corner. - p1->flags = (p1->flags & NSVG_PT_CORNER) ? NSVG_PT_CORNER : 0; - - // Keep track of left turns. - cross = p1->dx * p0->dy - p0->dx * p1->dy; - if (cross > 0.0f) - p1->flags |= NSVG_PT_LEFT; - - // Check to see if the corner needs to be beveled. - if (p1->flags & NSVG_PT_CORNER) { - if ((dmr2 * miterLimit*miterLimit) < 1.0f || lineJoin == NSVG_JOIN_BEVEL || lineJoin == NSVG_JOIN_ROUND) { - p1->flags |= NSVG_PT_BEVEL; - } - } - - p0 = p1++; - } -} - -static void nsvg__flattenShapeStroke(NSVGrasterizer* r, NSVGshape* shape, float scale) -{ - int i, j, closed; - NSVGpath* path; - NSVGpoint* p0, *p1; - float miterLimit = shape->miterLimit; - int lineJoin = shape->strokeLineJoin; - int lineCap = shape->strokeLineCap; - float lineWidth = shape->strokeWidth * scale; - - for (path = shape->paths; path != NULL; path = path->next) { - // Flatten path - r->npoints = 0; - nsvg__addPathPoint(r, path->pts[0]*scale, path->pts[1]*scale, NSVG_PT_CORNER); - for (i = 0; i < path->npts-1; i += 3) { - float* p = &path->pts[i*2]; - nsvg__flattenCubicBez(r, p[0]*scale,p[1]*scale, p[2]*scale,p[3]*scale, p[4]*scale,p[5]*scale, p[6]*scale,p[7]*scale, 0, NSVG_PT_CORNER); - } - if (r->npoints < 2) - continue; - - closed = path->closed; - - // If the first and last points are the same, remove the last, mark as closed path. - p0 = &r->points[r->npoints-1]; - p1 = &r->points[0]; - if (nsvg__ptEquals(p0->x,p0->y, p1->x,p1->y, r->distTol)) { - r->npoints--; - p0 = &r->points[r->npoints-1]; - closed = 1; - } - - if (shape->strokeDashCount > 0) { - int idash = 0, dashState = 1; - float totalDist = 0, dashLen, allDashLen, dashOffset; - NSVGpoint cur; - - if (closed) - nsvg__appendPathPoint(r, r->points[0]); - - // Duplicate points -> points2. - nsvg__duplicatePoints(r); - - r->npoints = 0; - cur = r->points2[0]; - nsvg__appendPathPoint(r, cur); - - // Figure out dash offset. - allDashLen = 0; - for (j = 0; j < shape->strokeDashCount; j++) - allDashLen += shape->strokeDashArray[j]; - if (shape->strokeDashCount & 1) - allDashLen *= 2.0f; - // Find location inside pattern - dashOffset = fmodf(shape->strokeDashOffset, allDashLen); - if (dashOffset < 0.0f) - dashOffset += allDashLen; - - while (dashOffset > shape->strokeDashArray[idash]) { - dashOffset -= shape->strokeDashArray[idash]; - idash = (idash + 1) % shape->strokeDashCount; - } - dashLen = (shape->strokeDashArray[idash] - dashOffset) * scale; - - for (j = 1; j < r->npoints2; ) { - float dx = r->points2[j].x - cur.x; - float dy = r->points2[j].y - cur.y; - float dist = sqrtf(dx*dx + dy*dy); - - if ((totalDist + dist) > dashLen) { - // Calculate intermediate point - float d = (dashLen - totalDist) / dist; - float x = cur.x + dx * d; - float y = cur.y + dy * d; - nsvg__addPathPoint(r, x, y, NSVG_PT_CORNER); - - // Stroke - if (r->npoints > 1 && dashState) { - nsvg__prepareStroke(r, miterLimit, lineJoin); - nsvg__expandStroke(r, r->points, r->npoints, 0, lineJoin, lineCap, lineWidth); - } - // Advance dash pattern - dashState = !dashState; - idash = (idash+1) % shape->strokeDashCount; - dashLen = shape->strokeDashArray[idash] * scale; - // Restart - cur.x = x; - cur.y = y; - cur.flags = NSVG_PT_CORNER; - totalDist = 0.0f; - r->npoints = 0; - nsvg__appendPathPoint(r, cur); - } else { - totalDist += dist; - cur = r->points2[j]; - nsvg__appendPathPoint(r, cur); - j++; - } - } - // Stroke any leftover path - if (r->npoints > 1 && dashState) - nsvg__expandStroke(r, r->points, r->npoints, 0, lineJoin, lineCap, lineWidth); - } else { - nsvg__prepareStroke(r, miterLimit, lineJoin); - nsvg__expandStroke(r, r->points, r->npoints, closed, lineJoin, lineCap, lineWidth); - } - } -} - -static int nsvg__cmpEdge(const void *p, const void *q) -{ - const NSVGedge* a = (const NSVGedge*)p; - const NSVGedge* b = (const NSVGedge*)q; - - if (a->y0 < b->y0) return -1; - if (a->y0 > b->y0) return 1; - return 0; -} - - -static NSVGactiveEdge* nsvg__addActive(NSVGrasterizer* r, NSVGedge* e, float startPoint) -{ - NSVGactiveEdge* z; - - if (r->freelist != NULL) { - // Restore from freelist. - z = r->freelist; - r->freelist = z->next; - } else { - // Alloc new edge. - z = (NSVGactiveEdge*)nsvg__alloc(r, sizeof(NSVGactiveEdge)); - if (z == NULL) return NULL; - } - - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); -// STBTT_assert(e->y0 <= start_point); - // round dx down to avoid going too far - if (dxdy < 0) - z->dx = (int)(-floorf(NSVG__FIX * -dxdy)); - else - z->dx = (int)floorf(NSVG__FIX * dxdy); - z->x = (int)floorf(NSVG__FIX * (e->x0 + dxdy * (startPoint - e->y0))); -// z->x -= off_x * FIX; - z->ey = e->y1; - z->next = 0; - z->dir = e->dir; - - return z; -} - -static void nsvg__freeActive(NSVGrasterizer* r, NSVGactiveEdge* z) -{ - z->next = r->freelist; - r->freelist = z; -} - -static void nsvg__fillScanline(unsigned char* scanline, int len, int x0, int x1, int maxWeight, int* xmin, int* xmax) -{ - int i = x0 >> NSVG__FIXSHIFT; - int j = x1 >> NSVG__FIXSHIFT; - if (i < *xmin) *xmin = i; - if (j > *xmax) *xmax = j; - if (i < len && j >= 0) { - if (i == j) { - // x0,x1 are the same pixel, so compute combined coverage - scanline[i] = (unsigned char)(scanline[i] + ((x1 - x0) * maxWeight >> NSVG__FIXSHIFT)); - } else { - if (i >= 0) // add antialiasing for x0 - scanline[i] = (unsigned char)(scanline[i] + (((NSVG__FIX - (x0 & NSVG__FIXMASK)) * maxWeight) >> NSVG__FIXSHIFT)); - else - i = -1; // clip - - if (j < len) // add antialiasing for x1 - scanline[j] = (unsigned char)(scanline[j] + (((x1 & NSVG__FIXMASK) * maxWeight) >> NSVG__FIXSHIFT)); - else - j = len; // clip - - for (++i; i < j; ++i) // fill pixels between x0 and x1 - scanline[i] = (unsigned char)(scanline[i] + maxWeight); - } - } -} - -// note: this routine clips fills that extend off the edges... ideally this -// wouldn't happen, but it could happen if the truetype glyph bounding boxes -// are wrong, or if the user supplies a too-small bitmap -static void nsvg__fillActiveEdges(unsigned char* scanline, int len, NSVGactiveEdge* e, int maxWeight, int* xmin, int* xmax, char fillRule) -{ - // non-zero winding fill - int x0 = 0, w = 0; - - if (fillRule == NSVG_FILLRULE_NONZERO) { - // Non-zero - while (e != NULL) { - if (w == 0) { - // if we're currently at zero, we need to record the edge start point - x0 = e->x; w += e->dir; - } else { - int x1 = e->x; w += e->dir; - // if we went to zero, we need to draw - if (w == 0) - nsvg__fillScanline(scanline, len, x0, x1, maxWeight, xmin, xmax); - } - e = e->next; - } - } else if (fillRule == NSVG_FILLRULE_EVENODD) { - // Even-odd - while (e != NULL) { - if (w == 0) { - // if we're currently at zero, we need to record the edge start point - x0 = e->x; w = 1; - } else { - int x1 = e->x; w = 0; - nsvg__fillScanline(scanline, len, x0, x1, maxWeight, xmin, xmax); - } - e = e->next; - } - } -} - -static float nsvg__clampf(float a, float mn, float mx) { return a < mn ? mn : (a > mx ? mx : a); } - -static unsigned int nsvg__RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) -{ - return ((unsigned int)r) | ((unsigned int)g << 8) | ((unsigned int)b << 16) | ((unsigned int)a << 24); -} - -static unsigned int nsvg__lerpRGBA(unsigned int c0, unsigned int c1, float u) -{ - int iu = (int)(nsvg__clampf(u, 0.0f, 1.0f) * 256.0f); - int r = (((c0) & 0xff)*(256-iu) + (((c1) & 0xff)*iu)) >> 8; - int g = (((c0>>8) & 0xff)*(256-iu) + (((c1>>8) & 0xff)*iu)) >> 8; - int b = (((c0>>16) & 0xff)*(256-iu) + (((c1>>16) & 0xff)*iu)) >> 8; - int a = (((c0>>24) & 0xff)*(256-iu) + (((c1>>24) & 0xff)*iu)) >> 8; - return nsvg__RGBA((unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a); -} - -static unsigned int nsvg__applyOpacity(unsigned int c, float u) -{ - int iu = (int)(nsvg__clampf(u, 0.0f, 1.0f) * 256.0f); - int r = (c) & 0xff; - int g = (c>>8) & 0xff; - int b = (c>>16) & 0xff; - int a = (((c>>24) & 0xff)*iu) >> 8; - return nsvg__RGBA((unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a); -} - -static inline int nsvg__div255(int x) -{ - return ((x+1) * 257) >> 16; -} - -static void nsvg__scanlineSolid(unsigned char* dst, int count, unsigned char* cover, int x, int y, - float tx, float ty, float scale, NSVGcachedPaint* cache) -{ - - if (cache->type == NSVG_PAINT_COLOR) { - int i, cr, cg, cb, ca; - cr = cache->colors[0] & 0xff; - cg = (cache->colors[0] >> 8) & 0xff; - cb = (cache->colors[0] >> 16) & 0xff; - ca = (cache->colors[0] >> 24) & 0xff; - - for (i = 0; i < count; i++) { - int r,g,b; - int a = nsvg__div255((int)cover[0] * ca); - int ia = 255 - a; - // Premultiply - r = nsvg__div255(cr * a); - g = nsvg__div255(cg * a); - b = nsvg__div255(cb * a); - - // Blend over - r += nsvg__div255(ia * (int)dst[0]); - g += nsvg__div255(ia * (int)dst[1]); - b += nsvg__div255(ia * (int)dst[2]); - a += nsvg__div255(ia * (int)dst[3]); - - dst[0] = (unsigned char)r; - dst[1] = (unsigned char)g; - dst[2] = (unsigned char)b; - dst[3] = (unsigned char)a; - - cover++; - dst += 4; - } - } else if (cache->type == NSVG_PAINT_LINEAR_GRADIENT) { - // TODO: spread modes. - // TODO: plenty of opportunities to optimize. - float fx, fy, dx, gy; - float* t = cache->xform; - int i, cr, cg, cb, ca; - unsigned int c; - - fx = ((float)x - tx) / scale; - fy = ((float)y - ty) / scale; - dx = 1.0f / scale; - - for (i = 0; i < count; i++) { - int r,g,b,a,ia; - gy = fx*t[1] + fy*t[3] + t[5]; - c = cache->colors[(int)nsvg__clampf(gy*255.0f, 0, 255.0f)]; - cr = (c) & 0xff; - cg = (c >> 8) & 0xff; - cb = (c >> 16) & 0xff; - ca = (c >> 24) & 0xff; - - a = nsvg__div255((int)cover[0] * ca); - ia = 255 - a; - - // Premultiply - r = nsvg__div255(cr * a); - g = nsvg__div255(cg * a); - b = nsvg__div255(cb * a); - - // Blend over - r += nsvg__div255(ia * (int)dst[0]); - g += nsvg__div255(ia * (int)dst[1]); - b += nsvg__div255(ia * (int)dst[2]); - a += nsvg__div255(ia * (int)dst[3]); - - dst[0] = (unsigned char)r; - dst[1] = (unsigned char)g; - dst[2] = (unsigned char)b; - dst[3] = (unsigned char)a; - - cover++; - dst += 4; - fx += dx; - } - } else if (cache->type == NSVG_PAINT_RADIAL_GRADIENT) { - // TODO: spread modes. - // TODO: plenty of opportunities to optimize. - // TODO: focus (fx,fy) - float fx, fy, dx, gx, gy, gd; - float* t = cache->xform; - int i, cr, cg, cb, ca; - unsigned int c; - - fx = ((float)x - tx) / scale; - fy = ((float)y - ty) / scale; - dx = 1.0f / scale; - - for (i = 0; i < count; i++) { - int r,g,b,a,ia; - gx = fx*t[0] + fy*t[2] + t[4]; - gy = fx*t[1] + fy*t[3] + t[5]; - gd = sqrtf(gx*gx + gy*gy); - c = cache->colors[(int)nsvg__clampf(gd*255.0f, 0, 255.0f)]; - cr = (c) & 0xff; - cg = (c >> 8) & 0xff; - cb = (c >> 16) & 0xff; - ca = (c >> 24) & 0xff; - - a = nsvg__div255((int)cover[0] * ca); - ia = 255 - a; - - // Premultiply - r = nsvg__div255(cr * a); - g = nsvg__div255(cg * a); - b = nsvg__div255(cb * a); - - // Blend over - r += nsvg__div255(ia * (int)dst[0]); - g += nsvg__div255(ia * (int)dst[1]); - b += nsvg__div255(ia * (int)dst[2]); - a += nsvg__div255(ia * (int)dst[3]); - - dst[0] = (unsigned char)r; - dst[1] = (unsigned char)g; - dst[2] = (unsigned char)b; - dst[3] = (unsigned char)a; - - cover++; - dst += 4; - fx += dx; - } - } -} - -static void nsvg__rasterizeSortedEdges(NSVGrasterizer *r, float tx, float ty, float scale, NSVGcachedPaint* cache, char fillRule) -{ - NSVGactiveEdge *active = NULL; - int y, s; - int e = 0; - int maxWeight = (255 / NSVG__SUBSAMPLES); // weight per vertical scanline - int xmin, xmax; - - for (y = 0; y < r->height; y++) { - memset(r->scanline, 0, r->width); - xmin = r->width; - xmax = 0; - for (s = 0; s < NSVG__SUBSAMPLES; ++s) { - // find center of pixel for this scanline - float scany = (float)(y*NSVG__SUBSAMPLES + s) + 0.5f; - NSVGactiveEdge **step = &active; - - // update all active edges; - // remove all active edges that terminate before the center of this scanline - while (*step) { - NSVGactiveEdge *z = *step; - if (z->ey <= scany) { - *step = z->next; // delete from list -// NSVG__assert(z->valid); - nsvg__freeActive(r, z); - } else { - z->x += z->dx; // advance to position for current scanline - step = &((*step)->next); // advance through list - } - } - - // resort the list if needed - for (;;) { - int changed = 0; - step = &active; - while (*step && (*step)->next) { - if ((*step)->x > (*step)->next->x) { - NSVGactiveEdge* t = *step; - NSVGactiveEdge* q = t->next; - t->next = q->next; - q->next = t; - *step = q; - changed = 1; - } - step = &(*step)->next; - } - if (!changed) break; - } - - // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline - while (e < r->nedges && r->edges[e].y0 <= scany) { - if (r->edges[e].y1 > scany) { - NSVGactiveEdge* z = nsvg__addActive(r, &r->edges[e], scany); - if (z == NULL) break; - // find insertion point - if (active == NULL) { - active = z; - } else if (z->x < active->x) { - // insert at front - z->next = active; - active = z; - } else { - // find thing to insert AFTER - NSVGactiveEdge* p = active; - while (p->next && p->next->x < z->x) - p = p->next; - // at this point, p->next->x is NOT < z->x - z->next = p->next; - p->next = z; - } - } - e++; - } - - // now process all active edges in non-zero fashion - if (active != NULL) - nsvg__fillActiveEdges(r->scanline, r->width, active, maxWeight, &xmin, &xmax, fillRule); - } - // Blit - if (xmin < 0) xmin = 0; - if (xmax > r->width-1) xmax = r->width-1; - if (xmin <= xmax) { - nsvg__scanlineSolid(&r->bitmap[y * r->stride] + xmin*4, xmax-xmin+1, &r->scanline[xmin], xmin, y, tx,ty, scale, cache); - } - } - -} - -static void nsvg__unpremultiplyAlpha(unsigned char* image, int w, int h, int stride) -{ - int x,y; - - // Unpremultiply - for (y = 0; y < h; y++) { - unsigned char *row = &image[y*stride]; - for (x = 0; x < w; x++) { - int r = row[0], g = row[1], b = row[2], a = row[3]; - if (a != 0) { - row[0] = (unsigned char)(r*255/a); - row[1] = (unsigned char)(g*255/a); - row[2] = (unsigned char)(b*255/a); - } - row += 4; - } - } - - // Defringe - for (y = 0; y < h; y++) { - unsigned char *row = &image[y*stride]; - for (x = 0; x < w; x++) { - int r = 0, g = 0, b = 0, a = row[3], n = 0; - if (a == 0) { - if (x-1 > 0 && row[-1] != 0) { - r += row[-4]; - g += row[-3]; - b += row[-2]; - n++; - } - if (x+1 < w && row[7] != 0) { - r += row[4]; - g += row[5]; - b += row[6]; - n++; - } - if (y-1 > 0 && row[-stride+3] != 0) { - r += row[-stride]; - g += row[-stride+1]; - b += row[-stride+2]; - n++; - } - if (y+1 < h && row[stride+3] != 0) { - r += row[stride]; - g += row[stride+1]; - b += row[stride+2]; - n++; - } - if (n > 0) { - row[0] = (unsigned char)(r/n); - row[1] = (unsigned char)(g/n); - row[2] = (unsigned char)(b/n); - } - } - row += 4; - } - } -} - - -static void nsvg__initPaint(NSVGcachedPaint* cache, NSVGpaint* paint, float opacity) -{ - int i, j; - NSVGgradient* grad; - - cache->type = paint->type; - - if (paint->type == NSVG_PAINT_COLOR) { - cache->colors[0] = nsvg__applyOpacity(paint->color, opacity); - return; - } - - grad = paint->gradient; - - cache->spread = grad->spread; - memcpy(cache->xform, grad->xform, sizeof(float)*6); - - if (grad->nstops == 0) { - for (i = 0; i < 256; i++) - cache->colors[i] = 0; - } if (grad->nstops == 1) { - for (i = 0; i < 256; i++) - cache->colors[i] = nsvg__applyOpacity(grad->stops[i].color, opacity); - } else { - unsigned int ca, cb = 0; - float ua, ub, du, u; - int ia, ib, count; - - ca = nsvg__applyOpacity(grad->stops[0].color, opacity); - ua = nsvg__clampf(grad->stops[0].offset, 0, 1); - ub = nsvg__clampf(grad->stops[grad->nstops-1].offset, ua, 1); - ia = (int)(ua * 255.0f); - ib = (int)(ub * 255.0f); - for (i = 0; i < ia; i++) { - cache->colors[i] = ca; - } - - for (i = 0; i < grad->nstops-1; i++) { - ca = nsvg__applyOpacity(grad->stops[i].color, opacity); - cb = nsvg__applyOpacity(grad->stops[i+1].color, opacity); - ua = nsvg__clampf(grad->stops[i].offset, 0, 1); - ub = nsvg__clampf(grad->stops[i+1].offset, 0, 1); - ia = (int)(ua * 255.0f); - ib = (int)(ub * 255.0f); - count = ib - ia; - if (count <= 0) continue; - u = 0; - du = 1.0f / (float)count; - for (j = 0; j < count; j++) { - cache->colors[ia+j] = nsvg__lerpRGBA(ca,cb,u); - u += du; - } - } - - for (i = ib; i < 256; i++) - cache->colors[i] = cb; - } - -} - -/* -static void dumpEdges(NSVGrasterizer* r, const char* name) -{ - float xmin = 0, xmax = 0, ymin = 0, ymax = 0; - NSVGedge *e = NULL; - int i; - if (r->nedges == 0) return; - FILE* fp = fopen(name, "w"); - if (fp == NULL) return; - - xmin = xmax = r->edges[0].x0; - ymin = ymax = r->edges[0].y0; - for (i = 0; i < r->nedges; i++) { - e = &r->edges[i]; - xmin = nsvg__minf(xmin, e->x0); - xmin = nsvg__minf(xmin, e->x1); - xmax = nsvg__maxf(xmax, e->x0); - xmax = nsvg__maxf(xmax, e->x1); - ymin = nsvg__minf(ymin, e->y0); - ymin = nsvg__minf(ymin, e->y1); - ymax = nsvg__maxf(ymax, e->y0); - ymax = nsvg__maxf(ymax, e->y1); - } - - fprintf(fp, "", xmin, ymin, (xmax - xmin), (ymax - ymin)); - - for (i = 0; i < r->nedges; i++) { - e = &r->edges[i]; - fprintf(fp ,"", e->x0,e->y0, e->x1,e->y1); - } - - for (i = 0; i < r->npoints; i++) { - if (i+1 < r->npoints) - fprintf(fp ,"", r->points[i].x, r->points[i].y, r->points[i+1].x, r->points[i+1].y); - fprintf(fp ,"", r->points[i].x, r->points[i].y, r->points[i].flags == 0 ? "#f00" : "#0f0"); - } - - fprintf(fp, ""); - fclose(fp); -} -*/ - -void nsvgRasterize(NSVGrasterizer* r, - NSVGimage* image, float tx, float ty, float scale, - unsigned char* dst, int w, int h, int stride) -{ - NSVGshape *shape = NULL; - NSVGedge *e = NULL; - NSVGcachedPaint cache; - int i; - - r->bitmap = dst; - r->width = w; - r->height = h; - r->stride = stride; - - if (w > r->cscanline) { - r->cscanline = w; - r->scanline = (unsigned char*)NVG_REALLOC(r->scanline, w); - if (r->scanline == NULL) return; - } - - for (i = 0; i < h; i++) - memset(&dst[i*stride], 0, w*4); - - for (shape = image->shapes; shape != NULL; shape = shape->next) { - if (!(shape->flags & NSVG_FLAGS_VISIBLE)) - continue; - - if (shape->fill.type != NSVG_PAINT_NONE) { - nsvg__resetPool(r); - r->freelist = NULL; - r->nedges = 0; - - nsvg__flattenShape(r, shape, scale); - - // Scale and translate edges - for (i = 0; i < r->nedges; i++) { - e = &r->edges[i]; - e->x0 = tx + e->x0; - e->y0 = (ty + e->y0) * NSVG__SUBSAMPLES; - e->x1 = tx + e->x1; - e->y1 = (ty + e->y1) * NSVG__SUBSAMPLES; - } - - // Rasterize edges - if (r->nedges != 0) - qsort(r->edges, r->nedges, sizeof(NSVGedge), nsvg__cmpEdge); - - // now, traverse the scanlines and find the intersections on each scanline, use non-zero rule - nsvg__initPaint(&cache, &shape->fill, shape->opacity); - - nsvg__rasterizeSortedEdges(r, tx,ty,scale, &cache, shape->fillRule); - } - if (shape->stroke.type != NSVG_PAINT_NONE && (shape->strokeWidth * scale) > 0.01f) { - nsvg__resetPool(r); - r->freelist = NULL; - r->nedges = 0; - - nsvg__flattenShapeStroke(r, shape, scale); - -// dumpEdges(r, "edge.svg"); - - // Scale and translate edges - for (i = 0; i < r->nedges; i++) { - e = &r->edges[i]; - e->x0 = tx + e->x0; - e->y0 = (ty + e->y0) * NSVG__SUBSAMPLES; - e->x1 = tx + e->x1; - e->y1 = (ty + e->y1) * NSVG__SUBSAMPLES; - } - - // Rasterize edges - if (r->nedges != 0) - qsort(r->edges, r->nedges, sizeof(NSVGedge), nsvg__cmpEdge); - - // now, traverse the scanlines and find the intersections on each scanline, use non-zero rule - nsvg__initPaint(&cache, &shape->stroke, shape->opacity); - - nsvg__rasterizeSortedEdges(r, tx,ty,scale, &cache, NSVG_FILLRULE_NONZERO); - } - } - - nsvg__unpremultiplyAlpha(dst, w, h, stride); - - r->bitmap = NULL; - r->width = 0; - r->height = 0; - r->stride = 0; -} - -#endif // NANOSVGRAST_IMPLEMENTATION - -#endif // NANOSVGRAST_H diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg.c b/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg.c deleted file mode 100644 index f56cf904..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg.c +++ /dev/null @@ -1,2947 +0,0 @@ -// -// Copyright (c) 2013 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#include -#include -#include -#include - -#include "nanovg.h" -#define FONTSTASH_IMPLEMENTATION -#include "fontstash.h" - -#ifndef NVG_NO_STB -//#define STB_IMAGE_IMPLEMENTATION -#include "lwjgl/stb/stb_image.h" -#endif - -#ifdef _MSC_VER -#pragma warning(disable: 4100) // unreferenced formal parameter -#pragma warning(disable: 4127) // conditional expression is constant -#pragma warning(disable: 4204) // nonstandard extension used : non-constant aggregate initializer -#pragma warning(disable: 4706) // assignment within conditional expression -#endif - -#define NVG_INIT_FONTIMAGE_SIZE 512 -#define NVG_MAX_FONTIMAGE_SIZE 2048 -#define NVG_MAX_FONTIMAGES 4 - -#define NVG_INIT_COMMANDS_SIZE 256 -#define NVG_INIT_POINTS_SIZE 128 -#define NVG_INIT_PATHS_SIZE 16 -#define NVG_INIT_VERTS_SIZE 256 - -#ifndef NVG_MAX_STATES -#define NVG_MAX_STATES 32 -#endif - -#define NVG_KAPPA90 0.5522847493f // Length proportional to radius of a cubic bezier handle for 90deg arcs. - -#define NVG_COUNTOF(arr) (sizeof(arr) / sizeof(0[arr])) - - -enum NVGcommands { - NVG_MOVETO = 0, - NVG_LINETO = 1, - NVG_BEZIERTO = 2, - NVG_CLOSE = 3, - NVG_WINDING = 4, -}; - -enum NVGpointFlags -{ - NVG_PT_CORNER = 0x01, - NVG_PT_LEFT = 0x02, - NVG_PT_BEVEL = 0x04, - NVG_PR_INNERBEVEL = 0x08, -}; - -struct NVGstate { - NVGcompositeOperationState compositeOperation; - int shapeAntiAlias; - NVGpaint fill; - NVGpaint stroke; - float strokeWidth; - float miterLimit; - int lineJoin; - int lineCap; - float alpha; - float xform[6]; - NVGscissor scissor; - float fontSize; - float letterSpacing; - float lineHeight; - float fontBlur; - int textAlign; - int fontId; -}; -typedef struct NVGstate NVGstate; - -struct NVGpoint { - float x,y; - float dx, dy; - float len; - float dmx, dmy; - unsigned char flags; -}; -typedef struct NVGpoint NVGpoint; - -struct NVGpathCache { - NVGpoint* points; - int npoints; - int cpoints; - NVGpath* paths; - int npaths; - int cpaths; - NVGvertex* verts; - int nverts; - int cverts; - float bounds[4]; -}; -typedef struct NVGpathCache NVGpathCache; - -struct NVGcontext { - NVGparams params; - float* commands; - int ccommands; - int ncommands; - float commandx, commandy; - NVGstate states[NVG_MAX_STATES]; - int nstates; - NVGpathCache* cache; - float tessTol; - float distTol; - float fringeWidth; - float devicePxRatio; - struct FONScontext* fs; - int fontImages[NVG_MAX_FONTIMAGES]; - int fontImageIdx; - int drawCallCount; - int fillTriCount; - int strokeTriCount; - int textTriCount; -}; - -static float nvg__sqrtf(float a) { return sqrtf(a); } -static float nvg__modf(float a, float b) { return fmodf(a, b); } -static float nvg__sinf(float a) { return sinf(a); } -static float nvg__cosf(float a) { return cosf(a); } -static float nvg__tanf(float a) { return tanf(a); } -static float nvg__atan2f(float a,float b) { return atan2f(a, b); } -static float nvg__acosf(float a) { return acosf(a); } - -static int nvg__mini(int a, int b) { return a < b ? a : b; } -static int nvg__maxi(int a, int b) { return a > b ? a : b; } -static int nvg__clampi(int a, int mn, int mx) { return a < mn ? mn : (a > mx ? mx : a); } -static float nvg__minf(float a, float b) { return a < b ? a : b; } -static float nvg__maxf(float a, float b) { return a > b ? a : b; } -static float nvg__absf(float a) { return a >= 0.0f ? a : -a; } -static float nvg__signf(float a) { return a >= 0.0f ? 1.0f : -1.0f; } -static float nvg__clampf(float a, float mn, float mx) { return a < mn ? mn : (a > mx ? mx : a); } -static float nvg__cross(float dx0, float dy0, float dx1, float dy1) { return dx1*dy0 - dx0*dy1; } - -static float nvg__normalize(float *x, float* y) -{ - float d = nvg__sqrtf((*x)*(*x) + (*y)*(*y)); - if (d > 1e-6f) { - float id = 1.0f / d; - *x *= id; - *y *= id; - } - return d; -} - - -static void nvg__deletePathCache(NVGpathCache* c) -{ - if (c == NULL) return; - if (c->points != NULL) NVG_FREE(c->points); - if (c->paths != NULL) NVG_FREE(c->paths); - if (c->verts != NULL) NVG_FREE(c->verts); - NVG_FREE(c); -} - -static NVGpathCache* nvg__allocPathCache(void) -{ - NVGpathCache* c = (NVGpathCache*)NVG_MALLOC(sizeof(NVGpathCache)); - if (c == NULL) goto error; - memset(c, 0, sizeof(NVGpathCache)); - - c->points = (NVGpoint*)NVG_MALLOC(sizeof(NVGpoint)*NVG_INIT_POINTS_SIZE); - if (!c->points) goto error; - c->npoints = 0; - c->cpoints = NVG_INIT_POINTS_SIZE; - - c->paths = (NVGpath*)NVG_MALLOC(sizeof(NVGpath)*NVG_INIT_PATHS_SIZE); - if (!c->paths) goto error; - c->npaths = 0; - c->cpaths = NVG_INIT_PATHS_SIZE; - - c->verts = (NVGvertex*)NVG_MALLOC(sizeof(NVGvertex)*NVG_INIT_VERTS_SIZE); - if (!c->verts) goto error; - c->nverts = 0; - c->cverts = NVG_INIT_VERTS_SIZE; - - return c; -error: - nvg__deletePathCache(c); - return NULL; -} - -static void nvg__setDevicePixelRatio(NVGcontext* ctx, float ratio) -{ - ctx->tessTol = 0.25f / ratio; - ctx->distTol = 0.01f / ratio; - ctx->fringeWidth = 1.0f / ratio; - ctx->devicePxRatio = ratio; -} - -static NVGcompositeOperationState nvg__compositeOperationState(int op) -{ - int sfactor, dfactor; - - if (op == NVG_SOURCE_OVER) - { - sfactor = NVG_ONE; - dfactor = NVG_ONE_MINUS_SRC_ALPHA; - } - else if (op == NVG_SOURCE_IN) - { - sfactor = NVG_DST_ALPHA; - dfactor = NVG_ZERO; - } - else if (op == NVG_SOURCE_OUT) - { - sfactor = NVG_ONE_MINUS_DST_ALPHA; - dfactor = NVG_ZERO; - } - else if (op == NVG_ATOP) - { - sfactor = NVG_DST_ALPHA; - dfactor = NVG_ONE_MINUS_SRC_ALPHA; - } - else if (op == NVG_DESTINATION_OVER) - { - sfactor = NVG_ONE_MINUS_DST_ALPHA; - dfactor = NVG_ONE; - } - else if (op == NVG_DESTINATION_IN) - { - sfactor = NVG_ZERO; - dfactor = NVG_SRC_ALPHA; - } - else if (op == NVG_DESTINATION_OUT) - { - sfactor = NVG_ZERO; - dfactor = NVG_ONE_MINUS_SRC_ALPHA; - } - else if (op == NVG_DESTINATION_ATOP) - { - sfactor = NVG_ONE_MINUS_DST_ALPHA; - dfactor = NVG_SRC_ALPHA; - } - else if (op == NVG_LIGHTER) - { - sfactor = NVG_ONE; - dfactor = NVG_ONE; - } - else if (op == NVG_COPY) - { - sfactor = NVG_ONE; - dfactor = NVG_ZERO; - } - else if (op == NVG_XOR) - { - sfactor = NVG_ONE_MINUS_DST_ALPHA; - dfactor = NVG_ONE_MINUS_SRC_ALPHA; - } - else - { - sfactor = NVG_ONE; - dfactor = NVG_ZERO; - } - - NVGcompositeOperationState state; - state.srcRGB = sfactor; - state.dstRGB = dfactor; - state.srcAlpha = sfactor; - state.dstAlpha = dfactor; - return state; -} - -static NVGstate* nvg__getState(NVGcontext* ctx) -{ - return &ctx->states[ctx->nstates-1]; -} - -NVGcontext* nvgCreateInternal(NVGparams* params) -{ - FONSparams fontParams; - NVGcontext* ctx = (NVGcontext*)NVG_MALLOC(sizeof(NVGcontext)); - int i; - if (ctx == NULL) goto error; - memset(ctx, 0, sizeof(NVGcontext)); - - ctx->params = *params; - for (i = 0; i < NVG_MAX_FONTIMAGES; i++) - ctx->fontImages[i] = 0; - - ctx->commands = (float*)NVG_MALLOC(sizeof(float)*NVG_INIT_COMMANDS_SIZE); - if (!ctx->commands) goto error; - ctx->ncommands = 0; - ctx->ccommands = NVG_INIT_COMMANDS_SIZE; - - ctx->cache = nvg__allocPathCache(); - if (ctx->cache == NULL) goto error; - - nvgSave(ctx); - nvgReset(ctx); - - nvg__setDevicePixelRatio(ctx, 1.0f); - - if (ctx->params.renderCreate(ctx->params.userPtr) == 0) goto error; - - // Init font rendering - memset(&fontParams, 0, sizeof(fontParams)); - fontParams.width = NVG_INIT_FONTIMAGE_SIZE; - fontParams.height = NVG_INIT_FONTIMAGE_SIZE; - fontParams.flags = FONS_ZERO_TOPLEFT; - fontParams.renderCreate = NULL; - fontParams.renderUpdate = NULL; - fontParams.renderDraw = NULL; - fontParams.renderDelete = NULL; - fontParams.userPtr = NULL; - ctx->fs = fonsCreateInternal(&fontParams); - if (ctx->fs == NULL) goto error; - - // Create font texture - ctx->fontImages[0] = ctx->params.renderCreateTexture(ctx->params.userPtr, NVG_TEXTURE_ALPHA, fontParams.width, fontParams.height, 0, NULL); - if (ctx->fontImages[0] == 0) goto error; - ctx->fontImageIdx = 0; - - return ctx; - -error: - nvgDeleteInternal(ctx); - return 0; -} - -NVGparams* nvgInternalParams(NVGcontext* ctx) -{ - return &ctx->params; -} - -void nvgDeleteInternal(NVGcontext* ctx) -{ - int i; - if (ctx == NULL) return; - if (ctx->commands != NULL) NVG_FREE(ctx->commands); - if (ctx->cache != NULL) nvg__deletePathCache(ctx->cache); - - if (ctx->fs) - fonsDeleteInternal(ctx->fs); - - for (i = 0; i < NVG_MAX_FONTIMAGES; i++) { - if (ctx->fontImages[i] != 0) { - nvgDeleteImage(ctx, ctx->fontImages[i]); - ctx->fontImages[i] = 0; - } - } - - if (ctx->params.renderDelete != NULL) - ctx->params.renderDelete(ctx->params.userPtr); - - NVG_FREE(ctx); -} - -void nvgBeginFrame(NVGcontext* ctx, float windowWidth, float windowHeight, float devicePixelRatio) -{ -/* printf("Tris: draws:%d fill:%d stroke:%d text:%d TOT:%d\n", - ctx->drawCallCount, ctx->fillTriCount, ctx->strokeTriCount, ctx->textTriCount, - ctx->fillTriCount+ctx->strokeTriCount+ctx->textTriCount);*/ - - ctx->nstates = 0; - nvgSave(ctx); - nvgReset(ctx); - - nvg__setDevicePixelRatio(ctx, devicePixelRatio); - - ctx->params.renderViewport(ctx->params.userPtr, windowWidth, windowHeight, devicePixelRatio); - - ctx->drawCallCount = 0; - ctx->fillTriCount = 0; - ctx->strokeTriCount = 0; - ctx->textTriCount = 0; -} - -void nvgCancelFrame(NVGcontext* ctx) -{ - ctx->params.renderCancel(ctx->params.userPtr); -} - -void nvgEndFrame(NVGcontext* ctx) -{ - ctx->params.renderFlush(ctx->params.userPtr); - if (ctx->fontImageIdx != 0) { - int fontImage = ctx->fontImages[ctx->fontImageIdx]; - ctx->fontImages[ctx->fontImageIdx] = 0; - int i, j, iw, ih; - // delete images that smaller than current one - if (fontImage == 0) - return; - nvgImageSize(ctx, fontImage, &iw, &ih); - for (i = j = 0; i < ctx->fontImageIdx; i++) { - if (ctx->fontImages[i] != 0) { - int nw, nh; - int image = ctx->fontImages[i]; - ctx->fontImages[i] = 0; - nvgImageSize(ctx, image, &nw, &nh); - if (nw < iw || nh < ih) - nvgDeleteImage(ctx, image); - else - ctx->fontImages[j++] = image; - } - } - // make current font image to first - ctx->fontImages[j] = ctx->fontImages[0]; - ctx->fontImages[0] = fontImage; - ctx->fontImageIdx = 0; - } -} - -NVGcolor nvgRGB(unsigned char r, unsigned char g, unsigned char b) -{ - return nvgRGBA(r,g,b,255); -} - -NVGcolor nvgRGBf(float r, float g, float b) -{ - return nvgRGBAf(r,g,b,1.0f); -} - -NVGcolor nvgRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) -{ - NVGcolor color; - // Use longer initialization to suppress warning. - color.r = r / 255.0f; - color.g = g / 255.0f; - color.b = b / 255.0f; - color.a = a / 255.0f; - return color; -} - -NVGcolor nvgRGBAf(float r, float g, float b, float a) -{ - NVGcolor color; - // Use longer initialization to suppress warning. - color.r = r; - color.g = g; - color.b = b; - color.a = a; - return color; -} - -NVGcolor nvgTransRGBA(NVGcolor c, unsigned char a) -{ - c.a = a / 255.0f; - return c; -} - -NVGcolor nvgTransRGBAf(NVGcolor c, float a) -{ - c.a = a; - return c; -} - -NVGcolor nvgLerpRGBA(NVGcolor c0, NVGcolor c1, float u) -{ - int i; - float oneminu; - NVGcolor cint = {{{0}}}; - - u = nvg__clampf(u, 0.0f, 1.0f); - oneminu = 1.0f - u; - for( i = 0; i <4; i++ ) - { - cint.rgba[i] = c0.rgba[i] * oneminu + c1.rgba[i] * u; - } - - return cint; -} - -NVGcolor nvgHSL(float h, float s, float l) -{ - return nvgHSLA(h,s,l,255); -} - -static float nvg__hue(float h, float m1, float m2) -{ - if (h < 0) h += 1; - if (h > 1) h -= 1; - if (h < 1.0f/6.0f) - return m1 + (m2 - m1) * h * 6.0f; - else if (h < 3.0f/6.0f) - return m2; - else if (h < 4.0f/6.0f) - return m1 + (m2 - m1) * (2.0f/3.0f - h) * 6.0f; - return m1; -} - -NVGcolor nvgHSLA(float h, float s, float l, unsigned char a) -{ - float m1, m2; - NVGcolor col; - h = nvg__modf(h, 1.0f); - if (h < 0.0f) h += 1.0f; - s = nvg__clampf(s, 0.0f, 1.0f); - l = nvg__clampf(l, 0.0f, 1.0f); - m2 = l <= 0.5f ? (l * (1 + s)) : (l + s - l * s); - m1 = 2 * l - m2; - col.r = nvg__clampf(nvg__hue(h + 1.0f/3.0f, m1, m2), 0.0f, 1.0f); - col.g = nvg__clampf(nvg__hue(h, m1, m2), 0.0f, 1.0f); - col.b = nvg__clampf(nvg__hue(h - 1.0f/3.0f, m1, m2), 0.0f, 1.0f); - col.a = a/255.0f; - return col; -} - -void nvgTransformIdentity(float* t) -{ - t[0] = 1.0f; t[1] = 0.0f; - t[2] = 0.0f; t[3] = 1.0f; - t[4] = 0.0f; t[5] = 0.0f; -} - -void nvgTransformTranslate(float* t, float tx, float ty) -{ - t[0] = 1.0f; t[1] = 0.0f; - t[2] = 0.0f; t[3] = 1.0f; - t[4] = tx; t[5] = ty; -} - -void nvgTransformScale(float* t, float sx, float sy) -{ - t[0] = sx; t[1] = 0.0f; - t[2] = 0.0f; t[3] = sy; - t[4] = 0.0f; t[5] = 0.0f; -} - -void nvgTransformRotate(float* t, float a) -{ - float cs = nvg__cosf(a), sn = nvg__sinf(a); - t[0] = cs; t[1] = sn; - t[2] = -sn; t[3] = cs; - t[4] = 0.0f; t[5] = 0.0f; -} - -void nvgTransformSkewX(float* t, float a) -{ - t[0] = 1.0f; t[1] = 0.0f; - t[2] = nvg__tanf(a); t[3] = 1.0f; - t[4] = 0.0f; t[5] = 0.0f; -} - -void nvgTransformSkewY(float* t, float a) -{ - t[0] = 1.0f; t[1] = nvg__tanf(a); - t[2] = 0.0f; t[3] = 1.0f; - t[4] = 0.0f; t[5] = 0.0f; -} - -void nvgTransformMultiply(float* t, const float* s) -{ - float t0 = t[0] * s[0] + t[1] * s[2]; - float t2 = t[2] * s[0] + t[3] * s[2]; - float t4 = t[4] * s[0] + t[5] * s[2] + s[4]; - t[1] = t[0] * s[1] + t[1] * s[3]; - t[3] = t[2] * s[1] + t[3] * s[3]; - t[5] = t[4] * s[1] + t[5] * s[3] + s[5]; - t[0] = t0; - t[2] = t2; - t[4] = t4; -} - -void nvgTransformPremultiply(float* t, const float* s) -{ - float s2[6]; - memcpy(s2, s, sizeof(float)*6); - nvgTransformMultiply(s2, t); - memcpy(t, s2, sizeof(float)*6); -} - -int nvgTransformInverse(float* inv, const float* t) -{ - double invdet, det = (double)t[0] * t[3] - (double)t[2] * t[1]; - if (det > -1e-6 && det < 1e-6) { - nvgTransformIdentity(inv); - return 0; - } - invdet = 1.0 / det; - inv[0] = (float)(t[3] * invdet); - inv[2] = (float)(-t[2] * invdet); - inv[4] = (float)(((double)t[2] * t[5] - (double)t[3] * t[4]) * invdet); - inv[1] = (float)(-t[1] * invdet); - inv[3] = (float)(t[0] * invdet); - inv[5] = (float)(((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet); - return 1; -} - -void nvgTransformPoint(float* dx, float* dy, const float* t, float sx, float sy) -{ - *dx = sx*t[0] + sy*t[2] + t[4]; - *dy = sx*t[1] + sy*t[3] + t[5]; -} - -float nvgDegToRad(float deg) -{ - return deg / 180.0f * NVG_PI; -} - -float nvgRadToDeg(float rad) -{ - return rad / NVG_PI * 180.0f; -} - -static void nvg__setPaintColor(NVGpaint* p, NVGcolor color) -{ - memset(p, 0, sizeof(*p)); - nvgTransformIdentity(p->xform); - p->radius = 0.0f; - p->feather = 1.0f; - p->innerColor = color; - p->outerColor = color; -} - - -// State handling -void nvgSave(NVGcontext* ctx) -{ - if (ctx->nstates >= NVG_MAX_STATES) - return; - if (ctx->nstates > 0) - memcpy(&ctx->states[ctx->nstates], &ctx->states[ctx->nstates-1], sizeof(NVGstate)); - ctx->nstates++; -} - -void nvgRestore(NVGcontext* ctx) -{ - if (ctx->nstates <= 1) - return; - ctx->nstates--; -} - -void nvgReset(NVGcontext* ctx) -{ - NVGstate* state = nvg__getState(ctx); - memset(state, 0, sizeof(*state)); - - nvg__setPaintColor(&state->fill, nvgRGBA(255,255,255,255)); - nvg__setPaintColor(&state->stroke, nvgRGBA(0,0,0,255)); - state->compositeOperation = nvg__compositeOperationState(NVG_SOURCE_OVER); - state->shapeAntiAlias = 1; - state->strokeWidth = 1.0f; - state->miterLimit = 10.0f; - state->lineCap = NVG_BUTT; - state->lineJoin = NVG_MITER; - state->alpha = 1.0f; - nvgTransformIdentity(state->xform); - - state->scissor.extent[0] = -1.0f; - state->scissor.extent[1] = -1.0f; - - state->fontSize = 16.0f; - state->letterSpacing = 0.0f; - state->lineHeight = 1.0f; - state->fontBlur = 0.0f; - state->textAlign = NVG_ALIGN_LEFT | NVG_ALIGN_BASELINE; - state->fontId = 0; -} - -// State setting -void nvgShapeAntiAlias(NVGcontext* ctx, int enabled) -{ - NVGstate* state = nvg__getState(ctx); - state->shapeAntiAlias = enabled; -} - -void nvgStrokeWidth(NVGcontext* ctx, float width) -{ - NVGstate* state = nvg__getState(ctx); - state->strokeWidth = width; -} - -void nvgMiterLimit(NVGcontext* ctx, float limit) -{ - NVGstate* state = nvg__getState(ctx); - state->miterLimit = limit; -} - -void nvgLineCap(NVGcontext* ctx, int cap) -{ - NVGstate* state = nvg__getState(ctx); - state->lineCap = cap; -} - -void nvgLineJoin(NVGcontext* ctx, int join) -{ - NVGstate* state = nvg__getState(ctx); - state->lineJoin = join; -} - -void nvgGlobalAlpha(NVGcontext* ctx, float alpha) -{ - NVGstate* state = nvg__getState(ctx); - state->alpha = alpha; -} - -void nvgTransform(NVGcontext* ctx, float a, float b, float c, float d, float e, float f) -{ - NVGstate* state = nvg__getState(ctx); - float t[6] = { a, b, c, d, e, f }; - nvgTransformPremultiply(state->xform, t); -} - -void nvgResetTransform(NVGcontext* ctx) -{ - NVGstate* state = nvg__getState(ctx); - nvgTransformIdentity(state->xform); -} - -void nvgTranslate(NVGcontext* ctx, float x, float y) -{ - NVGstate* state = nvg__getState(ctx); - float t[6]; - nvgTransformTranslate(t, x,y); - nvgTransformPremultiply(state->xform, t); -} - -void nvgRotate(NVGcontext* ctx, float angle) -{ - NVGstate* state = nvg__getState(ctx); - float t[6]; - nvgTransformRotate(t, angle); - nvgTransformPremultiply(state->xform, t); -} - -void nvgSkewX(NVGcontext* ctx, float angle) -{ - NVGstate* state = nvg__getState(ctx); - float t[6]; - nvgTransformSkewX(t, angle); - nvgTransformPremultiply(state->xform, t); -} - -void nvgSkewY(NVGcontext* ctx, float angle) -{ - NVGstate* state = nvg__getState(ctx); - float t[6]; - nvgTransformSkewY(t, angle); - nvgTransformPremultiply(state->xform, t); -} - -void nvgScale(NVGcontext* ctx, float x, float y) -{ - NVGstate* state = nvg__getState(ctx); - float t[6]; - nvgTransformScale(t, x,y); - nvgTransformPremultiply(state->xform, t); -} - -void nvgCurrentTransform(NVGcontext* ctx, float* xform) -{ - NVGstate* state = nvg__getState(ctx); - if (xform == NULL) return; - memcpy(xform, state->xform, sizeof(float)*6); -} - -void nvgStrokeColor(NVGcontext* ctx, NVGcolor color) -{ - NVGstate* state = nvg__getState(ctx); - nvg__setPaintColor(&state->stroke, color); -} - -void nvgStrokePaint(NVGcontext* ctx, NVGpaint paint) -{ - NVGstate* state = nvg__getState(ctx); - state->stroke = paint; - nvgTransformMultiply(state->stroke.xform, state->xform); -} - -void nvgFillColor(NVGcontext* ctx, NVGcolor color) -{ - NVGstate* state = nvg__getState(ctx); - nvg__setPaintColor(&state->fill, color); -} - -void nvgFillPaint(NVGcontext* ctx, NVGpaint paint) -{ - NVGstate* state = nvg__getState(ctx); - state->fill = paint; - nvgTransformMultiply(state->fill.xform, state->xform); -} - -#ifndef NVG_NO_STB -int nvgCreateImage(NVGcontext* ctx, const char* filename, int imageFlags) -{ - int w, h, n, image; - unsigned char* img; - stbi_set_unpremultiply_on_load(1); - stbi_convert_iphone_png_to_rgb(1); - img = stbi_load(filename, &w, &h, &n, 4); - if (img == NULL) { -// printf("Failed to load %s - %s\n", filename, stbi_failure_reason()); - return 0; - } - image = nvgCreateImageRGBA(ctx, w, h, imageFlags, img); - stbi_image_free(img); - return image; -} - -int nvgCreateImageMem(NVGcontext* ctx, int imageFlags, unsigned char* data, int ndata) -{ - int w, h, n, image; - unsigned char* img = stbi_load_from_memory(data, ndata, &w, &h, &n, 4); - if (img == NULL) { -// printf("Failed to load %s - %s\n", filename, stbi_failure_reason()); - return 0; - } - image = nvgCreateImageRGBA(ctx, w, h, imageFlags, img); - stbi_image_free(img); - return image; -} -#endif - -int nvgCreateImageRGBA(NVGcontext* ctx, int w, int h, int imageFlags, const unsigned char* data) -{ - return ctx->params.renderCreateTexture(ctx->params.userPtr, NVG_TEXTURE_RGBA, w, h, imageFlags, data); -} - -void nvgUpdateImage(NVGcontext* ctx, int image, const unsigned char* data) -{ - int w, h; - ctx->params.renderGetTextureSize(ctx->params.userPtr, image, &w, &h); - ctx->params.renderUpdateTexture(ctx->params.userPtr, image, 0,0, w,h, data); -} - -void nvgImageSize(NVGcontext* ctx, int image, int* w, int* h) -{ - ctx->params.renderGetTextureSize(ctx->params.userPtr, image, w, h); -} - -void nvgDeleteImage(NVGcontext* ctx, int image) -{ - ctx->params.renderDeleteTexture(ctx->params.userPtr, image); -} - -NVGpaint nvgLinearGradient(NVGcontext* ctx, - float sx, float sy, float ex, float ey, - NVGcolor icol, NVGcolor ocol) -{ - NVGpaint p; - float dx, dy, d; - const float large = 1e5; - NVG_NOTUSED(ctx); - memset(&p, 0, sizeof(p)); - - // Calculate transform aligned to the line - dx = ex - sx; - dy = ey - sy; - d = sqrtf(dx*dx + dy*dy); - if (d > 0.0001f) { - dx /= d; - dy /= d; - } else { - dx = 0; - dy = 1; - } - - p.xform[0] = dy; p.xform[1] = -dx; - p.xform[2] = dx; p.xform[3] = dy; - p.xform[4] = sx - dx*large; p.xform[5] = sy - dy*large; - - p.extent[0] = large; - p.extent[1] = large + d*0.5f; - - p.radius = 0.0f; - - p.feather = nvg__maxf(1.0f, d); - - p.innerColor = icol; - p.outerColor = ocol; - - return p; -} - -NVGpaint nvgRadialGradient(NVGcontext* ctx, - float cx, float cy, float inr, float outr, - NVGcolor icol, NVGcolor ocol) -{ - NVGpaint p; - float r = (inr+outr)*0.5f; - float f = (outr-inr); - NVG_NOTUSED(ctx); - memset(&p, 0, sizeof(p)); - - nvgTransformIdentity(p.xform); - p.xform[4] = cx; - p.xform[5] = cy; - - p.extent[0] = r; - p.extent[1] = r; - - p.radius = r; - - p.feather = nvg__maxf(1.0f, f); - - p.innerColor = icol; - p.outerColor = ocol; - - return p; -} - -NVGpaint nvgBoxGradient(NVGcontext* ctx, - float x, float y, float w, float h, float r, float f, - NVGcolor icol, NVGcolor ocol) -{ - NVGpaint p; - NVG_NOTUSED(ctx); - memset(&p, 0, sizeof(p)); - - nvgTransformIdentity(p.xform); - p.xform[4] = x+w*0.5f; - p.xform[5] = y+h*0.5f; - - p.extent[0] = w*0.5f; - p.extent[1] = h*0.5f; - - p.radius = r; - - p.feather = nvg__maxf(1.0f, f); - - p.innerColor = icol; - p.outerColor = ocol; - - return p; -} - - -NVGpaint nvgImagePattern(NVGcontext* ctx, - float cx, float cy, float w, float h, float angle, - int image, float alpha) -{ - NVGpaint p; - NVG_NOTUSED(ctx); - memset(&p, 0, sizeof(p)); - - nvgTransformRotate(p.xform, angle); - p.xform[4] = cx; - p.xform[5] = cy; - - p.extent[0] = w; - p.extent[1] = h; - - p.image = image; - - p.innerColor = p.outerColor = nvgRGBAf(1,1,1,alpha); - - return p; -} - -// Scissoring -void nvgScissor(NVGcontext* ctx, float x, float y, float w, float h) -{ - NVGstate* state = nvg__getState(ctx); - - w = nvg__maxf(0.0f, w); - h = nvg__maxf(0.0f, h); - - nvgTransformIdentity(state->scissor.xform); - state->scissor.xform[4] = x+w*0.5f; - state->scissor.xform[5] = y+h*0.5f; - nvgTransformMultiply(state->scissor.xform, state->xform); - - state->scissor.extent[0] = w*0.5f; - state->scissor.extent[1] = h*0.5f; -} - -static void nvg__isectRects(float* dst, - float ax, float ay, float aw, float ah, - float bx, float by, float bw, float bh) -{ - float minx = nvg__maxf(ax, bx); - float miny = nvg__maxf(ay, by); - float maxx = nvg__minf(ax+aw, bx+bw); - float maxy = nvg__minf(ay+ah, by+bh); - dst[0] = minx; - dst[1] = miny; - dst[2] = nvg__maxf(0.0f, maxx - minx); - dst[3] = nvg__maxf(0.0f, maxy - miny); -} - -void nvgIntersectScissor(NVGcontext* ctx, float x, float y, float w, float h) -{ - NVGstate* state = nvg__getState(ctx); - float pxform[6], invxorm[6]; - float rect[4]; - float ex, ey, tex, tey; - - // If no previous scissor has been set, set the scissor as current scissor. - if (state->scissor.extent[0] < 0) { - nvgScissor(ctx, x, y, w, h); - return; - } - - // Transform the current scissor rect into current transform space. - // If there is difference in rotation, this will be approximation. - memcpy(pxform, state->scissor.xform, sizeof(float)*6); - ex = state->scissor.extent[0]; - ey = state->scissor.extent[1]; - nvgTransformInverse(invxorm, state->xform); - nvgTransformMultiply(pxform, invxorm); - tex = ex*nvg__absf(pxform[0]) + ey*nvg__absf(pxform[2]); - tey = ex*nvg__absf(pxform[1]) + ey*nvg__absf(pxform[3]); - - // Intersect rects. - nvg__isectRects(rect, pxform[4]-tex,pxform[5]-tey,tex*2,tey*2, x,y,w,h); - - nvgScissor(ctx, rect[0], rect[1], rect[2], rect[3]); -} - -void nvgResetScissor(NVGcontext* ctx) -{ - NVGstate* state = nvg__getState(ctx); - memset(state->scissor.xform, 0, sizeof(state->scissor.xform)); - state->scissor.extent[0] = -1.0f; - state->scissor.extent[1] = -1.0f; -} - -// Global composite operation. -void nvgGlobalCompositeOperation(NVGcontext* ctx, int op) -{ - NVGstate* state = nvg__getState(ctx); - state->compositeOperation = nvg__compositeOperationState(op); -} - -void nvgGlobalCompositeBlendFunc(NVGcontext* ctx, int sfactor, int dfactor) -{ - nvgGlobalCompositeBlendFuncSeparate(ctx, sfactor, dfactor, sfactor, dfactor); -} - -void nvgGlobalCompositeBlendFuncSeparate(NVGcontext* ctx, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) -{ - NVGcompositeOperationState op; - op.srcRGB = srcRGB; - op.dstRGB = dstRGB; - op.srcAlpha = srcAlpha; - op.dstAlpha = dstAlpha; - - NVGstate* state = nvg__getState(ctx); - state->compositeOperation = op; -} - -static int nvg__ptEquals(float x1, float y1, float x2, float y2, float tol) -{ - float dx = x2 - x1; - float dy = y2 - y1; - return dx*dx + dy*dy < tol*tol; -} - -static float nvg__distPtSeg(float x, float y, float px, float py, float qx, float qy) -{ - float pqx, pqy, dx, dy, d, t; - pqx = qx-px; - pqy = qy-py; - dx = x-px; - dy = y-py; - d = pqx*pqx + pqy*pqy; - t = pqx*dx + pqy*dy; - if (d > 0) t /= d; - if (t < 0) t = 0; - else if (t > 1) t = 1; - dx = px + t*pqx - x; - dy = py + t*pqy - y; - return dx*dx + dy*dy; -} - -static void nvg__appendCommands(NVGcontext* ctx, float* vals, int nvals) -{ - NVGstate* state = nvg__getState(ctx); - int i; - - if (ctx->ncommands+nvals > ctx->ccommands) { - float* commands; - int ccommands = ctx->ncommands+nvals + ctx->ccommands/2; - commands = (float*)NVG_REALLOC(ctx->commands, sizeof(float)*ccommands); - if (commands == NULL) return; - ctx->commands = commands; - ctx->ccommands = ccommands; - } - - if ((int)vals[0] != NVG_CLOSE && (int)vals[0] != NVG_WINDING) { - ctx->commandx = vals[nvals-2]; - ctx->commandy = vals[nvals-1]; - } - - // transform commands - i = 0; - while (i < nvals) { - int cmd = (int)vals[i]; - switch (cmd) { - case NVG_MOVETO: - nvgTransformPoint(&vals[i+1],&vals[i+2], state->xform, vals[i+1],vals[i+2]); - i += 3; - break; - case NVG_LINETO: - nvgTransformPoint(&vals[i+1],&vals[i+2], state->xform, vals[i+1],vals[i+2]); - i += 3; - break; - case NVG_BEZIERTO: - nvgTransformPoint(&vals[i+1],&vals[i+2], state->xform, vals[i+1],vals[i+2]); - nvgTransformPoint(&vals[i+3],&vals[i+4], state->xform, vals[i+3],vals[i+4]); - nvgTransformPoint(&vals[i+5],&vals[i+6], state->xform, vals[i+5],vals[i+6]); - i += 7; - break; - case NVG_CLOSE: - i++; - break; - case NVG_WINDING: - i += 2; - break; - default: - i++; - } - } - - memcpy(&ctx->commands[ctx->ncommands], vals, nvals*sizeof(float)); - - ctx->ncommands += nvals; -} - - -static void nvg__clearPathCache(NVGcontext* ctx) -{ - ctx->cache->npoints = 0; - ctx->cache->npaths = 0; -} - -static NVGpath* nvg__lastPath(NVGcontext* ctx) -{ - if (ctx->cache->npaths > 0) - return &ctx->cache->paths[ctx->cache->npaths-1]; - return NULL; -} - -static void nvg__addPath(NVGcontext* ctx) -{ - NVGpath* path; - if (ctx->cache->npaths+1 > ctx->cache->cpaths) { - NVGpath* paths; - int cpaths = ctx->cache->npaths+1 + ctx->cache->cpaths/2; - paths = (NVGpath*)NVG_REALLOC(ctx->cache->paths, sizeof(NVGpath)*cpaths); - if (paths == NULL) return; - ctx->cache->paths = paths; - ctx->cache->cpaths = cpaths; - } - path = &ctx->cache->paths[ctx->cache->npaths]; - memset(path, 0, sizeof(*path)); - path->first = ctx->cache->npoints; - path->winding = NVG_CCW; - - ctx->cache->npaths++; -} - -static NVGpoint* nvg__lastPoint(NVGcontext* ctx) -{ - if (ctx->cache->npoints > 0) - return &ctx->cache->points[ctx->cache->npoints-1]; - return NULL; -} - -static void nvg__addPoint(NVGcontext* ctx, float x, float y, int flags) -{ - NVGpath* path = nvg__lastPath(ctx); - NVGpoint* pt; - if (path == NULL) return; - - if (path->count > 0 && ctx->cache->npoints > 0) { - pt = nvg__lastPoint(ctx); - if (nvg__ptEquals(pt->x,pt->y, x,y, ctx->distTol)) { - pt->flags |= flags; - return; - } - } - - if (ctx->cache->npoints+1 > ctx->cache->cpoints) { - NVGpoint* points; - int cpoints = ctx->cache->npoints+1 + ctx->cache->cpoints/2; - points = (NVGpoint*)NVG_REALLOC(ctx->cache->points, sizeof(NVGpoint)*cpoints); - if (points == NULL) return; - ctx->cache->points = points; - ctx->cache->cpoints = cpoints; - } - - pt = &ctx->cache->points[ctx->cache->npoints]; - memset(pt, 0, sizeof(*pt)); - pt->x = x; - pt->y = y; - pt->flags = (unsigned char)flags; - - ctx->cache->npoints++; - path->count++; -} - -static void nvg__closePath(NVGcontext* ctx) -{ - NVGpath* path = nvg__lastPath(ctx); - if (path == NULL) return; - path->closed = 1; -} - -static void nvg__pathWinding(NVGcontext* ctx, int winding) -{ - NVGpath* path = nvg__lastPath(ctx); - if (path == NULL) return; - path->winding = winding; -} - -static float nvg__getAverageScale(float *t) -{ - float sx = sqrtf(t[0]*t[0] + t[2]*t[2]); - float sy = sqrtf(t[1]*t[1] + t[3]*t[3]); - return (sx + sy) * 0.5f; -} - -static NVGvertex* nvg__allocTempVerts(NVGcontext* ctx, int nverts) -{ - if (nverts > ctx->cache->cverts) { - NVGvertex* verts; - int cverts = (nverts + 0xff) & ~0xff; // Round up to prevent allocations when things change just slightly. - verts = (NVGvertex*)NVG_REALLOC(ctx->cache->verts, sizeof(NVGvertex)*cverts); - if (verts == NULL) return NULL; - ctx->cache->verts = verts; - ctx->cache->cverts = cverts; - } - - return ctx->cache->verts; -} - -static float nvg__triarea2(float ax, float ay, float bx, float by, float cx, float cy) -{ - float abx = bx - ax; - float aby = by - ay; - float acx = cx - ax; - float acy = cy - ay; - return acx*aby - abx*acy; -} - -static float nvg__polyArea(NVGpoint* pts, int npts) -{ - int i; - float area = 0; - for (i = 2; i < npts; i++) { - NVGpoint* a = &pts[0]; - NVGpoint* b = &pts[i-1]; - NVGpoint* c = &pts[i]; - area += nvg__triarea2(a->x,a->y, b->x,b->y, c->x,c->y); - } - return area * 0.5f; -} - -static void nvg__polyReverse(NVGpoint* pts, int npts) -{ - NVGpoint tmp; - int i = 0, j = npts-1; - while (i < j) { - tmp = pts[i]; - pts[i] = pts[j]; - pts[j] = tmp; - i++; - j--; - } -} - - -static void nvg__vset(NVGvertex* vtx, float x, float y, float u, float v) -{ - vtx->x = x; - vtx->y = y; - vtx->u = u; - vtx->v = v; -} - -static void nvg__tesselateBezier(NVGcontext* ctx, - float x1, float y1, float x2, float y2, - float x3, float y3, float x4, float y4, - int level, int type) -{ - float x12,y12,x23,y23,x34,y34,x123,y123,x234,y234,x1234,y1234; - float dx,dy,d2,d3; - - if (level > 10) return; - - x12 = (x1+x2)*0.5f; - y12 = (y1+y2)*0.5f; - x23 = (x2+x3)*0.5f; - y23 = (y2+y3)*0.5f; - x34 = (x3+x4)*0.5f; - y34 = (y3+y4)*0.5f; - x123 = (x12+x23)*0.5f; - y123 = (y12+y23)*0.5f; - - dx = x4 - x1; - dy = y4 - y1; - d2 = nvg__absf(((x2 - x4) * dy - (y2 - y4) * dx)); - d3 = nvg__absf(((x3 - x4) * dy - (y3 - y4) * dx)); - - if ((d2 + d3)*(d2 + d3) < ctx->tessTol * (dx*dx + dy*dy)) { - nvg__addPoint(ctx, x4, y4, type); - return; - } - -/* if (nvg__absf(x1+x3-x2-x2) + nvg__absf(y1+y3-y2-y2) + nvg__absf(x2+x4-x3-x3) + nvg__absf(y2+y4-y3-y3) < ctx->tessTol) { - nvg__addPoint(ctx, x4, y4, type); - return; - }*/ - - x234 = (x23+x34)*0.5f; - y234 = (y23+y34)*0.5f; - x1234 = (x123+x234)*0.5f; - y1234 = (y123+y234)*0.5f; - - nvg__tesselateBezier(ctx, x1,y1, x12,y12, x123,y123, x1234,y1234, level+1, 0); - nvg__tesselateBezier(ctx, x1234,y1234, x234,y234, x34,y34, x4,y4, level+1, type); -} - -static void nvg__flattenPaths(NVGcontext* ctx) -{ - NVGpathCache* cache = ctx->cache; -// NVGstate* state = nvg__getState(ctx); - NVGpoint* last; - NVGpoint* p0; - NVGpoint* p1; - NVGpoint* pts; - NVGpath* path; - int i, j; - float* cp1; - float* cp2; - float* p; - float area; - - if (cache->npaths > 0) - return; - - // Flatten - i = 0; - while (i < ctx->ncommands) { - int cmd = (int)ctx->commands[i]; - switch (cmd) { - case NVG_MOVETO: - nvg__addPath(ctx); - p = &ctx->commands[i+1]; - nvg__addPoint(ctx, p[0], p[1], NVG_PT_CORNER); - i += 3; - break; - case NVG_LINETO: - p = &ctx->commands[i+1]; - nvg__addPoint(ctx, p[0], p[1], NVG_PT_CORNER); - i += 3; - break; - case NVG_BEZIERTO: - last = nvg__lastPoint(ctx); - if (last != NULL) { - cp1 = &ctx->commands[i+1]; - cp2 = &ctx->commands[i+3]; - p = &ctx->commands[i+5]; - nvg__tesselateBezier(ctx, last->x,last->y, cp1[0],cp1[1], cp2[0],cp2[1], p[0],p[1], 0, NVG_PT_CORNER); - } - i += 7; - break; - case NVG_CLOSE: - nvg__closePath(ctx); - i++; - break; - case NVG_WINDING: - nvg__pathWinding(ctx, (int)ctx->commands[i+1]); - i += 2; - break; - default: - i++; - } - } - - cache->bounds[0] = cache->bounds[1] = 1e6f; - cache->bounds[2] = cache->bounds[3] = -1e6f; - - // Calculate the direction and length of line segments. - for (j = 0; j < cache->npaths; j++) { - path = &cache->paths[j]; - pts = &cache->points[path->first]; - - // If the first and last points are the same, remove the last, mark as closed path. - p0 = &pts[path->count-1]; - p1 = &pts[0]; - if (nvg__ptEquals(p0->x,p0->y, p1->x,p1->y, ctx->distTol)) { - path->count--; - p0 = &pts[path->count-1]; - path->closed = 1; - } - - // Enforce winding. - if (path->count > 2) { - area = nvg__polyArea(pts, path->count); - if (path->winding == NVG_CCW && area < 0.0f) - nvg__polyReverse(pts, path->count); - if (path->winding == NVG_CW && area > 0.0f) - nvg__polyReverse(pts, path->count); - } - - for(i = 0; i < path->count; i++) { - // Calculate segment direction and length - p0->dx = p1->x - p0->x; - p0->dy = p1->y - p0->y; - p0->len = nvg__normalize(&p0->dx, &p0->dy); - // Update bounds - cache->bounds[0] = nvg__minf(cache->bounds[0], p0->x); - cache->bounds[1] = nvg__minf(cache->bounds[1], p0->y); - cache->bounds[2] = nvg__maxf(cache->bounds[2], p0->x); - cache->bounds[3] = nvg__maxf(cache->bounds[3], p0->y); - // Advance - p0 = p1++; - } - } -} - -static int nvg__curveDivs(float r, float arc, float tol) -{ - float da = acosf(r / (r + tol)) * 2.0f; - return nvg__maxi(2, (int)ceilf(arc / da)); -} - -static void nvg__chooseBevel(int bevel, NVGpoint* p0, NVGpoint* p1, float w, - float* x0, float* y0, float* x1, float* y1) -{ - if (bevel) { - *x0 = p1->x + p0->dy * w; - *y0 = p1->y - p0->dx * w; - *x1 = p1->x + p1->dy * w; - *y1 = p1->y - p1->dx * w; - } else { - *x0 = p1->x + p1->dmx * w; - *y0 = p1->y + p1->dmy * w; - *x1 = p1->x + p1->dmx * w; - *y1 = p1->y + p1->dmy * w; - } -} - -static NVGvertex* nvg__roundJoin(NVGvertex* dst, NVGpoint* p0, NVGpoint* p1, - float lw, float rw, float lu, float ru, int ncap, - float fringe) -{ - int i, n; - float dlx0 = p0->dy; - float dly0 = -p0->dx; - float dlx1 = p1->dy; - float dly1 = -p1->dx; - NVG_NOTUSED(fringe); - - if (p1->flags & NVG_PT_LEFT) { - float lx0,ly0,lx1,ly1,a0,a1; - nvg__chooseBevel(p1->flags & NVG_PR_INNERBEVEL, p0, p1, lw, &lx0,&ly0, &lx1,&ly1); - a0 = atan2f(-dly0, -dlx0); - a1 = atan2f(-dly1, -dlx1); - if (a1 > a0) a1 -= NVG_PI*2; - - nvg__vset(dst, lx0, ly0, lu,1); dst++; - nvg__vset(dst, p1->x - dlx0*rw, p1->y - dly0*rw, ru,1); dst++; - - n = nvg__clampi((int)ceilf(((a0 - a1) / NVG_PI) * ncap), 2, ncap); - for (i = 0; i < n; i++) { - float u = i/(float)(n-1); - float a = a0 + u*(a1-a0); - float rx = p1->x + cosf(a) * rw; - float ry = p1->y + sinf(a) * rw; - nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; - nvg__vset(dst, rx, ry, ru,1); dst++; - } - - nvg__vset(dst, lx1, ly1, lu,1); dst++; - nvg__vset(dst, p1->x - dlx1*rw, p1->y - dly1*rw, ru,1); dst++; - - } else { - float rx0,ry0,rx1,ry1,a0,a1; - nvg__chooseBevel(p1->flags & NVG_PR_INNERBEVEL, p0, p1, -rw, &rx0,&ry0, &rx1,&ry1); - a0 = atan2f(dly0, dlx0); - a1 = atan2f(dly1, dlx1); - if (a1 < a0) a1 += NVG_PI*2; - - nvg__vset(dst, p1->x + dlx0*rw, p1->y + dly0*rw, lu,1); dst++; - nvg__vset(dst, rx0, ry0, ru,1); dst++; - - n = nvg__clampi((int)ceilf(((a1 - a0) / NVG_PI) * ncap), 2, ncap); - for (i = 0; i < n; i++) { - float u = i/(float)(n-1); - float a = a0 + u*(a1-a0); - float lx = p1->x + cosf(a) * lw; - float ly = p1->y + sinf(a) * lw; - nvg__vset(dst, lx, ly, lu,1); dst++; - nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; - } - - nvg__vset(dst, p1->x + dlx1*rw, p1->y + dly1*rw, lu,1); dst++; - nvg__vset(dst, rx1, ry1, ru,1); dst++; - - } - return dst; -} - -static NVGvertex* nvg__bevelJoin(NVGvertex* dst, NVGpoint* p0, NVGpoint* p1, - float lw, float rw, float lu, float ru, float fringe) -{ - float rx0,ry0,rx1,ry1; - float lx0,ly0,lx1,ly1; - float dlx0 = p0->dy; - float dly0 = -p0->dx; - float dlx1 = p1->dy; - float dly1 = -p1->dx; - NVG_NOTUSED(fringe); - - if (p1->flags & NVG_PT_LEFT) { - nvg__chooseBevel(p1->flags & NVG_PR_INNERBEVEL, p0, p1, lw, &lx0,&ly0, &lx1,&ly1); - - nvg__vset(dst, lx0, ly0, lu,1); dst++; - nvg__vset(dst, p1->x - dlx0*rw, p1->y - dly0*rw, ru,1); dst++; - - if (p1->flags & NVG_PT_BEVEL) { - nvg__vset(dst, lx0, ly0, lu,1); dst++; - nvg__vset(dst, p1->x - dlx0*rw, p1->y - dly0*rw, ru,1); dst++; - - nvg__vset(dst, lx1, ly1, lu,1); dst++; - nvg__vset(dst, p1->x - dlx1*rw, p1->y - dly1*rw, ru,1); dst++; - } else { - rx0 = p1->x - p1->dmx * rw; - ry0 = p1->y - p1->dmy * rw; - - nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; - nvg__vset(dst, p1->x - dlx0*rw, p1->y - dly0*rw, ru,1); dst++; - - nvg__vset(dst, rx0, ry0, ru,1); dst++; - nvg__vset(dst, rx0, ry0, ru,1); dst++; - - nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; - nvg__vset(dst, p1->x - dlx1*rw, p1->y - dly1*rw, ru,1); dst++; - } - - nvg__vset(dst, lx1, ly1, lu,1); dst++; - nvg__vset(dst, p1->x - dlx1*rw, p1->y - dly1*rw, ru,1); dst++; - - } else { - nvg__chooseBevel(p1->flags & NVG_PR_INNERBEVEL, p0, p1, -rw, &rx0,&ry0, &rx1,&ry1); - - nvg__vset(dst, p1->x + dlx0*lw, p1->y + dly0*lw, lu,1); dst++; - nvg__vset(dst, rx0, ry0, ru,1); dst++; - - if (p1->flags & NVG_PT_BEVEL) { - nvg__vset(dst, p1->x + dlx0*lw, p1->y + dly0*lw, lu,1); dst++; - nvg__vset(dst, rx0, ry0, ru,1); dst++; - - nvg__vset(dst, p1->x + dlx1*lw, p1->y + dly1*lw, lu,1); dst++; - nvg__vset(dst, rx1, ry1, ru,1); dst++; - } else { - lx0 = p1->x + p1->dmx * lw; - ly0 = p1->y + p1->dmy * lw; - - nvg__vset(dst, p1->x + dlx0*lw, p1->y + dly0*lw, lu,1); dst++; - nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; - - nvg__vset(dst, lx0, ly0, lu,1); dst++; - nvg__vset(dst, lx0, ly0, lu,1); dst++; - - nvg__vset(dst, p1->x + dlx1*lw, p1->y + dly1*lw, lu,1); dst++; - nvg__vset(dst, p1->x, p1->y, 0.5f,1); dst++; - } - - nvg__vset(dst, p1->x + dlx1*lw, p1->y + dly1*lw, lu,1); dst++; - nvg__vset(dst, rx1, ry1, ru,1); dst++; - } - - return dst; -} - -static NVGvertex* nvg__buttCapStart(NVGvertex* dst, NVGpoint* p, - float dx, float dy, float w, float d, - float aa, float u0, float u1) -{ - float px = p->x - dx*d; - float py = p->y - dy*d; - float dlx = dy; - float dly = -dx; - nvg__vset(dst, px + dlx*w - dx*aa, py + dly*w - dy*aa, u0,0); dst++; - nvg__vset(dst, px - dlx*w - dx*aa, py - dly*w - dy*aa, u1,0); dst++; - nvg__vset(dst, px + dlx*w, py + dly*w, u0,1); dst++; - nvg__vset(dst, px - dlx*w, py - dly*w, u1,1); dst++; - return dst; -} - -static NVGvertex* nvg__buttCapEnd(NVGvertex* dst, NVGpoint* p, - float dx, float dy, float w, float d, - float aa, float u0, float u1) -{ - float px = p->x + dx*d; - float py = p->y + dy*d; - float dlx = dy; - float dly = -dx; - nvg__vset(dst, px + dlx*w, py + dly*w, u0,1); dst++; - nvg__vset(dst, px - dlx*w, py - dly*w, u1,1); dst++; - nvg__vset(dst, px + dlx*w + dx*aa, py + dly*w + dy*aa, u0,0); dst++; - nvg__vset(dst, px - dlx*w + dx*aa, py - dly*w + dy*aa, u1,0); dst++; - return dst; -} - - -static NVGvertex* nvg__roundCapStart(NVGvertex* dst, NVGpoint* p, - float dx, float dy, float w, int ncap, - float aa, float u0, float u1) -{ - int i; - float px = p->x; - float py = p->y; - float dlx = dy; - float dly = -dx; - NVG_NOTUSED(aa); - for (i = 0; i < ncap; i++) { - float a = i/(float)(ncap-1)*NVG_PI; - float ax = cosf(a) * w, ay = sinf(a) * w; - nvg__vset(dst, px - dlx*ax - dx*ay, py - dly*ax - dy*ay, u0,1); dst++; - nvg__vset(dst, px, py, 0.5f,1); dst++; - } - nvg__vset(dst, px + dlx*w, py + dly*w, u0,1); dst++; - nvg__vset(dst, px - dlx*w, py - dly*w, u1,1); dst++; - return dst; -} - -static NVGvertex* nvg__roundCapEnd(NVGvertex* dst, NVGpoint* p, - float dx, float dy, float w, int ncap, - float aa, float u0, float u1) -{ - int i; - float px = p->x; - float py = p->y; - float dlx = dy; - float dly = -dx; - NVG_NOTUSED(aa); - nvg__vset(dst, px + dlx*w, py + dly*w, u0,1); dst++; - nvg__vset(dst, px - dlx*w, py - dly*w, u1,1); dst++; - for (i = 0; i < ncap; i++) { - float a = i/(float)(ncap-1)*NVG_PI; - float ax = cosf(a) * w, ay = sinf(a) * w; - nvg__vset(dst, px, py, 0.5f,1); dst++; - nvg__vset(dst, px - dlx*ax + dx*ay, py - dly*ax + dy*ay, u0,1); dst++; - } - return dst; -} - - -static void nvg__calculateJoins(NVGcontext* ctx, float w, int lineJoin, float miterLimit) -{ - NVGpathCache* cache = ctx->cache; - int i, j; - float iw = 0.0f; - - if (w > 0.0f) iw = 1.0f / w; - - // Calculate which joins needs extra vertices to append, and gather vertex count. - for (i = 0; i < cache->npaths; i++) { - NVGpath* path = &cache->paths[i]; - NVGpoint* pts = &cache->points[path->first]; - NVGpoint* p0 = &pts[path->count-1]; - NVGpoint* p1 = &pts[0]; - int nleft = 0; - - path->nbevel = 0; - - for (j = 0; j < path->count; j++) { - float dlx0, dly0, dlx1, dly1, dmr2, cross, limit; - dlx0 = p0->dy; - dly0 = -p0->dx; - dlx1 = p1->dy; - dly1 = -p1->dx; - // Calculate extrusions - p1->dmx = (dlx0 + dlx1) * 0.5f; - p1->dmy = (dly0 + dly1) * 0.5f; - dmr2 = p1->dmx*p1->dmx + p1->dmy*p1->dmy; - if (dmr2 > 0.000001f) { - float scale = 1.0f / dmr2; - if (scale > 600.0f) { - scale = 600.0f; - } - p1->dmx *= scale; - p1->dmy *= scale; - } - - // Clear flags, but keep the corner. - p1->flags = (p1->flags & NVG_PT_CORNER) ? NVG_PT_CORNER : 0; - - // Keep track of left turns. - cross = p1->dx * p0->dy - p0->dx * p1->dy; - if (cross > 0.0f) { - nleft++; - p1->flags |= NVG_PT_LEFT; - } - - // Calculate if we should use bevel or miter for inner join. - limit = nvg__maxf(1.01f, nvg__minf(p0->len, p1->len) * iw); - if ((dmr2 * limit*limit) < 1.0f) - p1->flags |= NVG_PR_INNERBEVEL; - - // Check to see if the corner needs to be beveled. - if (p1->flags & NVG_PT_CORNER) { - if ((dmr2 * miterLimit*miterLimit) < 1.0f || lineJoin == NVG_BEVEL || lineJoin == NVG_ROUND) { - p1->flags |= NVG_PT_BEVEL; - } - } - - if ((p1->flags & (NVG_PT_BEVEL | NVG_PR_INNERBEVEL)) != 0) - path->nbevel++; - - p0 = p1++; - } - - path->convex = (nleft == path->count) ? 1 : 0; - } -} - - -static int nvg__expandStroke(NVGcontext* ctx, float w, float fringe, int lineCap, int lineJoin, float miterLimit) -{ - NVGpathCache* cache = ctx->cache; - NVGvertex* verts; - NVGvertex* dst; - int cverts, i, j; - float aa = fringe;//ctx->fringeWidth; - float u0 = 0.0f, u1 = 1.0f; - int ncap = nvg__curveDivs(w, NVG_PI, ctx->tessTol); // Calculate divisions per half circle. - - w += aa * 0.5f; - - // Disable the gradient used for antialiasing when antialiasing is not used. - if (aa == 0.0f) { - u0 = 0.5f; - u1 = 0.5f; - } - - nvg__calculateJoins(ctx, w, lineJoin, miterLimit); - - // Calculate max vertex usage. - cverts = 0; - for (i = 0; i < cache->npaths; i++) { - NVGpath* path = &cache->paths[i]; - int loop = (path->closed == 0) ? 0 : 1; - if (lineJoin == NVG_ROUND) - cverts += (path->count + path->nbevel*(ncap+2) + 1) * 2; // plus one for loop - else - cverts += (path->count + path->nbevel*5 + 1) * 2; // plus one for loop - if (loop == 0) { - // space for caps - if (lineCap == NVG_ROUND) { - cverts += (ncap*2 + 2)*2; - } else { - cverts += (3+3)*2; - } - } - } - - verts = nvg__allocTempVerts(ctx, cverts); - if (verts == NULL) return 0; - - for (i = 0; i < cache->npaths; i++) { - NVGpath* path = &cache->paths[i]; - NVGpoint* pts = &cache->points[path->first]; - NVGpoint* p0; - NVGpoint* p1; - int s, e, loop; - float dx, dy; - - path->fill = 0; - path->nfill = 0; - - // Calculate fringe or stroke - loop = (path->closed == 0) ? 0 : 1; - dst = verts; - path->stroke = dst; - - if (loop) { - // Looping - p0 = &pts[path->count-1]; - p1 = &pts[0]; - s = 0; - e = path->count; - } else { - // Add cap - p0 = &pts[0]; - p1 = &pts[1]; - s = 1; - e = path->count-1; - } - - if (loop == 0) { - // Add cap - dx = p1->x - p0->x; - dy = p1->y - p0->y; - nvg__normalize(&dx, &dy); - if (lineCap == NVG_BUTT) - dst = nvg__buttCapStart(dst, p0, dx, dy, w, -aa*0.5f, aa, u0, u1); - else if (lineCap == NVG_BUTT || lineCap == NVG_SQUARE) - dst = nvg__buttCapStart(dst, p0, dx, dy, w, w-aa, aa, u0, u1); - else if (lineCap == NVG_ROUND) - dst = nvg__roundCapStart(dst, p0, dx, dy, w, ncap, aa, u0, u1); - } - - for (j = s; j < e; ++j) { - if ((p1->flags & (NVG_PT_BEVEL | NVG_PR_INNERBEVEL)) != 0) { - if (lineJoin == NVG_ROUND) { - dst = nvg__roundJoin(dst, p0, p1, w, w, u0, u1, ncap, aa); - } else { - dst = nvg__bevelJoin(dst, p0, p1, w, w, u0, u1, aa); - } - } else { - nvg__vset(dst, p1->x + (p1->dmx * w), p1->y + (p1->dmy * w), u0,1); dst++; - nvg__vset(dst, p1->x - (p1->dmx * w), p1->y - (p1->dmy * w), u1,1); dst++; - } - p0 = p1++; - } - - if (loop) { - // Loop it - nvg__vset(dst, verts[0].x, verts[0].y, u0,1); dst++; - nvg__vset(dst, verts[1].x, verts[1].y, u1,1); dst++; - } else { - // Add cap - dx = p1->x - p0->x; - dy = p1->y - p0->y; - nvg__normalize(&dx, &dy); - if (lineCap == NVG_BUTT) - dst = nvg__buttCapEnd(dst, p1, dx, dy, w, -aa*0.5f, aa, u0, u1); - else if (lineCap == NVG_BUTT || lineCap == NVG_SQUARE) - dst = nvg__buttCapEnd(dst, p1, dx, dy, w, w-aa, aa, u0, u1); - else if (lineCap == NVG_ROUND) - dst = nvg__roundCapEnd(dst, p1, dx, dy, w, ncap, aa, u0, u1); - } - - path->nstroke = (int)(dst - verts); - - verts = dst; - } - - return 1; -} - -static int nvg__expandFill(NVGcontext* ctx, float w, int lineJoin, float miterLimit) -{ - NVGpathCache* cache = ctx->cache; - NVGvertex* verts; - NVGvertex* dst; - int cverts, convex, i, j; - float aa = ctx->fringeWidth; - int fringe = w > 0.0f; - - nvg__calculateJoins(ctx, w, lineJoin, miterLimit); - - // Calculate max vertex usage. - cverts = 0; - for (i = 0; i < cache->npaths; i++) { - NVGpath* path = &cache->paths[i]; - cverts += path->count + path->nbevel + 1; - if (fringe) - cverts += (path->count + path->nbevel*5 + 1) * 2; // plus one for loop - } - - verts = nvg__allocTempVerts(ctx, cverts); - if (verts == NULL) return 0; - - convex = cache->npaths == 1 && cache->paths[0].convex; - - for (i = 0; i < cache->npaths; i++) { - NVGpath* path = &cache->paths[i]; - NVGpoint* pts = &cache->points[path->first]; - NVGpoint* p0; - NVGpoint* p1; - float rw, lw, woff; - float ru, lu; - - // Calculate shape vertices. - woff = 0.5f*aa; - dst = verts; - path->fill = dst; - - if (fringe) { - // Looping - p0 = &pts[path->count-1]; - p1 = &pts[0]; - for (j = 0; j < path->count; ++j) { - if (p1->flags & NVG_PT_BEVEL) { - float dlx0 = p0->dy; - float dly0 = -p0->dx; - float dlx1 = p1->dy; - float dly1 = -p1->dx; - if (p1->flags & NVG_PT_LEFT) { - float lx = p1->x + p1->dmx * woff; - float ly = p1->y + p1->dmy * woff; - nvg__vset(dst, lx, ly, 0.5f,1); dst++; - } else { - float lx0 = p1->x + dlx0 * woff; - float ly0 = p1->y + dly0 * woff; - float lx1 = p1->x + dlx1 * woff; - float ly1 = p1->y + dly1 * woff; - nvg__vset(dst, lx0, ly0, 0.5f,1); dst++; - nvg__vset(dst, lx1, ly1, 0.5f,1); dst++; - } - } else { - nvg__vset(dst, p1->x + (p1->dmx * woff), p1->y + (p1->dmy * woff), 0.5f,1); dst++; - } - p0 = p1++; - } - } else { - for (j = 0; j < path->count; ++j) { - nvg__vset(dst, pts[j].x, pts[j].y, 0.5f,1); - dst++; - } - } - - path->nfill = (int)(dst - verts); - verts = dst; - - // Calculate fringe - if (fringe) { - lw = w + woff; - rw = w - woff; - lu = 0; - ru = 1; - dst = verts; - path->stroke = dst; - - // Create only half a fringe for convex shapes so that - // the shape can be rendered without stenciling. - if (convex) { - lw = woff; // This should generate the same vertex as fill inset above. - lu = 0.5f; // Set outline fade at middle. - } - - // Looping - p0 = &pts[path->count-1]; - p1 = &pts[0]; - - for (j = 0; j < path->count; ++j) { - if ((p1->flags & (NVG_PT_BEVEL | NVG_PR_INNERBEVEL)) != 0) { - dst = nvg__bevelJoin(dst, p0, p1, lw, rw, lu, ru, ctx->fringeWidth); - } else { - nvg__vset(dst, p1->x + (p1->dmx * lw), p1->y + (p1->dmy * lw), lu,1); dst++; - nvg__vset(dst, p1->x - (p1->dmx * rw), p1->y - (p1->dmy * rw), ru,1); dst++; - } - p0 = p1++; - } - - // Loop it - nvg__vset(dst, verts[0].x, verts[0].y, lu,1); dst++; - nvg__vset(dst, verts[1].x, verts[1].y, ru,1); dst++; - - path->nstroke = (int)(dst - verts); - verts = dst; - } else { - path->stroke = NULL; - path->nstroke = 0; - } - } - - return 1; -} - - -// Draw -void nvgBeginPath(NVGcontext* ctx) -{ - ctx->ncommands = 0; - nvg__clearPathCache(ctx); -} - -void nvgMoveTo(NVGcontext* ctx, float x, float y) -{ - float vals[] = { NVG_MOVETO, x, y }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); -} - -void nvgLineTo(NVGcontext* ctx, float x, float y) -{ - float vals[] = { NVG_LINETO, x, y }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); -} - -void nvgBezierTo(NVGcontext* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y) -{ - float vals[] = { NVG_BEZIERTO, c1x, c1y, c2x, c2y, x, y }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); -} - -void nvgQuadTo(NVGcontext* ctx, float cx, float cy, float x, float y) -{ - float x0 = ctx->commandx; - float y0 = ctx->commandy; - float vals[] = { NVG_BEZIERTO, - x0 + 2.0f/3.0f*(cx - x0), y0 + 2.0f/3.0f*(cy - y0), - x + 2.0f/3.0f*(cx - x), y + 2.0f/3.0f*(cy - y), - x, y }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); -} - -void nvgArcTo(NVGcontext* ctx, float x1, float y1, float x2, float y2, float radius) -{ - float x0 = ctx->commandx; - float y0 = ctx->commandy; - float dx0,dy0, dx1,dy1, a, d, cx,cy, a0,a1; - int dir; - - if (ctx->ncommands == 0) { - return; - } - - // Handle degenerate cases. - if (nvg__ptEquals(x0,y0, x1,y1, ctx->distTol) || - nvg__ptEquals(x1,y1, x2,y2, ctx->distTol) || - nvg__distPtSeg(x1,y1, x0,y0, x2,y2) < ctx->distTol*ctx->distTol || - radius < ctx->distTol) { - nvgLineTo(ctx, x1,y1); - return; - } - - // Calculate tangential circle to lines (x0,y0)-(x1,y1) and (x1,y1)-(x2,y2). - dx0 = x0-x1; - dy0 = y0-y1; - dx1 = x2-x1; - dy1 = y2-y1; - nvg__normalize(&dx0,&dy0); - nvg__normalize(&dx1,&dy1); - a = nvg__acosf(dx0*dx1 + dy0*dy1); - d = radius / nvg__tanf(a/2.0f); - -// printf("a=%f° d=%f\n", a/NVG_PI*180.0f, d); - - if (d > 10000.0f) { - nvgLineTo(ctx, x1,y1); - return; - } - - if (nvg__cross(dx0,dy0, dx1,dy1) > 0.0f) { - cx = x1 + dx0*d + dy0*radius; - cy = y1 + dy0*d + -dx0*radius; - a0 = nvg__atan2f(dx0, -dy0); - a1 = nvg__atan2f(-dx1, dy1); - dir = NVG_CW; -// printf("CW c=(%f, %f) a0=%f° a1=%f°\n", cx, cy, a0/NVG_PI*180.0f, a1/NVG_PI*180.0f); - } else { - cx = x1 + dx0*d + -dy0*radius; - cy = y1 + dy0*d + dx0*radius; - a0 = nvg__atan2f(-dx0, dy0); - a1 = nvg__atan2f(dx1, -dy1); - dir = NVG_CCW; -// printf("CCW c=(%f, %f) a0=%f° a1=%f°\n", cx, cy, a0/NVG_PI*180.0f, a1/NVG_PI*180.0f); - } - - nvgArc(ctx, cx, cy, radius, a0, a1, dir); -} - -void nvgClosePath(NVGcontext* ctx) -{ - float vals[] = { NVG_CLOSE }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); -} - -void nvgPathWinding(NVGcontext* ctx, int dir) -{ - float vals[] = { NVG_WINDING, (float)dir }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); -} - -void nvgArc(NVGcontext* ctx, float cx, float cy, float r, float a0, float a1, int dir) -{ - float a = 0, da = 0, hda = 0, kappa = 0; - float dx = 0, dy = 0, x = 0, y = 0, tanx = 0, tany = 0; - float px = 0, py = 0, ptanx = 0, ptany = 0; - float vals[3 + 5*7 + 100]; - int i, ndivs, nvals; - int move = ctx->ncommands > 0 ? NVG_LINETO : NVG_MOVETO; - - // Clamp angles - da = a1 - a0; - if (dir == NVG_CW) { - if (nvg__absf(da) >= NVG_PI*2) { - da = NVG_PI*2; - } else { - while (da < 0.0f) da += NVG_PI*2; - } - } else { - if (nvg__absf(da) >= NVG_PI*2) { - da = -NVG_PI*2; - } else { - while (da > 0.0f) da -= NVG_PI*2; - } - } - - // Split arc into max 90 degree segments. - ndivs = nvg__maxi(1, nvg__mini((int)(nvg__absf(da) / (NVG_PI*0.5f) + 0.5f), 5)); - hda = (da / (float)ndivs) / 2.0f; - kappa = nvg__absf(4.0f / 3.0f * (1.0f - nvg__cosf(hda)) / nvg__sinf(hda)); - - if (dir == NVG_CCW) - kappa = -kappa; - - nvals = 0; - for (i = 0; i <= ndivs; i++) { - a = a0 + da * (i/(float)ndivs); - dx = nvg__cosf(a); - dy = nvg__sinf(a); - x = cx + dx*r; - y = cy + dy*r; - tanx = -dy*r*kappa; - tany = dx*r*kappa; - - if (i == 0) { - vals[nvals++] = (float)move; - vals[nvals++] = x; - vals[nvals++] = y; - } else { - vals[nvals++] = NVG_BEZIERTO; - vals[nvals++] = px+ptanx; - vals[nvals++] = py+ptany; - vals[nvals++] = x-tanx; - vals[nvals++] = y-tany; - vals[nvals++] = x; - vals[nvals++] = y; - } - px = x; - py = y; - ptanx = tanx; - ptany = tany; - } - - nvg__appendCommands(ctx, vals, nvals); -} - -void nvgRect(NVGcontext* ctx, float x, float y, float w, float h) -{ - float vals[] = { - NVG_MOVETO, x,y, - NVG_LINETO, x,y+h, - NVG_LINETO, x+w,y+h, - NVG_LINETO, x+w,y, - NVG_CLOSE - }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); -} - -void nvgRoundedRect(NVGcontext* ctx, float x, float y, float w, float h, float r) -{ - nvgRoundedRectVarying(ctx, x, y, w, h, r, r, r, r); -} - -void nvgRoundedRectVarying(NVGcontext* ctx, float x, float y, float w, float h, float radTopLeft, float radTopRight, float radBottomRight, float radBottomLeft) -{ - if(radTopLeft < 0.1f && radTopRight < 0.1f && radBottomRight < 0.1f && radBottomLeft < 0.1f) { - nvgRect(ctx, x, y, w, h); - return; - } else { - float halfw = nvg__absf(w)*0.5f; - float halfh = nvg__absf(h)*0.5f; - float rxBL = nvg__minf(radBottomLeft, halfw) * nvg__signf(w), ryBL = nvg__minf(radBottomLeft, halfh) * nvg__signf(h); - float rxBR = nvg__minf(radBottomRight, halfw) * nvg__signf(w), ryBR = nvg__minf(radBottomRight, halfh) * nvg__signf(h); - float rxTR = nvg__minf(radTopRight, halfw) * nvg__signf(w), ryTR = nvg__minf(radTopRight, halfh) * nvg__signf(h); - float rxTL = nvg__minf(radTopLeft, halfw) * nvg__signf(w), ryTL = nvg__minf(radTopLeft, halfh) * nvg__signf(h); - float vals[] = { - NVG_MOVETO, x, y + ryTL, - NVG_LINETO, x, y + h - ryBL, - NVG_BEZIERTO, x, y + h - ryBL*(1 - NVG_KAPPA90), x + rxBL*(1 - NVG_KAPPA90), y + h, x + rxBL, y + h, - NVG_LINETO, x + w - rxBR, y + h, - NVG_BEZIERTO, x + w - rxBR*(1 - NVG_KAPPA90), y + h, x + w, y + h - ryBR*(1 - NVG_KAPPA90), x + w, y + h - ryBR, - NVG_LINETO, x + w, y + ryTR, - NVG_BEZIERTO, x + w, y + ryTR*(1 - NVG_KAPPA90), x + w - rxTR*(1 - NVG_KAPPA90), y, x + w - rxTR, y, - NVG_LINETO, x + rxTL, y, - NVG_BEZIERTO, x + rxTL*(1 - NVG_KAPPA90), y, x, y + ryTL*(1 - NVG_KAPPA90), x, y + ryTL, - NVG_CLOSE - }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); - } -} - -void nvgEllipse(NVGcontext* ctx, float cx, float cy, float rx, float ry) -{ - float vals[] = { - NVG_MOVETO, cx-rx, cy, - NVG_BEZIERTO, cx-rx, cy+ry*NVG_KAPPA90, cx-rx*NVG_KAPPA90, cy+ry, cx, cy+ry, - NVG_BEZIERTO, cx+rx*NVG_KAPPA90, cy+ry, cx+rx, cy+ry*NVG_KAPPA90, cx+rx, cy, - NVG_BEZIERTO, cx+rx, cy-ry*NVG_KAPPA90, cx+rx*NVG_KAPPA90, cy-ry, cx, cy-ry, - NVG_BEZIERTO, cx-rx*NVG_KAPPA90, cy-ry, cx-rx, cy-ry*NVG_KAPPA90, cx-rx, cy, - NVG_CLOSE - }; - nvg__appendCommands(ctx, vals, NVG_COUNTOF(vals)); -} - -void nvgCircle(NVGcontext* ctx, float cx, float cy, float r) -{ - nvgEllipse(ctx, cx,cy, r,r); -} - -void nvgDebugDumpPathCache(NVGcontext* ctx) -{ - const NVGpath* path; - int i, j; - - printf("Dumping %d cached paths\n", ctx->cache->npaths); - for (i = 0; i < ctx->cache->npaths; i++) { - path = &ctx->cache->paths[i]; - printf(" - Path %d\n", i); - if (path->nfill) { - printf(" - fill: %d\n", path->nfill); - for (j = 0; j < path->nfill; j++) - printf("%f\t%f\n", path->fill[j].x, path->fill[j].y); - } - if (path->nstroke) { - printf(" - stroke: %d\n", path->nstroke); - for (j = 0; j < path->nstroke; j++) - printf("%f\t%f\n", path->stroke[j].x, path->stroke[j].y); - } - } -} - -void nvgFill(NVGcontext* ctx) -{ - NVGstate* state = nvg__getState(ctx); - const NVGpath* path; - NVGpaint fillPaint = state->fill; - int i; - - nvg__flattenPaths(ctx); - if (ctx->params.edgeAntiAlias && state->shapeAntiAlias) - nvg__expandFill(ctx, ctx->fringeWidth, NVG_MITER, 2.4f); - else - nvg__expandFill(ctx, 0.0f, NVG_MITER, 2.4f); - - // Apply global alpha - fillPaint.innerColor.a *= state->alpha; - fillPaint.outerColor.a *= state->alpha; - - ctx->params.renderFill(ctx->params.userPtr, &fillPaint, state->compositeOperation, &state->scissor, ctx->fringeWidth, - ctx->cache->bounds, ctx->cache->paths, ctx->cache->npaths); - - // Count triangles - for (i = 0; i < ctx->cache->npaths; i++) { - path = &ctx->cache->paths[i]; - ctx->fillTriCount += path->nfill-2; - ctx->fillTriCount += path->nstroke-2; - ctx->drawCallCount += 2; - } -} - -void nvgStroke(NVGcontext* ctx) -{ - NVGstate* state = nvg__getState(ctx); - float scale = nvg__getAverageScale(state->xform); - float strokeWidth = nvg__clampf(state->strokeWidth * scale, 0.0f, 200.0f); - NVGpaint strokePaint = state->stroke; - const NVGpath* path; - int i; - - - if (strokeWidth < ctx->fringeWidth) { - // If the stroke width is less than pixel size, use alpha to emulate coverage. - // Since coverage is area, scale by alpha*alpha. - float alpha = nvg__clampf(strokeWidth / ctx->fringeWidth, 0.0f, 1.0f); - strokePaint.innerColor.a *= alpha*alpha; - strokePaint.outerColor.a *= alpha*alpha; - strokeWidth = ctx->fringeWidth; - } - - // Apply global alpha - strokePaint.innerColor.a *= state->alpha; - strokePaint.outerColor.a *= state->alpha; - - nvg__flattenPaths(ctx); - - if (ctx->params.edgeAntiAlias && state->shapeAntiAlias) - nvg__expandStroke(ctx, strokeWidth*0.5f, ctx->fringeWidth, state->lineCap, state->lineJoin, state->miterLimit); - else - nvg__expandStroke(ctx, strokeWidth*0.5f, 0.0f, state->lineCap, state->lineJoin, state->miterLimit); - - ctx->params.renderStroke(ctx->params.userPtr, &strokePaint, state->compositeOperation, &state->scissor, ctx->fringeWidth, - strokeWidth, ctx->cache->paths, ctx->cache->npaths); - - // Count triangles - for (i = 0; i < ctx->cache->npaths; i++) { - path = &ctx->cache->paths[i]; - ctx->strokeTriCount += path->nstroke-2; - ctx->drawCallCount++; - } -} - -// Add fonts -int nvgCreateFont(NVGcontext* ctx, const char* name, const char* filename) -{ - return fonsAddFont(ctx->fs, name, filename, 0); -} - -int nvgCreateFontAtIndex(NVGcontext* ctx, const char* name, const char* filename, const int fontIndex) -{ - return fonsAddFont(ctx->fs, name, filename, fontIndex); -} - -int nvgCreateFontMem(NVGcontext* ctx, const char* name, unsigned char* data, int ndata, int freeData) -{ - return fonsAddFontMem(ctx->fs, name, data, ndata, freeData, 0); -} - -int nvgCreateFontMemAtIndex(NVGcontext* ctx, const char* name, unsigned char* data, int ndata, int freeData, const int fontIndex) -{ - return fonsAddFontMem(ctx->fs, name, data, ndata, freeData, fontIndex); -} - -int nvgFindFont(NVGcontext* ctx, const char* name) -{ - if (name == NULL) return -1; - return fonsGetFontByName(ctx->fs, name); -} - - -int nvgAddFallbackFontId(NVGcontext* ctx, int baseFont, int fallbackFont) -{ - if(baseFont == -1 || fallbackFont == -1) return 0; - return fonsAddFallbackFont(ctx->fs, baseFont, fallbackFont); -} - -int nvgAddFallbackFont(NVGcontext* ctx, const char* baseFont, const char* fallbackFont) -{ - return nvgAddFallbackFontId(ctx, nvgFindFont(ctx, baseFont), nvgFindFont(ctx, fallbackFont)); -} - -void nvgResetFallbackFontsId(NVGcontext* ctx, int baseFont) -{ - fonsResetFallbackFont(ctx->fs, baseFont); -} - -void nvgResetFallbackFonts(NVGcontext* ctx, const char* baseFont) -{ - nvgResetFallbackFontsId(ctx, nvgFindFont(ctx, baseFont)); -} - -// State setting -void nvgFontSize(NVGcontext* ctx, float size) -{ - NVGstate* state = nvg__getState(ctx); - state->fontSize = size; -} - -void nvgFontBlur(NVGcontext* ctx, float blur) -{ - NVGstate* state = nvg__getState(ctx); - state->fontBlur = blur; -} - -void nvgTextLetterSpacing(NVGcontext* ctx, float spacing) -{ - NVGstate* state = nvg__getState(ctx); - state->letterSpacing = spacing; -} - -void nvgTextLineHeight(NVGcontext* ctx, float lineHeight) -{ - NVGstate* state = nvg__getState(ctx); - state->lineHeight = lineHeight; -} - -void nvgTextAlign(NVGcontext* ctx, int align) -{ - NVGstate* state = nvg__getState(ctx); - state->textAlign = align; -} - -void nvgFontFaceId(NVGcontext* ctx, int font) -{ - NVGstate* state = nvg__getState(ctx); - state->fontId = font; -} - -void nvgFontFace(NVGcontext* ctx, const char* font) -{ - NVGstate* state = nvg__getState(ctx); - state->fontId = fonsGetFontByName(ctx->fs, font); -} - -static float nvg__quantize(float a, float d) -{ - return ((int)(a / d + 0.5f)) * d; -} - -static float nvg__getFontScale(NVGstate* state) -{ - return nvg__minf(nvg__quantize(nvg__getAverageScale(state->xform), 0.01f), 4.0f); -} - -static void nvg__flushTextTexture(NVGcontext* ctx) -{ - int dirty[4]; - - if (fonsValidateTexture(ctx->fs, dirty)) { - int fontImage = ctx->fontImages[ctx->fontImageIdx]; - // Update texture - if (fontImage != 0) { - int iw, ih; - const unsigned char* data = fonsGetTextureData(ctx->fs, &iw, &ih); - int x = dirty[0]; - int y = dirty[1]; - int w = dirty[2] - dirty[0]; - int h = dirty[3] - dirty[1]; - ctx->params.renderUpdateTexture(ctx->params.userPtr, fontImage, x,y, w,h, data); - } - } -} - -static int nvg__allocTextAtlas(NVGcontext* ctx) -{ - int iw, ih; - nvg__flushTextTexture(ctx); - if (ctx->fontImageIdx >= NVG_MAX_FONTIMAGES-1) - return 0; - // if next fontImage already have a texture - if (ctx->fontImages[ctx->fontImageIdx+1] != 0) - nvgImageSize(ctx, ctx->fontImages[ctx->fontImageIdx+1], &iw, &ih); - else { // calculate the new font image size and create it. - nvgImageSize(ctx, ctx->fontImages[ctx->fontImageIdx], &iw, &ih); - if (iw > ih) - ih *= 2; - else - iw *= 2; - if (iw > NVG_MAX_FONTIMAGE_SIZE || ih > NVG_MAX_FONTIMAGE_SIZE) - iw = ih = NVG_MAX_FONTIMAGE_SIZE; - ctx->fontImages[ctx->fontImageIdx+1] = ctx->params.renderCreateTexture(ctx->params.userPtr, NVG_TEXTURE_ALPHA, iw, ih, 0, NULL); - } - ++ctx->fontImageIdx; - fonsResetAtlas(ctx->fs, iw, ih); - return 1; -} - -static void nvg__renderText(NVGcontext* ctx, NVGvertex* verts, int nverts) -{ - NVGstate* state = nvg__getState(ctx); - NVGpaint paint = state->fill; - - // Render triangles. - paint.image = ctx->fontImages[ctx->fontImageIdx]; - - // Apply global alpha - paint.innerColor.a *= state->alpha; - paint.outerColor.a *= state->alpha; - - ctx->params.renderTriangles(ctx->params.userPtr, &paint, state->compositeOperation, &state->scissor, verts, nverts, ctx->fringeWidth); - - ctx->drawCallCount++; - ctx->textTriCount += nverts/3; -} - -static int nvg__isTransformFlipped(const float *xform) -{ - float det = xform[0] * xform[3] - xform[2] * xform[1]; - return( det < 0); -} - -float nvgText(NVGcontext* ctx, float x, float y, const char* string, const char* end) -{ - NVGstate* state = nvg__getState(ctx); - FONStextIter iter, prevIter; - FONSquad q; - NVGvertex* verts; - float scale = nvg__getFontScale(state) * ctx->devicePxRatio; - float invscale = 1.0f / scale; - int cverts = 0; - int nverts = 0; - int isFlipped = nvg__isTransformFlipped(state->xform); - - if (end == NULL) - end = string + strlen(string); - - if (state->fontId == FONS_INVALID) return x; - - fonsSetSize(ctx->fs, state->fontSize*scale); - fonsSetSpacing(ctx->fs, state->letterSpacing*scale); - fonsSetBlur(ctx->fs, state->fontBlur*scale); - fonsSetAlign(ctx->fs, state->textAlign); - fonsSetFont(ctx->fs, state->fontId); - - cverts = nvg__maxi(2, (int)(end - string)) * 6; // conservative estimate. - verts = nvg__allocTempVerts(ctx, cverts); - if (verts == NULL) return x; - - fonsTextIterInit(ctx->fs, &iter, x*scale, y*scale, string, end, FONS_GLYPH_BITMAP_REQUIRED); - prevIter = iter; - while (fonsTextIterNext(ctx->fs, &iter, &q)) { - float c[4*2]; - if (iter.prevGlyphIndex == -1) { // can not retrieve glyph? - if (nverts != 0) { - nvg__renderText(ctx, verts, nverts); - nverts = 0; - } - if (!nvg__allocTextAtlas(ctx)) - break; // no memory :( - iter = prevIter; - fonsTextIterNext(ctx->fs, &iter, &q); // try again - if (iter.prevGlyphIndex == -1) // still can not find glyph? - break; - } - prevIter = iter; - if(isFlipped) { - float tmp; - - tmp = q.y0; q.y0 = q.y1; q.y1 = tmp; - tmp = q.t0; q.t0 = q.t1; q.t1 = tmp; - } - // Transform corners. - nvgTransformPoint(&c[0],&c[1], state->xform, q.x0*invscale, q.y0*invscale); - nvgTransformPoint(&c[2],&c[3], state->xform, q.x1*invscale, q.y0*invscale); - nvgTransformPoint(&c[4],&c[5], state->xform, q.x1*invscale, q.y1*invscale); - nvgTransformPoint(&c[6],&c[7], state->xform, q.x0*invscale, q.y1*invscale); - // Create triangles - if (nverts+6 <= cverts) { - nvg__vset(&verts[nverts], c[0], c[1], q.s0, q.t0); nverts++; - nvg__vset(&verts[nverts], c[4], c[5], q.s1, q.t1); nverts++; - nvg__vset(&verts[nverts], c[2], c[3], q.s1, q.t0); nverts++; - nvg__vset(&verts[nverts], c[0], c[1], q.s0, q.t0); nverts++; - nvg__vset(&verts[nverts], c[6], c[7], q.s0, q.t1); nverts++; - nvg__vset(&verts[nverts], c[4], c[5], q.s1, q.t1); nverts++; - } - } - - // TODO: add back-end bit to do this just once per frame. - nvg__flushTextTexture(ctx); - - nvg__renderText(ctx, verts, nverts); - - return iter.nextx / scale; -} - -void nvgTextBox(NVGcontext* ctx, float x, float y, float breakRowWidth, const char* string, const char* end) -{ - NVGstate* state = nvg__getState(ctx); - NVGtextRow rows[2]; - int nrows = 0, i; - int oldAlign = state->textAlign; - int haling = state->textAlign & (NVG_ALIGN_LEFT | NVG_ALIGN_CENTER | NVG_ALIGN_RIGHT); - int valign = state->textAlign & (NVG_ALIGN_TOP | NVG_ALIGN_MIDDLE | NVG_ALIGN_BOTTOM | NVG_ALIGN_BASELINE); - float lineh = 0; - - if (state->fontId == FONS_INVALID) return; - - nvgTextMetrics(ctx, NULL, NULL, &lineh); - - state->textAlign = NVG_ALIGN_LEFT | valign; - - while ((nrows = nvgTextBreakLines(ctx, string, end, breakRowWidth, rows, 2))) { - for (i = 0; i < nrows; i++) { - NVGtextRow* row = &rows[i]; - if (haling & NVG_ALIGN_LEFT) - nvgText(ctx, x, y, row->start, row->end); - else if (haling & NVG_ALIGN_CENTER) - nvgText(ctx, x + breakRowWidth*0.5f - row->width*0.5f, y, row->start, row->end); - else if (haling & NVG_ALIGN_RIGHT) - nvgText(ctx, x + breakRowWidth - row->width, y, row->start, row->end); - y += lineh * state->lineHeight; - } - string = rows[nrows-1].next; - } - - state->textAlign = oldAlign; -} - -int nvgTextGlyphPositions(NVGcontext* ctx, float x, float y, const char* string, const char* end, NVGglyphPosition* positions, int maxPositions) -{ - NVGstate* state = nvg__getState(ctx); - float scale = nvg__getFontScale(state) * ctx->devicePxRatio; - float invscale = 1.0f / scale; - FONStextIter iter, prevIter; - FONSquad q; - int npos = 0; - - if (state->fontId == FONS_INVALID) return 0; - - if (end == NULL) - end = string + strlen(string); - - if (string == end) - return 0; - - fonsSetSize(ctx->fs, state->fontSize*scale); - fonsSetSpacing(ctx->fs, state->letterSpacing*scale); - fonsSetBlur(ctx->fs, state->fontBlur*scale); - fonsSetAlign(ctx->fs, state->textAlign); - fonsSetFont(ctx->fs, state->fontId); - - fonsTextIterInit(ctx->fs, &iter, x*scale, y*scale, string, end, FONS_GLYPH_BITMAP_OPTIONAL); - prevIter = iter; - while (fonsTextIterNext(ctx->fs, &iter, &q)) { - if (iter.prevGlyphIndex < 0 && nvg__allocTextAtlas(ctx)) { // can not retrieve glyph? - iter = prevIter; - fonsTextIterNext(ctx->fs, &iter, &q); // try again - } - prevIter = iter; - positions[npos].str = iter.str; - positions[npos].x = iter.x * invscale; - positions[npos].minx = nvg__minf(iter.x, q.x0) * invscale; - positions[npos].maxx = nvg__maxf(iter.nextx, q.x1) * invscale; - npos++; - if (npos >= maxPositions) - break; - } - - return npos; -} - -enum NVGcodepointType { - NVG_SPACE, - NVG_NEWLINE, - NVG_CHAR, - NVG_CJK_CHAR, -}; - -int nvgTextBreakLines(NVGcontext* ctx, const char* string, const char* end, float breakRowWidth, NVGtextRow* rows, int maxRows) -{ - NVGstate* state = nvg__getState(ctx); - float scale = nvg__getFontScale(state) * ctx->devicePxRatio; - float invscale = 1.0f / scale; - FONStextIter iter, prevIter; - FONSquad q; - int nrows = 0; - float rowStartX = 0; - float rowWidth = 0; - float rowMinX = 0; - float rowMaxX = 0; - const char* rowStart = NULL; - const char* rowEnd = NULL; - const char* wordStart = NULL; - float wordStartX = 0; - float wordMinX = 0; - const char* breakEnd = NULL; - float breakWidth = 0; - float breakMaxX = 0; - int type = NVG_SPACE, ptype = NVG_SPACE; - unsigned int pcodepoint = 0; - - if (maxRows == 0) return 0; - if (state->fontId == FONS_INVALID) return 0; - - if (end == NULL) - end = string + strlen(string); - - if (string == end) return 0; - - fonsSetSize(ctx->fs, state->fontSize*scale); - fonsSetSpacing(ctx->fs, state->letterSpacing*scale); - fonsSetBlur(ctx->fs, state->fontBlur*scale); - fonsSetAlign(ctx->fs, state->textAlign); - fonsSetFont(ctx->fs, state->fontId); - - breakRowWidth *= scale; - - fonsTextIterInit(ctx->fs, &iter, 0, 0, string, end, FONS_GLYPH_BITMAP_OPTIONAL); - prevIter = iter; - while (fonsTextIterNext(ctx->fs, &iter, &q)) { - if (iter.prevGlyphIndex < 0 && nvg__allocTextAtlas(ctx)) { // can not retrieve glyph? - iter = prevIter; - fonsTextIterNext(ctx->fs, &iter, &q); // try again - } - prevIter = iter; - switch (iter.codepoint) { - case 9: // \t - case 11: // \v - case 12: // \f - case 32: // space - case 0x00a0: // NBSP - type = NVG_SPACE; - break; - case 10: // \n - type = pcodepoint == 13 ? NVG_SPACE : NVG_NEWLINE; - break; - case 13: // \r - type = pcodepoint == 10 ? NVG_SPACE : NVG_NEWLINE; - break; - case 0x0085: // NEL - type = NVG_NEWLINE; - break; - default: - if ((iter.codepoint >= 0x4E00 && iter.codepoint <= 0x9FFF) || - (iter.codepoint >= 0x3000 && iter.codepoint <= 0x30FF) || - (iter.codepoint >= 0xFF00 && iter.codepoint <= 0xFFEF) || - (iter.codepoint >= 0x1100 && iter.codepoint <= 0x11FF) || - (iter.codepoint >= 0x3130 && iter.codepoint <= 0x318F) || - (iter.codepoint >= 0xAC00 && iter.codepoint <= 0xD7AF)) - type = NVG_CJK_CHAR; - else - type = NVG_CHAR; - break; - } - - if (type == NVG_NEWLINE) { - // Always handle new lines. - rows[nrows].start = rowStart != NULL ? rowStart : iter.str; - rows[nrows].end = rowEnd != NULL ? rowEnd : iter.str; - rows[nrows].width = rowWidth * invscale; - rows[nrows].minx = rowMinX * invscale; - rows[nrows].maxx = rowMaxX * invscale; - rows[nrows].next = iter.next; - nrows++; - if (nrows >= maxRows) - return nrows; - // Set null break point - breakEnd = rowStart; - breakWidth = 0.0; - breakMaxX = 0.0; - // Indicate to skip the white space at the beginning of the row. - rowStart = NULL; - rowEnd = NULL; - rowWidth = 0; - rowMinX = rowMaxX = 0; - } else { - if (rowStart == NULL) { - // Skip white space until the beginning of the line - if (type == NVG_CHAR || type == NVG_CJK_CHAR) { - // The current char is the row so far - rowStartX = iter.x; - rowStart = iter.str; - rowEnd = iter.next; - rowWidth = iter.nextx - rowStartX; - rowMinX = q.x0 - rowStartX; - rowMaxX = q.x1 - rowStartX; - wordStart = iter.str; - wordStartX = iter.x; - wordMinX = q.x0 - rowStartX; - // Set null break point - breakEnd = rowStart; - breakWidth = 0.0; - breakMaxX = 0.0; - } - } else { - float nextWidth = iter.nextx - rowStartX; - - // track last non-white space character - if (type == NVG_CHAR || type == NVG_CJK_CHAR) { - rowEnd = iter.next; - rowWidth = iter.nextx - rowStartX; - rowMaxX = q.x1 - rowStartX; - } - // track last end of a word - if (((ptype == NVG_CHAR || ptype == NVG_CJK_CHAR) && type == NVG_SPACE) || type == NVG_CJK_CHAR) { - breakEnd = iter.str; - breakWidth = rowWidth; - breakMaxX = rowMaxX; - } - // track last beginning of a word - if ((ptype == NVG_SPACE && (type == NVG_CHAR || type == NVG_CJK_CHAR)) || type == NVG_CJK_CHAR) { - wordStart = iter.str; - wordStartX = iter.x; - wordMinX = q.x0; - } - - // Break to new line when a character is beyond break width. - if ((type == NVG_CHAR || type == NVG_CJK_CHAR) && nextWidth > breakRowWidth) { - // The run length is too long, need to break to new line. - if (breakEnd == rowStart) { - // The current word is longer than the row length, just break it from here. - rows[nrows].start = rowStart; - rows[nrows].end = iter.str; - rows[nrows].width = rowWidth * invscale; - rows[nrows].minx = rowMinX * invscale; - rows[nrows].maxx = rowMaxX * invscale; - rows[nrows].next = iter.str; - nrows++; - if (nrows >= maxRows) - return nrows; - rowStartX = iter.x; - rowStart = iter.str; - rowEnd = iter.next; - rowWidth = iter.nextx - rowStartX; - rowMinX = q.x0 - rowStartX; - rowMaxX = q.x1 - rowStartX; - wordStart = iter.str; - wordStartX = iter.x; - wordMinX = q.x0 - rowStartX; - } else { - // Break the line from the end of the last word, and start new line from the beginning of the new. - rows[nrows].start = rowStart; - rows[nrows].end = breakEnd; - rows[nrows].width = breakWidth * invscale; - rows[nrows].minx = rowMinX * invscale; - rows[nrows].maxx = breakMaxX * invscale; - rows[nrows].next = wordStart; - nrows++; - if (nrows >= maxRows) - return nrows; - // Update row - rowStartX = wordStartX; - rowStart = wordStart; - rowEnd = iter.next; - rowWidth = iter.nextx - rowStartX; - rowMinX = wordMinX - rowStartX; - rowMaxX = q.x1 - rowStartX; - } - // Set null break point - breakEnd = rowStart; - breakWidth = 0.0; - breakMaxX = 0.0; - } - } - } - - pcodepoint = iter.codepoint; - ptype = type; - } - - // Break the line from the end of the last word, and start new line from the beginning of the new. - if (rowStart != NULL) { - rows[nrows].start = rowStart; - rows[nrows].end = rowEnd; - rows[nrows].width = rowWidth * invscale; - rows[nrows].minx = rowMinX * invscale; - rows[nrows].maxx = rowMaxX * invscale; - rows[nrows].next = end; - nrows++; - } - - return nrows; -} - -float nvgTextBounds(NVGcontext* ctx, float x, float y, const char* string, const char* end, float* bounds) -{ - NVGstate* state = nvg__getState(ctx); - float scale = nvg__getFontScale(state) * ctx->devicePxRatio; - float invscale = 1.0f / scale; - float width; - - if (state->fontId == FONS_INVALID) return 0; - - fonsSetSize(ctx->fs, state->fontSize*scale); - fonsSetSpacing(ctx->fs, state->letterSpacing*scale); - fonsSetBlur(ctx->fs, state->fontBlur*scale); - fonsSetAlign(ctx->fs, state->textAlign); - fonsSetFont(ctx->fs, state->fontId); - - width = fonsTextBounds(ctx->fs, x*scale, y*scale, string, end, bounds); - if (bounds != NULL) { - // Use line bounds for height. - fonsLineBounds(ctx->fs, y*scale, &bounds[1], &bounds[3]); - bounds[0] *= invscale; - bounds[1] *= invscale; - bounds[2] *= invscale; - bounds[3] *= invscale; - } - return width * invscale; -} - -void nvgTextBoxBounds(NVGcontext* ctx, float x, float y, float breakRowWidth, const char* string, const char* end, float* bounds) -{ - NVGstate* state = nvg__getState(ctx); - NVGtextRow rows[2]; - float scale = nvg__getFontScale(state) * ctx->devicePxRatio; - float invscale = 1.0f / scale; - int nrows = 0, i; - int oldAlign = state->textAlign; - int haling = state->textAlign & (NVG_ALIGN_LEFT | NVG_ALIGN_CENTER | NVG_ALIGN_RIGHT); - int valign = state->textAlign & (NVG_ALIGN_TOP | NVG_ALIGN_MIDDLE | NVG_ALIGN_BOTTOM | NVG_ALIGN_BASELINE); - float lineh = 0, rminy = 0, rmaxy = 0; - float minx, miny, maxx, maxy; - - if (state->fontId == FONS_INVALID) { - if (bounds != NULL) - bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0f; - return; - } - - nvgTextMetrics(ctx, NULL, NULL, &lineh); - - state->textAlign = NVG_ALIGN_LEFT | valign; - - minx = maxx = x; - miny = maxy = y; - - fonsSetSize(ctx->fs, state->fontSize*scale); - fonsSetSpacing(ctx->fs, state->letterSpacing*scale); - fonsSetBlur(ctx->fs, state->fontBlur*scale); - fonsSetAlign(ctx->fs, state->textAlign); - fonsSetFont(ctx->fs, state->fontId); - fonsLineBounds(ctx->fs, 0, &rminy, &rmaxy); - rminy *= invscale; - rmaxy *= invscale; - - while ((nrows = nvgTextBreakLines(ctx, string, end, breakRowWidth, rows, 2))) { - for (i = 0; i < nrows; i++) { - NVGtextRow* row = &rows[i]; - float rminx, rmaxx, dx = 0; - // Horizontal bounds - if (haling & NVG_ALIGN_LEFT) - dx = 0; - else if (haling & NVG_ALIGN_CENTER) - dx = breakRowWidth*0.5f - row->width*0.5f; - else if (haling & NVG_ALIGN_RIGHT) - dx = breakRowWidth - row->width; - rminx = x + row->minx + dx; - rmaxx = x + row->maxx + dx; - minx = nvg__minf(minx, rminx); - maxx = nvg__maxf(maxx, rmaxx); - // Vertical bounds. - miny = nvg__minf(miny, y + rminy); - maxy = nvg__maxf(maxy, y + rmaxy); - - y += lineh * state->lineHeight; - } - string = rows[nrows-1].next; - } - - state->textAlign = oldAlign; - - if (bounds != NULL) { - bounds[0] = minx; - bounds[1] = miny; - bounds[2] = maxx; - bounds[3] = maxy; - } -} - -void nvgTextMetrics(NVGcontext* ctx, float* ascender, float* descender, float* lineh) -{ - NVGstate* state = nvg__getState(ctx); - float scale = nvg__getFontScale(state) * ctx->devicePxRatio; - float invscale = 1.0f / scale; - - if (state->fontId == FONS_INVALID) return; - - fonsSetSize(ctx->fs, state->fontSize*scale); - fonsSetSpacing(ctx->fs, state->letterSpacing*scale); - fonsSetBlur(ctx->fs, state->fontBlur*scale); - fonsSetAlign(ctx->fs, state->textAlign); - fonsSetFont(ctx->fs, state->fontId); - - fonsVertMetrics(ctx->fs, ascender, descender, lineh); - if (ascender != NULL) - *ascender *= invscale; - if (descender != NULL) - *descender *= invscale; - if (lineh != NULL) - *lineh *= invscale; -} -// vim: ft=c nu noet ts=4 diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg.h b/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg.h deleted file mode 100644 index cb63e52e..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg.h +++ /dev/null @@ -1,697 +0,0 @@ -// -// Copyright (c) 2013 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// - -#ifndef NANOVG_H -#define NANOVG_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define NVG_PI 3.14159265358979323846264338327f - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union -#endif - -typedef struct NVGcontext NVGcontext; - -struct NVGcolor { - union { - float rgba[4]; - struct { - float r,g,b,a; - }; - }; -}; -typedef struct NVGcolor NVGcolor; - -struct NVGpaint { - float xform[6]; - float extent[2]; - float radius; - float feather; - NVGcolor innerColor; - NVGcolor outerColor; - int image; -}; -typedef struct NVGpaint NVGpaint; - -enum NVGwinding { - NVG_CCW = 1, // Winding for solid shapes - NVG_CW = 2, // Winding for holes -}; - -enum NVGsolidity { - NVG_SOLID = 1, // CCW - NVG_HOLE = 2, // CW -}; - -enum NVGlineCap { - NVG_BUTT, - NVG_ROUND, - NVG_SQUARE, - NVG_BEVEL, - NVG_MITER, -}; - -enum NVGalign { - // Horizontal align - NVG_ALIGN_LEFT = 1<<0, // Default, align text horizontally to left. - NVG_ALIGN_CENTER = 1<<1, // Align text horizontally to center. - NVG_ALIGN_RIGHT = 1<<2, // Align text horizontally to right. - // Vertical align - NVG_ALIGN_TOP = 1<<3, // Align text vertically to top. - NVG_ALIGN_MIDDLE = 1<<4, // Align text vertically to middle. - NVG_ALIGN_BOTTOM = 1<<5, // Align text vertically to bottom. - NVG_ALIGN_BASELINE = 1<<6, // Default, align text vertically to baseline. -}; - -enum NVGblendFactor { - NVG_ZERO = 1<<0, - NVG_ONE = 1<<1, - NVG_SRC_COLOR = 1<<2, - NVG_ONE_MINUS_SRC_COLOR = 1<<3, - NVG_DST_COLOR = 1<<4, - NVG_ONE_MINUS_DST_COLOR = 1<<5, - NVG_SRC_ALPHA = 1<<6, - NVG_ONE_MINUS_SRC_ALPHA = 1<<7, - NVG_DST_ALPHA = 1<<8, - NVG_ONE_MINUS_DST_ALPHA = 1<<9, - NVG_SRC_ALPHA_SATURATE = 1<<10, -}; - -enum NVGcompositeOperation { - NVG_SOURCE_OVER, - NVG_SOURCE_IN, - NVG_SOURCE_OUT, - NVG_ATOP, - NVG_DESTINATION_OVER, - NVG_DESTINATION_IN, - NVG_DESTINATION_OUT, - NVG_DESTINATION_ATOP, - NVG_LIGHTER, - NVG_COPY, - NVG_XOR, -}; - -struct NVGcompositeOperationState { - int srcRGB; - int dstRGB; - int srcAlpha; - int dstAlpha; -}; -typedef struct NVGcompositeOperationState NVGcompositeOperationState; - -struct NVGglyphPosition { - const char* str; // Position of the glyph in the input string. - float x; // The x-coordinate of the logical glyph position. - float minx, maxx; // The bounds of the glyph shape. -}; -typedef struct NVGglyphPosition NVGglyphPosition; - -struct NVGtextRow { - const char* start; // Pointer to the input text where the row starts. - const char* end; // Pointer to the input text where the row ends (one past the last character). - const char* next; // Pointer to the beginning of the next row. - float width; // Logical width of the row. - float minx, maxx; // Actual bounds of the row. Logical with and bounds can differ because of kerning and some parts over extending. -}; -typedef struct NVGtextRow NVGtextRow; - -enum NVGimageFlags { - NVG_IMAGE_GENERATE_MIPMAPS = 1<<0, // Generate mipmaps during creation of the image. - NVG_IMAGE_REPEATX = 1<<1, // Repeat image in X direction. - NVG_IMAGE_REPEATY = 1<<2, // Repeat image in Y direction. - NVG_IMAGE_FLIPY = 1<<3, // Flips (inverses) image in Y direction when rendered. - NVG_IMAGE_PREMULTIPLIED = 1<<4, // Image data has premultiplied alpha. - NVG_IMAGE_NEAREST = 1<<5, // Image interpolation is Nearest instead Linear -}; - -// Begin drawing a new frame -// Calls to nanovg drawing API should be wrapped in nvgBeginFrame() & nvgEndFrame() -// nvgBeginFrame() defines the size of the window to render to in relation currently -// set viewport (i.e. glViewport on GL backends). Device pixel ration allows to -// control the rendering on Hi-DPI devices. -// For example, GLFW returns two dimension for an opened window: window size and -// frame buffer size. In that case you would set windowWidth/Height to the window size -// devicePixelRatio to: frameBufferWidth / windowWidth. -void nvgBeginFrame(NVGcontext* ctx, float windowWidth, float windowHeight, float devicePixelRatio); - -// Cancels drawing the current frame. -void nvgCancelFrame(NVGcontext* ctx); - -// Ends drawing flushing remaining render state. -void nvgEndFrame(NVGcontext* ctx); - -// -// Composite operation -// -// The composite operations in NanoVG are modeled after HTML Canvas API, and -// the blend func is based on OpenGL (see corresponding manuals for more info). -// The colors in the blending state have premultiplied alpha. - -// Sets the composite operation. The op parameter should be one of NVGcompositeOperation. -void nvgGlobalCompositeOperation(NVGcontext* ctx, int op); - -// Sets the composite operation with custom pixel arithmetic. The parameters should be one of NVGblendFactor. -void nvgGlobalCompositeBlendFunc(NVGcontext* ctx, int sfactor, int dfactor); - -// Sets the composite operation with custom pixel arithmetic for RGB and alpha components separately. The parameters should be one of NVGblendFactor. -void nvgGlobalCompositeBlendFuncSeparate(NVGcontext* ctx, int srcRGB, int dstRGB, int srcAlpha, int dstAlpha); - -// -// Color utils -// -// Colors in NanoVG are stored as unsigned ints in ABGR format. - -// Returns a color value from red, green, blue values. Alpha will be set to 255 (1.0f). -NVGcolor nvgRGB(unsigned char r, unsigned char g, unsigned char b); - -// Returns a color value from red, green, blue values. Alpha will be set to 1.0f. -NVGcolor nvgRGBf(float r, float g, float b); - - -// Returns a color value from red, green, blue and alpha values. -NVGcolor nvgRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); - -// Returns a color value from red, green, blue and alpha values. -NVGcolor nvgRGBAf(float r, float g, float b, float a); - - -// Linearly interpolates from color c0 to c1, and returns resulting color value. -NVGcolor nvgLerpRGBA(NVGcolor c0, NVGcolor c1, float u); - -// Sets transparency of a color value. -NVGcolor nvgTransRGBA(NVGcolor c0, unsigned char a); - -// Sets transparency of a color value. -NVGcolor nvgTransRGBAf(NVGcolor c0, float a); - -// Returns color value specified by hue, saturation and lightness. -// HSL values are all in range [0..1], alpha will be set to 255. -NVGcolor nvgHSL(float h, float s, float l); - -// Returns color value specified by hue, saturation and lightness and alpha. -// HSL values are all in range [0..1], alpha in range [0..255] -NVGcolor nvgHSLA(float h, float s, float l, unsigned char a); - -// -// State Handling -// -// NanoVG contains state which represents how paths will be rendered. -// The state contains transform, fill and stroke styles, text and font styles, -// and scissor clipping. - -// Pushes and saves the current render state into a state stack. -// A matching nvgRestore() must be used to restore the state. -void nvgSave(NVGcontext* ctx); - -// Pops and restores current render state. -void nvgRestore(NVGcontext* ctx); - -// Resets current render state to default values. Does not affect the render state stack. -void nvgReset(NVGcontext* ctx); - -// -// Render styles -// -// Fill and stroke render style can be either a solid color or a paint which is a gradient or a pattern. -// Solid color is simply defined as a color value, different kinds of paints can be created -// using nvgLinearGradient(), nvgBoxGradient(), nvgRadialGradient() and nvgImagePattern(). -// -// Current render style can be saved and restored using nvgSave() and nvgRestore(). - -// Sets whether to draw antialias for nvgStroke() and nvgFill(). It's enabled by default. -void nvgShapeAntiAlias(NVGcontext* ctx, int enabled); - -// Sets current stroke style to a solid color. -void nvgStrokeColor(NVGcontext* ctx, NVGcolor color); - -// Sets current stroke style to a paint, which can be a one of the gradients or a pattern. -void nvgStrokePaint(NVGcontext* ctx, NVGpaint paint); - -// Sets current fill style to a solid color. -void nvgFillColor(NVGcontext* ctx, NVGcolor color); - -// Sets current fill style to a paint, which can be a one of the gradients or a pattern. -void nvgFillPaint(NVGcontext* ctx, NVGpaint paint); - -// Sets the miter limit of the stroke style. -// Miter limit controls when a sharp corner is beveled. -void nvgMiterLimit(NVGcontext* ctx, float limit); - -// Sets the stroke width of the stroke style. -void nvgStrokeWidth(NVGcontext* ctx, float size); - -// Sets how the end of the line (cap) is drawn, -// Can be one of: NVG_BUTT (default), NVG_ROUND, NVG_SQUARE. -void nvgLineCap(NVGcontext* ctx, int cap); - -// Sets how sharp path corners are drawn. -// Can be one of NVG_MITER (default), NVG_ROUND, NVG_BEVEL. -void nvgLineJoin(NVGcontext* ctx, int join); - -// Sets the transparency applied to all rendered shapes. -// Already transparent paths will get proportionally more transparent as well. -void nvgGlobalAlpha(NVGcontext* ctx, float alpha); - -// -// Transforms -// -// The paths, gradients, patterns and scissor region are transformed by an transformation -// matrix at the time when they are passed to the API. -// The current transformation matrix is a affine matrix: -// [sx kx tx] -// [ky sy ty] -// [ 0 0 1] -// Where: sx,sy define scaling, kx,ky skewing, and tx,ty translation. -// The last row is assumed to be 0,0,1 and is not stored. -// -// Apart from nvgResetTransform(), each transformation function first creates -// specific transformation matrix and pre-multiplies the current transformation by it. -// -// Current coordinate system (transformation) can be saved and restored using nvgSave() and nvgRestore(). - -// Resets current transform to a identity matrix. -void nvgResetTransform(NVGcontext* ctx); - -// Premultiplies current coordinate system by specified matrix. -// The parameters are interpreted as matrix as follows: -// [a c e] -// [b d f] -// [0 0 1] -void nvgTransform(NVGcontext* ctx, float a, float b, float c, float d, float e, float f); - -// Translates current coordinate system. -void nvgTranslate(NVGcontext* ctx, float x, float y); - -// Rotates current coordinate system. Angle is specified in radians. -void nvgRotate(NVGcontext* ctx, float angle); - -// Skews the current coordinate system along X axis. Angle is specified in radians. -void nvgSkewX(NVGcontext* ctx, float angle); - -// Skews the current coordinate system along Y axis. Angle is specified in radians. -void nvgSkewY(NVGcontext* ctx, float angle); - -// Scales the current coordinate system. -void nvgScale(NVGcontext* ctx, float x, float y); - -// Stores the top part (a-f) of the current transformation matrix in to the specified buffer. -// [a c e] -// [b d f] -// [0 0 1] -// There should be space for 6 floats in the return buffer for the values a-f. -void nvgCurrentTransform(NVGcontext* ctx, float* xform); - - -// The following functions can be used to make calculations on 2x3 transformation matrices. -// A 2x3 matrix is represented as float[6]. - -// Sets the transform to identity matrix. -void nvgTransformIdentity(float* dst); - -// Sets the transform to translation matrix matrix. -void nvgTransformTranslate(float* dst, float tx, float ty); - -// Sets the transform to scale matrix. -void nvgTransformScale(float* dst, float sx, float sy); - -// Sets the transform to rotate matrix. Angle is specified in radians. -void nvgTransformRotate(float* dst, float a); - -// Sets the transform to skew-x matrix. Angle is specified in radians. -void nvgTransformSkewX(float* dst, float a); - -// Sets the transform to skew-y matrix. Angle is specified in radians. -void nvgTransformSkewY(float* dst, float a); - -// Sets the transform to the result of multiplication of two transforms, of A = A*B. -void nvgTransformMultiply(float* dst, const float* src); - -// Sets the transform to the result of multiplication of two transforms, of A = B*A. -void nvgTransformPremultiply(float* dst, const float* src); - -// Sets the destination to inverse of specified transform. -// Returns 1 if the inverse could be calculated, else 0. -int nvgTransformInverse(float* dst, const float* src); - -// Transform a point by given transform. -void nvgTransformPoint(float* dstx, float* dsty, const float* xform, float srcx, float srcy); - -// Converts degrees to radians and vice versa. -float nvgDegToRad(float deg); -float nvgRadToDeg(float rad); - -// -// Images -// -// NanoVG allows you to load jpg, png, psd, tga, pic and gif files to be used for rendering. -// In addition you can upload your own image. The image loading is provided by stb_image. -// The parameter imageFlags is combination of flags defined in NVGimageFlags. - -// Creates image by loading it from the disk from specified file name. -// Returns handle to the image. -int nvgCreateImage(NVGcontext* ctx, const char* filename, int imageFlags); - -// Creates image by loading it from the specified chunk of memory. -// Returns handle to the image. -int nvgCreateImageMem(NVGcontext* ctx, int imageFlags, unsigned char* data, int ndata); - -// Creates image from specified image data. -// Returns handle to the image. -int nvgCreateImageRGBA(NVGcontext* ctx, int w, int h, int imageFlags, const unsigned char* data); - -// Updates image data specified by image handle. -void nvgUpdateImage(NVGcontext* ctx, int image, const unsigned char* data); - -// Returns the dimensions of a created image. -void nvgImageSize(NVGcontext* ctx, int image, int* w, int* h); - -// Deletes created image. -void nvgDeleteImage(NVGcontext* ctx, int image); - -// -// Paints -// -// NanoVG supports four types of paints: linear gradient, box gradient, radial gradient and image pattern. -// These can be used as paints for strokes and fills. - -// Creates and returns a linear gradient. Parameters (sx,sy)-(ex,ey) specify the start and end coordinates -// of the linear gradient, icol specifies the start color and ocol the end color. -// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint(). -NVGpaint nvgLinearGradient(NVGcontext* ctx, float sx, float sy, float ex, float ey, - NVGcolor icol, NVGcolor ocol); - -// Creates and returns a box gradient. Box gradient is a feathered rounded rectangle, it is useful for rendering -// drop shadows or highlights for boxes. Parameters (x,y) define the top-left corner of the rectangle, -// (w,h) define the size of the rectangle, r defines the corner radius, and f feather. Feather defines how blurry -// the border of the rectangle is. Parameter icol specifies the inner color and ocol the outer color of the gradient. -// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint(). -NVGpaint nvgBoxGradient(NVGcontext* ctx, float x, float y, float w, float h, - float r, float f, NVGcolor icol, NVGcolor ocol); - -// Creates and returns a radial gradient. Parameters (cx,cy) specify the center, inr and outr specify -// the inner and outer radius of the gradient, icol specifies the start color and ocol the end color. -// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint(). -NVGpaint nvgRadialGradient(NVGcontext* ctx, float cx, float cy, float inr, float outr, - NVGcolor icol, NVGcolor ocol); - -// Creates and returns an image pattern. Parameters (ox,oy) specify the left-top location of the image pattern, -// (ex,ey) the size of one image, angle rotation around the top-left corner, image is handle to the image to render. -// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint(). -NVGpaint nvgImagePattern(NVGcontext* ctx, float ox, float oy, float ex, float ey, - float angle, int image, float alpha); - -// -// Scissoring -// -// Scissoring allows you to clip the rendering into a rectangle. This is useful for various -// user interface cases like rendering a text edit or a timeline. - -// Sets the current scissor rectangle. -// The scissor rectangle is transformed by the current transform. -void nvgScissor(NVGcontext* ctx, float x, float y, float w, float h); - -// Intersects current scissor rectangle with the specified rectangle. -// The scissor rectangle is transformed by the current transform. -// Note: in case the rotation of previous scissor rect differs from -// the current one, the intersection will be done between the specified -// rectangle and the previous scissor rectangle transformed in the current -// transform space. The resulting shape is always rectangle. -void nvgIntersectScissor(NVGcontext* ctx, float x, float y, float w, float h); - -// Reset and disables scissoring. -void nvgResetScissor(NVGcontext* ctx); - -// -// Paths -// -// Drawing a new shape starts with nvgBeginPath(), it clears all the currently defined paths. -// Then you define one or more paths and sub-paths which describe the shape. The are functions -// to draw common shapes like rectangles and circles, and lower level step-by-step functions, -// which allow to define a path curve by curve. -// -// NanoVG uses even-odd fill rule to draw the shapes. Solid shapes should have counter clockwise -// winding and holes should have counter clockwise order. To specify winding of a path you can -// call nvgPathWinding(). This is useful especially for the common shapes, which are drawn CCW. -// -// Finally you can fill the path using current fill style by calling nvgFill(), and stroke it -// with current stroke style by calling nvgStroke(). -// -// The curve segments and sub-paths are transformed by the current transform. - -// Clears the current path and sub-paths. -void nvgBeginPath(NVGcontext* ctx); - -// Starts new sub-path with specified point as first point. -void nvgMoveTo(NVGcontext* ctx, float x, float y); - -// Adds line segment from the last point in the path to the specified point. -void nvgLineTo(NVGcontext* ctx, float x, float y); - -// Adds cubic bezier segment from last point in the path via two control points to the specified point. -void nvgBezierTo(NVGcontext* ctx, float c1x, float c1y, float c2x, float c2y, float x, float y); - -// Adds quadratic bezier segment from last point in the path via a control point to the specified point. -void nvgQuadTo(NVGcontext* ctx, float cx, float cy, float x, float y); - -// Adds an arc segment at the corner defined by the last path point, and two specified points. -void nvgArcTo(NVGcontext* ctx, float x1, float y1, float x2, float y2, float radius); - -// Closes current sub-path with a line segment. -void nvgClosePath(NVGcontext* ctx); - -// Sets the current sub-path winding, see NVGwinding and NVGsolidity. -void nvgPathWinding(NVGcontext* ctx, int dir); - -// Creates new circle arc shaped sub-path. The arc center is at cx,cy, the arc radius is r, -// and the arc is drawn from angle a0 to a1, and swept in direction dir (NVG_CCW, or NVG_CW). -// Angles are specified in radians. -void nvgArc(NVGcontext* ctx, float cx, float cy, float r, float a0, float a1, int dir); - -// Creates new rectangle shaped sub-path. -void nvgRect(NVGcontext* ctx, float x, float y, float w, float h); - -// Creates new rounded rectangle shaped sub-path. -void nvgRoundedRect(NVGcontext* ctx, float x, float y, float w, float h, float r); - -// Creates new rounded rectangle shaped sub-path with varying radii for each corner. -void nvgRoundedRectVarying(NVGcontext* ctx, float x, float y, float w, float h, float radTopLeft, float radTopRight, float radBottomRight, float radBottomLeft); - -// Creates new ellipse shaped sub-path. -void nvgEllipse(NVGcontext* ctx, float cx, float cy, float rx, float ry); - -// Creates new circle shaped sub-path. -void nvgCircle(NVGcontext* ctx, float cx, float cy, float r); - -// Fills the current path with current fill style. -void nvgFill(NVGcontext* ctx); - -// Fills the current path with current stroke style. -void nvgStroke(NVGcontext* ctx); - - -// -// Text -// -// NanoVG allows you to load .ttf files and use the font to render text. -// -// The appearance of the text can be defined by setting the current text style -// and by specifying the fill color. Common text and font settings such as -// font size, letter spacing and text align are supported. Font blur allows you -// to create simple text effects such as drop shadows. -// -// At render time the font face can be set based on the font handles or name. -// -// Font measure functions return values in local space, the calculations are -// carried in the same resolution as the final rendering. This is done because -// the text glyph positions are snapped to the nearest pixels sharp rendering. -// -// The local space means that values are not rotated or scale as per the current -// transformation. For example if you set font size to 12, which would mean that -// line height is 16, then regardless of the current scaling and rotation, the -// returned line height is always 16. Some measures may vary because of the scaling -// since aforementioned pixel snapping. -// -// While this may sound a little odd, the setup allows you to always render the -// same way regardless of scaling. I.e. following works regardless of scaling: -// -// const char* txt = "Text me up."; -// nvgTextBounds(vg, x,y, txt, NULL, bounds); -// nvgBeginPath(vg); -// nvgRoundedRect(vg, bounds[0],bounds[1], bounds[2]-bounds[0], bounds[3]-bounds[1]); -// nvgFill(vg); -// -// Note: currently only solid color fill is supported for text. - -// Creates font by loading it from the disk from specified file name. -// Returns handle to the font. -int nvgCreateFont(NVGcontext* ctx, const char* name, const char* filename); - -// fontIndex specifies which font face to load from a .ttf/.ttc file. -int nvgCreateFontAtIndex(NVGcontext* ctx, const char* name, const char* filename, const int fontIndex); - -// Creates font by loading it from the specified memory chunk. -// Returns handle to the font. -int nvgCreateFontMem(NVGcontext* ctx, const char* name, unsigned char* data, int ndata, int freeData); - -// fontIndex specifies which font face to load from a .ttf/.ttc file. -int nvgCreateFontMemAtIndex(NVGcontext* ctx, const char* name, unsigned char* data, int ndata, int freeData, const int fontIndex); - -// Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found. -int nvgFindFont(NVGcontext* ctx, const char* name); - -// Adds a fallback font by handle. -int nvgAddFallbackFontId(NVGcontext* ctx, int baseFont, int fallbackFont); - -// Adds a fallback font by name. -int nvgAddFallbackFont(NVGcontext* ctx, const char* baseFont, const char* fallbackFont); - -// Resets fallback fonts by handle. -void nvgResetFallbackFontsId(NVGcontext* ctx, int baseFont); - -// Resets fallback fonts by name. -void nvgResetFallbackFonts(NVGcontext* ctx, const char* baseFont); - -// Sets the font size of current text style. -void nvgFontSize(NVGcontext* ctx, float size); - -// Sets the blur of current text style. -void nvgFontBlur(NVGcontext* ctx, float blur); - -// Sets the letter spacing of current text style. -void nvgTextLetterSpacing(NVGcontext* ctx, float spacing); - -// Sets the proportional line height of current text style. The line height is specified as multiple of font size. -void nvgTextLineHeight(NVGcontext* ctx, float lineHeight); - -// Sets the text align of current text style, see NVGalign for options. -void nvgTextAlign(NVGcontext* ctx, int align); - -// Sets the font face based on specified id of current text style. -void nvgFontFaceId(NVGcontext* ctx, int font); - -// Sets the font face based on specified name of current text style. -void nvgFontFace(NVGcontext* ctx, const char* font); - -// Draws text string at specified location. If end is specified only the sub-string up to the end is drawn. -float nvgText(NVGcontext* ctx, float x, float y, const char* string, const char* end); - -// Draws multi-line text string at specified location wrapped at the specified width. If end is specified only the sub-string up to the end is drawn. -// White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. -// Words longer than the max width are slit at nearest character (i.e. no hyphenation). -void nvgTextBox(NVGcontext* ctx, float x, float y, float breakRowWidth, const char* string, const char* end); - -// Measures the specified text string. Parameter bounds should be a pointer to float[4], -// if the bounding box of the text should be returned. The bounds value are [xmin,ymin, xmax,ymax] -// Returns the horizontal advance of the measured text (i.e. where the next character should drawn). -// Measured values are returned in local coordinate space. -float nvgTextBounds(NVGcontext* ctx, float x, float y, const char* string, const char* end, float* bounds); - -// Measures the specified multi-text string. Parameter bounds should be a pointer to float[4], -// if the bounding box of the text should be returned. The bounds value are [xmin,ymin, xmax,ymax] -// Measured values are returned in local coordinate space. -void nvgTextBoxBounds(NVGcontext* ctx, float x, float y, float breakRowWidth, const char* string, const char* end, float* bounds); - -// Calculates the glyph x positions of the specified text. If end is specified only the sub-string will be used. -// Measured values are returned in local coordinate space. -int nvgTextGlyphPositions(NVGcontext* ctx, float x, float y, const char* string, const char* end, NVGglyphPosition* positions, int maxPositions); - -// Returns the vertical metrics based on the current text style. -// Measured values are returned in local coordinate space. -void nvgTextMetrics(NVGcontext* ctx, float* ascender, float* descender, float* lineh); - -// Breaks the specified text into lines. If end is specified only the sub-string will be used. -// White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. -// Words longer than the max width are slit at nearest character (i.e. no hyphenation). -int nvgTextBreakLines(NVGcontext* ctx, const char* string, const char* end, float breakRowWidth, NVGtextRow* rows, int maxRows); - -// -// Internal Render API -// -enum NVGtexture { - NVG_TEXTURE_ALPHA = 0x01, - NVG_TEXTURE_RGBA = 0x02, -}; - -struct NVGscissor { - float xform[6]; - float extent[2]; -}; -typedef struct NVGscissor NVGscissor; - -struct NVGvertex { - float x,y,u,v; -}; -typedef struct NVGvertex NVGvertex; - -struct NVGpath { - int first; - int count; - unsigned char closed; - int nbevel; - NVGvertex* fill; - int nfill; - NVGvertex* stroke; - int nstroke; - int winding; - int convex; -}; -typedef struct NVGpath NVGpath; - -struct NVGparams { - void* userPtr; - int edgeAntiAlias; - int (*renderCreate)(void* uptr); - int (*renderCreateTexture)(void* uptr, int type, int w, int h, int imageFlags, const unsigned char* data); - int (*renderDeleteTexture)(void* uptr, int image); - int (*renderUpdateTexture)(void* uptr, int image, int x, int y, int w, int h, const unsigned char* data); - int (*renderGetTextureSize)(void* uptr, int image, int* w, int* h); - void (*renderViewport)(void* uptr, float width, float height, float devicePixelRatio); - void (*renderCancel)(void* uptr); - void (*renderFlush)(void* uptr); - void (*renderFill)(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, const float* bounds, const NVGpath* paths, int npaths); - void (*renderStroke)(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, float strokeWidth, const NVGpath* paths, int npaths); - void (*renderTriangles)(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, const NVGvertex* verts, int nverts, float fringe); - void (*renderDelete)(void* uptr); -}; -typedef struct NVGparams NVGparams; - -// Constructor and destructor, called by the render back-end. -NVGcontext* nvgCreateInternal(NVGparams* params); -void nvgDeleteInternal(NVGcontext* ctx); - -NVGparams* nvgInternalParams(NVGcontext* ctx); - -// Debug function to dump cached path data. -void nvgDebugDumpPathCache(NVGcontext* ctx); - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#define NVG_NOTUSED(v) for (;;) { (void)(1 ? (void)0 : ( (void)(v) ) ); break; } - -#ifdef __cplusplus -} -#endif - -#endif // NANOVG_H diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg_gl.h b/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg_gl.h deleted file mode 100644 index e3add803..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg_gl.h +++ /dev/null @@ -1,1924 +0,0 @@ -// -// Copyright (c) 2009-2013 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// -#ifndef NANOVG_GL_H -#define NANOVG_GL_H - -#ifdef __cplusplus -extern "C" { -#endif - -// Create flags - -enum NVGcreateFlags { - // Flag indicating if geometry based anti-aliasing is used (may not be needed when using MSAA). - NVG_ANTIALIAS = 1<<0, - // Flag indicating if strokes should be drawn using stencil buffer. The rendering will be a little - // slower, but path overlaps (i.e. self-intersecting or sharp turns) will be drawn just once. - NVG_STENCIL_STROKES = 1<<1, - // Flag indicating that additional debug checks are done. - NVG_DEBUG = 1<<2, -}; - -#if defined NANOVG_GL2_IMPLEMENTATION -# define NANOVG_GL2 1 -# define NANOVG_GL_IMPLEMENTATION 1 -# define EXT(name) name##GL2 -# define CONFIG_METHOD "configGL" -#elif defined NANOVG_GL3_IMPLEMENTATION -# define NANOVG_GL3 1 -# define NANOVG_GL_IMPLEMENTATION 1 -# define NANOVG_GL_USE_UNIFORMBUFFER 1 -# define EXT(name) name##GL3 -# define CONFIG_METHOD "configGL" -#elif defined NANOVG_GLES2_IMPLEMENTATION -# define NANOVG_GLES2 1 -# define NANOVG_GL_IMPLEMENTATION 1 -# define EXT(name) name##GLES2 -# define CONFIG_METHOD "configGLES" -#elif defined NANOVG_GLES3_IMPLEMENTATION -# define NANOVG_GLES3 1 -# define NANOVG_GL_IMPLEMENTATION 1 -# define EXT(name) name##GLES3 -# define CONFIG_METHOD "configGLES" -#endif - -#define NANOVG_GL_USE_STATE_FILTER (1) - -// Creates NanoVG contexts for different OpenGL (ES) versions. -// Flags should be combination of the create flags above. - -// These are additional flags on top of NVGimageFlags. -enum NVGimageFlagsGL { - NVG_IMAGE_NODELETE = 1<<16, // Do not delete GL texture handle. -}; - -#ifdef __cplusplus -} -#endif - -#endif /* NANOVG_GL_H */ - -#ifdef NANOVG_GL_IMPLEMENTATION - -#include -#include -#include -#include -#include "nanovg.h" -#include - -// ---------- LWJGL -------------- - -typedef void GLvoid; -typedef unsigned char GLboolean; -typedef char GLchar; -typedef int GLsizei; -typedef int GLint; -typedef unsigned int GLuint; -typedef unsigned int GLenum; -typedef float GLfloat; - -typedef ptrdiff_t GLsizeiptr; -typedef ptrdiff_t GLintptr; - -#define GL_ALWAYS 0x0207 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_BACK 0x0405 -#define GL_BLEND 0x0BE2 -#define GL_CCW 0x0901 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_COLOR 0x1800 -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_CULL_FACE 0x0B44 -#define GL_DECR 0x1E03 -#define GL_DECR_WRAP 0x8508 -#define GL_DEPTH 0x1801 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_DST_ALPHA 0x0304 -#define GL_DST_COLOR 0x0306 -#define GL_EQUAL 0x0202 -#define GL_FALSE 0 -#define GL_FLOAT 0x1406 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRONT 0x0404 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_INCR 0x1E02 -#define GL_INCR_WRAP 0x8507 -#define GL_INVALID_ENUM 0x0500 -#define GL_KEEP 0x1E00 -#define GL_LINE 0x1B01 -#define GL_LINEAR 0x2601 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_LINK_STATUS 0x8B82 -#define GL_LUMINANCE 0x1909 -#define GL_NEAREST 0x2600 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_NOTEQUAL 0x0205 -#define GL_NO_ERROR 0 -#define GL_ONE 1 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_R8 0x8229 -#define GL_RED 0x1903 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_REPEAT 0x2901 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_SRC_ALPHA 0x0302 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_SRC_COLOR 0x0300 -#define GL_STENCIL 0x1802 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_STENCIL_INDEX 0x1901 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STREAM_DRAW 0x88E0 -#define GL_TEXTURE 0x1702 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRUE 1 -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_ZERO 0 - -#ifndef APIENTRY - #ifdef _WIN32 - #define APIENTRY __stdcall - #else - #define APIENTRY - #endif -#endif -#define GLAPI - -typedef void (APIENTRY *glActiveTexturePROC) (GLenum texture); -typedef void (APIENTRY *glAttachShaderPROC) (GLuint program, GLuint shader); -typedef void (APIENTRY *glBindAttribLocationPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRY *glBindBufferPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRY *glBindBufferRangePROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (APIENTRY *glBindFramebufferPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRY *glBindRenderbufferPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRY *glBindTexturePROC) (GLenum target, GLuint texture); -typedef void (APIENTRY *glBindVertexArrayPROC) (GLuint array); -typedef void (APIENTRY *glBlendFuncPROC) (GLenum sfactor, GLenum dfactor); -typedef void (APIENTRY *glBlendFuncSeparatePROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRY *glBufferDataPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -typedef GLenum (APIENTRY *glCheckFramebufferStatusPROC) (GLenum target); -typedef void (APIENTRY *glColorMaskPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -typedef void (APIENTRY *glCompileShaderPROC) (GLuint shader); -typedef GLuint (APIENTRY *glCreateProgramPROC) (void); -typedef GLuint (APIENTRY *glCreateShaderPROC) (GLenum type); -typedef void (APIENTRY *glCullFacePROC) (GLenum mode); -typedef void (APIENTRY *glDeleteBuffersPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRY *glDeleteFramebuffersPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRY *glDeleteProgramPROC) (GLuint program); -typedef void (APIENTRY *glDeleteRenderbuffersPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRY *glDeleteShaderPROC) (GLuint shader); -typedef void (APIENTRY *glDeleteTexturesPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRY *glDeleteVertexArraysPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRY *glDetachShaderPROC) (GLuint program, GLuint shader); -typedef void (APIENTRY *glDisablePROC) (GLenum cap); -typedef void (APIENTRY *glDisableVertexAttribArrayPROC) (GLuint index); -typedef void (APIENTRY *glDrawArraysPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRY *glEnablePROC) (GLenum cap); -typedef void (APIENTRY *glEnableVertexAttribArrayPROC) (GLuint index); -typedef void (APIENTRY *glFinishPROC) (void); -typedef void (APIENTRY *glFlushPROC) (void); -typedef void (APIENTRY *glFramebufferRenderbufferPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRY *glFramebufferTexture2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRY *glFrontFacePROC) (GLenum mode); -typedef void (APIENTRY *glGenBuffersPROC) (GLsizei n, GLuint *buffers); -typedef void (APIENTRY *glGenFramebuffersPROC) (GLsizei n, GLuint *framebuffers); -typedef void (APIENTRY *glGenRenderbuffersPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRY *glGenTexturesPROC) (GLsizei n, GLuint *textures); -typedef void (APIENTRY *glGenVertexArraysPROC) (GLsizei n, GLuint *arrays); -typedef void (APIENTRY *glGenerateMipmapPROC) (GLenum target); -typedef GLenum (APIENTRY *glGetErrorPROC) (void); -typedef void (APIENTRY *glGetIntegervPROC) (GLenum pname, GLint *data); -typedef void (APIENTRY *glGetProgramivPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRY *glGetProgramInfoLogPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRY *glGetShaderivPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRY *glGetShaderInfoLogPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef GLuint (APIENTRY *glGetUniformBlockIndexPROC) (GLuint program, const GLchar *uniformBlockName); -typedef GLint (APIENTRY *glGetUniformLocationPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRY *glLinkProgramPROC) (GLuint program); -typedef void (APIENTRY *glPixelStoreiPROC) (GLenum pname, GLint param); -typedef void (APIENTRY *glRenderbufferStoragePROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRY *glShaderSourcePROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); -typedef void (APIENTRY *glStencilFuncPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (APIENTRY *glStencilMaskPROC) (GLuint mask); -typedef void (APIENTRY *glStencilOpPROC) (GLenum fail, GLenum zfail, GLenum zpass); -typedef void (APIENTRY *glStencilOpSeparatePROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRY *glTexImage2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRY *glTexParameteriPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRY *glTexSubImage2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRY *glUniform1iPROC) (GLint location, GLint v0); -typedef void (APIENTRY *glUniform2fvPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRY *glUniform4fvPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRY *glUniformBlockBindingPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -typedef void (APIENTRY *glUseProgramPROC) (GLuint program); -typedef void (APIENTRY *glVertexAttribPointerPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); - -#define glActiveTexture gl->ActiveTexture -#define glAttachShader gl->AttachShader -#define glBindAttribLocation gl->BindAttribLocation -#define glBindBuffer gl->BindBuffer -#define glBindBufferRange gl->BindBufferRange -#define glBindFramebuffer gl->BindFramebuffer -#define glBindRenderbuffer gl->BindRenderbuffer -#define glBindTexture gl->BindTexture -#define glBindVertexArray gl->BindVertexArray -#define glBlendFunc gl->BlendFunc -#define glBlendFuncSeparate gl->BlendFuncSeparate -#define glBufferData gl->BufferData -#define glCheckFramebufferStatus gl->CheckFramebufferStatus -#define glColorMask gl->ColorMask -#define glCompileShader gl->CompileShader -#define glCreateProgram gl->CreateProgram -#define glCreateShader gl->CreateShader -#define glCullFace gl->CullFace -#define glDeleteBuffers gl->DeleteBuffers -#define glDeleteFramebuffers gl->DeleteFramebuffers -#define glDeleteProgram gl->DeleteProgram -#define glDeleteRenderbuffers gl->DeleteRenderbuffers -#define glDeleteShader gl->DeleteShader -#define glDeleteTextures gl->DeleteTextures -#define glDeleteVertexArrays gl->DeleteVertexArrays -#define glDetachShader gl->DetachShader -#define glDisable gl->Disable -#define glDisableVertexAttribArray gl->DisableVertexAttribArray -#define glDrawArrays gl->DrawArrays -#define glEnable gl->Enable -#define glEnableVertexAttribArray gl->EnableVertexAttribArray -#define glFinish gl->Finish -#define glFlush gl->Flush -#define glFramebufferRenderbuffer gl->FramebufferRenderbuffer -#define glFramebufferTexture2D gl->FramebufferTexture2D -#define glFrontFace gl->FrontFace -#define glGenBuffers gl->GenBuffers -#define glGenFramebuffers gl->GenFramebuffers -#define glGenRenderbuffers gl->GenRenderbuffers -#define glGenTextures gl->GenTextures -#define glGenVertexArrays gl->GenVertexArrays -#define glGenerateMipmap gl->GenerateMipmap -#define glGetError gl->GetError -#define glGetIntegerv gl->GetIntegerv -#define glGetProgramiv gl->GetProgramiv -#define glGetProgramInfoLog gl->GetProgramInfoLog -#define glGetShaderiv gl->GetShaderiv -#define glGetShaderInfoLog gl->GetShaderInfoLog -#define glGetUniformBlockIndex gl->GetUniformBlockIndex -#define glGetUniformLocation gl->GetUniformLocation -#define glLinkProgram gl->LinkProgram -#define glPixelStorei gl->PixelStorei -#define glRenderbufferStorage gl->RenderbufferStorage -#define glShaderSource gl->ShaderSource -#define glStencilFunc gl->StencilFunc -#define glStencilMask gl->StencilMask -#define glStencilOp gl->StencilOp -#define glStencilOpSeparate gl->StencilOpSeparate -#define glTexImage2D gl->TexImage2D -#define glTexParameteri gl->TexParameteri -#define glTexSubImage2D gl->TexSubImage2D -#define glUniform1i gl->Uniform1i -#define glUniform2fv gl->Uniform2fv -#define glUniform4fv gl->Uniform4fv -#define glUniformBlockBinding gl->UniformBlockBinding -#define glUseProgram gl->UseProgram -#define glVertexAttribPointer gl->VertexAttribPointer - -// ---------- LWJGL -------------- - -enum GLNVGuniformLoc { - GLNVG_LOC_VIEWSIZE, - GLNVG_LOC_TEX, - GLNVG_LOC_FRAG, - GLNVG_MAX_LOCS -}; - -enum GLNVGshaderType { - NSVG_SHADER_FILLGRAD, - NSVG_SHADER_FILLIMG, - NSVG_SHADER_SIMPLE, - NSVG_SHADER_IMG -}; - -#if NANOVG_GL_USE_UNIFORMBUFFER -enum GLNVGuniformBindings { - GLNVG_FRAG_BINDING = 0, -}; -#endif - -struct GLNVGshader { - GLuint prog; - GLuint frag; - GLuint vert; - GLint loc[GLNVG_MAX_LOCS]; -}; -typedef struct GLNVGshader GLNVGshader; - -struct GLNVGtexture { - int id; - GLuint tex; - int width, height; - int type; - int flags; -}; -typedef struct GLNVGtexture GLNVGtexture; - -struct GLNVGblend -{ - GLenum srcRGB; - GLenum dstRGB; - GLenum srcAlpha; - GLenum dstAlpha; -}; -typedef struct GLNVGblend GLNVGblend; - -enum GLNVGcallType { - GLNVG_NONE = 0, - GLNVG_FILL, - GLNVG_CONVEXFILL, - GLNVG_STROKE, - GLNVG_TRIANGLES, -}; - -struct GLNVGcall { - int type; - int image; - int pathOffset; - int pathCount; - int triangleOffset; - int triangleCount; - int uniformOffset; - GLNVGblend blendFunc; -}; -typedef struct GLNVGcall GLNVGcall; - -struct GLNVGpath { - int fillOffset; - int fillCount; - int strokeOffset; - int strokeCount; -}; -typedef struct GLNVGpath GLNVGpath; - -struct GLNVGfragUniforms { - #if NANOVG_GL_USE_UNIFORMBUFFER - float scissorMat[12]; // matrices are actually 3 vec4s - float paintMat[12]; - struct NVGcolor innerCol; - struct NVGcolor outerCol; - float scissorExt[2]; - float scissorScale[2]; - float extent[2]; - float radius; - float feather; - float strokeMult; - float strokeThr; - int texType; - int type; - #else - // note: after modifying layout or size of uniform array, - // don't forget to also update the fragment shader source! - #define NANOVG_GL_UNIFORMARRAY_SIZE 11 - union { - struct { - float scissorMat[12]; // matrices are actually 3 vec4s - float paintMat[12]; - struct NVGcolor innerCol; - struct NVGcolor outerCol; - float scissorExt[2]; - float scissorScale[2]; - float extent[2]; - float radius; - float feather; - float strokeMult; - float strokeThr; - float texType; - float type; - }; - float uniformArray[NANOVG_GL_UNIFORMARRAY_SIZE][4]; - }; - #endif -}; -typedef struct GLNVGfragUniforms GLNVGfragUniforms; - -struct GLNVGcontext { - GLNVGshader shader; - GLNVGtexture* textures; - float view[2]; - int ntextures; - int ctextures; - int textureId; - GLuint vertBuf; -#if defined NANOVG_GL3 - GLuint vertArr; -#endif -#if NANOVG_GL_USE_UNIFORMBUFFER - GLuint fragBuf; -#endif - int fragSize; - int flags; - - // Per frame buffers - GLNVGcall* calls; - int ccalls; - int ncalls; - GLNVGpath* paths; - int cpaths; - int npaths; - struct NVGvertex* verts; - int cverts; - int nverts; - unsigned char* uniforms; - int cuniforms; - int nuniforms; - - // cached state - #if NANOVG_GL_USE_STATE_FILTER - GLuint boundTexture; - GLuint stencilMask; - GLenum stencilFunc; - GLint stencilFuncRef; - GLuint stencilFuncMask; - GLNVGblend blendFunc; - #endif - - int dummyTex; - - // Function pointers - glActiveTexturePROC ActiveTexture; - glAttachShaderPROC AttachShader; - glBindAttribLocationPROC BindAttribLocation; - glBindBufferPROC BindBuffer; - glBindBufferRangePROC BindBufferRange; - glBindFramebufferPROC BindFramebuffer; - glBindRenderbufferPROC BindRenderbuffer; - glBindTexturePROC BindTexture; - glBindVertexArrayPROC BindVertexArray; - glBlendFuncPROC BlendFunc; - glBlendFuncSeparatePROC BlendFuncSeparate; - glBufferDataPROC BufferData; - glCheckFramebufferStatusPROC CheckFramebufferStatus; - glColorMaskPROC ColorMask; - glCompileShaderPROC CompileShader; - glCreateProgramPROC CreateProgram; - glCreateShaderPROC CreateShader; - glCullFacePROC CullFace; - glDeleteBuffersPROC DeleteBuffers; - glDeleteFramebuffersPROC DeleteFramebuffers; - glDeleteProgramPROC DeleteProgram; - glDeleteRenderbuffersPROC DeleteRenderbuffers; - glDeleteShaderPROC DeleteShader; - glDeleteTexturesPROC DeleteTextures; - glDeleteVertexArraysPROC DeleteVertexArrays; - glDetachShaderPROC DetachShader; - glDisablePROC Disable; - glDisableVertexAttribArrayPROC DisableVertexAttribArray; - glDrawArraysPROC DrawArrays; - glEnablePROC Enable; - glEnableVertexAttribArrayPROC EnableVertexAttribArray; - glFinishPROC Finish; - glFlushPROC Flush; - glFramebufferRenderbufferPROC FramebufferRenderbuffer; - glFramebufferTexture2DPROC FramebufferTexture2D; - glFrontFacePROC FrontFace; - glGenBuffersPROC GenBuffers; - glGenFramebuffersPROC GenFramebuffers; - glGenRenderbuffersPROC GenRenderbuffers; - glGenTexturesPROC GenTextures; - glGenVertexArraysPROC GenVertexArrays; - glGenerateMipmapPROC GenerateMipmap; - glGetErrorPROC GetError; - glGetIntegervPROC GetIntegerv; - glGetProgramivPROC GetProgramiv; - glGetProgramInfoLogPROC GetProgramInfoLog; - glGetShaderivPROC GetShaderiv; - glGetShaderInfoLogPROC GetShaderInfoLog; - glGetUniformBlockIndexPROC GetUniformBlockIndex; - glGetUniformLocationPROC GetUniformLocation; - glLinkProgramPROC LinkProgram; - glPixelStoreiPROC PixelStorei; - glRenderbufferStoragePROC RenderbufferStorage; - glShaderSourcePROC ShaderSource; - glStencilFuncPROC StencilFunc; - glStencilMaskPROC StencilMask; - glStencilOpPROC StencilOp; - glStencilOpSeparatePROC StencilOpSeparate; - glTexImage2DPROC TexImage2D; - glTexParameteriPROC TexParameteri; - glTexSubImage2DPROC TexSubImage2D; - glUniform1iPROC Uniform1i; - glUniform2fvPROC Uniform2fv; - glUniform4fvPROC Uniform4fv; - glUniformBlockBindingPROC UniformBlockBinding; - glUseProgramPROC UseProgram; - glVertexAttribPointerPROC VertexAttribPointer; -}; -typedef struct GLNVGcontext GLNVGcontext; - -static int glnvg__maxi(int a, int b) { return a > b ? a : b; } - -#ifdef NANOVG_GLES2 -static unsigned int glnvg__nearestPow2(unsigned int num) -{ - unsigned n = num > 0 ? num - 1 : 0; - n |= n >> 1; - n |= n >> 2; - n |= n >> 4; - n |= n >> 8; - n |= n >> 16; - n++; - return n; -} -#endif - -static void glnvg__bindTexture(GLNVGcontext* gl, GLuint tex) -{ -#if NANOVG_GL_USE_STATE_FILTER - if (gl->boundTexture != tex) { - gl->boundTexture = tex; - glBindTexture(GL_TEXTURE_2D, tex); - } -#else - glBindTexture(GL_TEXTURE_2D, tex); -#endif -} - -static void glnvg__stencilMask(GLNVGcontext* gl, GLuint mask) -{ -#if NANOVG_GL_USE_STATE_FILTER - if (gl->stencilMask != mask) { - gl->stencilMask = mask; - glStencilMask(mask); - } -#else - glStencilMask(mask); -#endif -} - -static void glnvg__stencilFunc(GLNVGcontext* gl, GLenum func, GLint ref, GLuint mask) -{ -#if NANOVG_GL_USE_STATE_FILTER - if ((gl->stencilFunc != func) || - (gl->stencilFuncRef != ref) || - (gl->stencilFuncMask != mask)) { - - gl->stencilFunc = func; - gl->stencilFuncRef = ref; - gl->stencilFuncMask = mask; - glStencilFunc(func, ref, mask); - } -#else - glStencilFunc(func, ref, mask); -#endif -} -static void glnvg__blendFuncSeparate(GLNVGcontext* gl, const GLNVGblend* blend) -{ -#if NANOVG_GL_USE_STATE_FILTER - if ((gl->blendFunc.srcRGB != blend->srcRGB) || - (gl->blendFunc.dstRGB != blend->dstRGB) || - (gl->blendFunc.srcAlpha != blend->srcAlpha) || - (gl->blendFunc.dstAlpha != blend->dstAlpha)) { - - gl->blendFunc = *blend; - glBlendFuncSeparate(blend->srcRGB, blend->dstRGB, blend->srcAlpha,blend->dstAlpha); - } -#else - glBlendFuncSeparate(blend->srcRGB, blend->dstRGB, blend->srcAlpha,blend->dstAlpha); -#endif -} - -static GLNVGtexture* glnvg__allocTexture(GLNVGcontext* gl) -{ - GLNVGtexture* tex = NULL; - int i; - - for (i = 0; i < gl->ntextures; i++) { - if (gl->textures[i].id == 0) { - tex = &gl->textures[i]; - break; - } - } - if (tex == NULL) { - if (gl->ntextures+1 > gl->ctextures) { - GLNVGtexture* textures; - int ctextures = glnvg__maxi(gl->ntextures+1, 4) + gl->ctextures/2; // 1.5x Overallocate - textures = (GLNVGtexture*)NVG_REALLOC(gl->textures, sizeof(GLNVGtexture)*ctextures); - if (textures == NULL) return NULL; - gl->textures = textures; - gl->ctextures = ctextures; - } - tex = &gl->textures[gl->ntextures++]; - } - - memset(tex, 0, sizeof(*tex)); - tex->id = ++gl->textureId; - - return tex; -} - -static GLNVGtexture* glnvg__findTexture(GLNVGcontext* gl, int id) -{ - int i; - for (i = 0; i < gl->ntextures; i++) - if (gl->textures[i].id == id) - return &gl->textures[i]; - return NULL; -} - -static int glnvg__deleteTexture(GLNVGcontext* gl, int id) -{ - int i; - for (i = 0; i < gl->ntextures; i++) { - if (gl->textures[i].id == id) { - if (gl->textures[i].tex != 0 && (gl->textures[i].flags & NVG_IMAGE_NODELETE) == 0) - glDeleteTextures(1, &gl->textures[i].tex); - memset(&gl->textures[i], 0, sizeof(gl->textures[i])); - return 1; - } - } - return 0; -} - -static void glnvg__dumpShaderError(GLNVGcontext* gl, GLuint shader, const char* name, const char* type) -{ - GLchar str[512+1]; - GLsizei len = 0; - glGetShaderInfoLog(shader, 512, &len, str); - if (len > 512) len = 512; - str[len] = '\0'; - printf("Shader %s/%s error:\n%s\n", name, type, str); -} - -static void glnvg__dumpProgramError(GLNVGcontext* gl, GLuint prog, const char* name) -{ - GLchar str[512+1]; - GLsizei len = 0; - glGetProgramInfoLog(prog, 512, &len, str); - if (len > 512) len = 512; - str[len] = '\0'; - printf("Program %s error:\n%s\n", name, str); -} - -static void glnvg__checkError(GLNVGcontext* gl, const char* str) -{ - GLenum err; - if ((gl->flags & NVG_DEBUG) == 0) return; - err = glGetError(); - if (err != GL_NO_ERROR) { - printf("Error %08x after %s\n", err, str); - return; - } -} - -static int glnvg__createShader(GLNVGcontext* gl, GLNVGshader* shader, const char* name, const char* header, const char* opts, const char* vshader, const char* fshader) -{ - GLint status; - GLuint prog, vert, frag; - const char* str[3]; - str[0] = header; - str[1] = opts != NULL ? opts : ""; - - memset(shader, 0, sizeof(*shader)); - - prog = glCreateProgram(); - vert = glCreateShader(GL_VERTEX_SHADER); - frag = glCreateShader(GL_FRAGMENT_SHADER); - str[2] = vshader; - glShaderSource(vert, 3, str, 0); - str[2] = fshader; - glShaderSource(frag, 3, str, 0); - - glCompileShader(vert); - glGetShaderiv(vert, GL_COMPILE_STATUS, &status); - if (status != GL_TRUE) { - glnvg__dumpShaderError(gl, vert, name, "vert"); - return 0; - } - - glCompileShader(frag); - glGetShaderiv(frag, GL_COMPILE_STATUS, &status); - if (status != GL_TRUE) { - glnvg__dumpShaderError(gl, frag, name, "frag"); - return 0; - } - - glAttachShader(prog, vert); - glAttachShader(prog, frag); - - glBindAttribLocation(prog, 0, "vertex"); - glBindAttribLocation(prog, 1, "tcoord"); - - glLinkProgram(prog); - glGetProgramiv(prog, GL_LINK_STATUS, &status); - if (status != GL_TRUE) { - glnvg__dumpProgramError(gl, prog, name); - return 0; - } - - shader->prog = prog; - shader->vert = vert; - shader->frag = frag; - - return 1; -} - -static void glnvg__deleteShader(GLNVGcontext* gl, GLNVGshader* shader) -{ - if (shader->prog != 0) - glDeleteProgram(shader->prog); - if (shader->vert != 0) - glDeleteShader(shader->vert); - if (shader->frag != 0) - glDeleteShader(shader->frag); -} - -static void glnvg__getUniforms(GLNVGcontext* gl, GLNVGshader* shader) -{ - shader->loc[GLNVG_LOC_VIEWSIZE] = glGetUniformLocation(shader->prog, "viewSize"); - shader->loc[GLNVG_LOC_TEX] = glGetUniformLocation(shader->prog, "tex"); - -#if NANOVG_GL_USE_UNIFORMBUFFER - shader->loc[GLNVG_LOC_FRAG] = glGetUniformBlockIndex(shader->prog, "frag"); -#else - shader->loc[GLNVG_LOC_FRAG] = glGetUniformLocation(shader->prog, "frag"); -#endif -} - -static int glnvg__renderCreateTexture(void* uptr, int type, int w, int h, int imageFlags, const unsigned char* data); - -static int glnvg__renderCreate(void* uptr) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - int align = 4; - - // TODO: mediump float may not be enough for GLES2 in iOS. - // see the following discussion: https://github.com/memononen/nanovg/issues/46 - static const char* shaderHeader = -#if defined NANOVG_GL2 - "#define NANOVG_GL2 1\n" -#elif defined NANOVG_GL3 - "#version 150 core\n" - "#define NANOVG_GL3 1\n" -#elif defined NANOVG_GLES2 - "#version 100\n" - "#define NANOVG_GL2 1\n" -#elif defined NANOVG_GLES3 - "#version 300 es\n" - "#define NANOVG_GL3 1\n" -#endif - -#if NANOVG_GL_USE_UNIFORMBUFFER - "#define USE_UNIFORMBUFFER 1\n" -#else - "#define UNIFORMARRAY_SIZE 11\n" -#endif - "\n"; - - static const char* fillVertShader = - "#ifdef NANOVG_GL3\n" - " uniform vec2 viewSize;\n" - " in vec2 vertex;\n" - " in vec2 tcoord;\n" - " out vec2 ftcoord;\n" - " out vec2 fpos;\n" - "#else\n" - " uniform vec2 viewSize;\n" - " attribute vec2 vertex;\n" - " attribute vec2 tcoord;\n" - " varying vec2 ftcoord;\n" - " varying vec2 fpos;\n" - "#endif\n" - "void main(void) {\n" - " ftcoord = tcoord;\n" - " fpos = vertex;\n" - " gl_Position = vec4(2.0*vertex.x/viewSize.x - 1.0, 1.0 - 2.0*vertex.y/viewSize.y, 0, 1);\n" - "}\n"; - - static const char* fillFragShader = - "#ifdef GL_ES\n" - "#if defined(GL_FRAGMENT_PRECISION_HIGH) || defined(NANOVG_GL3)\n" - " precision highp float;\n" - "#else\n" - " precision mediump float;\n" - "#endif\n" - "#endif\n" - "#ifdef NANOVG_GL3\n" - "#ifdef USE_UNIFORMBUFFER\n" - " layout(std140) uniform frag {\n" - " mat3 scissorMat;\n" - " mat3 paintMat;\n" - " vec4 innerCol;\n" - " vec4 outerCol;\n" - " vec2 scissorExt;\n" - " vec2 scissorScale;\n" - " vec2 extent;\n" - " float radius;\n" - " float feather;\n" - " float strokeMult;\n" - " float strokeThr;\n" - " int texType;\n" - " int type;\n" - " };\n" - "#else\n" // NANOVG_GL3 && !USE_UNIFORMBUFFER - " uniform vec4 frag[UNIFORMARRAY_SIZE];\n" - "#endif\n" - " uniform sampler2D tex;\n" - " in vec2 ftcoord;\n" - " in vec2 fpos;\n" - " out vec4 outColor;\n" - "#else\n" // !NANOVG_GL3 - " uniform vec4 frag[UNIFORMARRAY_SIZE];\n" - " uniform sampler2D tex;\n" - " varying vec2 ftcoord;\n" - " varying vec2 fpos;\n" - "#endif\n" - "#ifndef USE_UNIFORMBUFFER\n" - " #define scissorMat mat3(frag[0].xyz, frag[1].xyz, frag[2].xyz)\n" - " #define paintMat mat3(frag[3].xyz, frag[4].xyz, frag[5].xyz)\n" - " #define innerCol frag[6]\n" - " #define outerCol frag[7]\n" - " #define scissorExt frag[8].xy\n" - " #define scissorScale frag[8].zw\n" - " #define extent frag[9].xy\n" - " #define radius frag[9].z\n" - " #define feather frag[9].w\n" - " #define strokeMult frag[10].x\n" - " #define strokeThr frag[10].y\n" - " #define texType int(frag[10].z)\n" - " #define type int(frag[10].w)\n" - "#endif\n" - "\n" - "float sdroundrect(vec2 pt, vec2 ext, float rad) {\n" - " vec2 ext2 = ext - vec2(rad,rad);\n" - " vec2 d = abs(pt) - ext2;\n" - " return min(max(d.x,d.y),0.0) + length(max(d,0.0)) - rad;\n" - "}\n" - "\n" - "// Scissoring\n" - "float scissorMask(vec2 p) {\n" - " vec2 sc = (abs((scissorMat * vec3(p,1.0)).xy) - scissorExt);\n" - " sc = vec2(0.5,0.5) - sc * scissorScale;\n" - " return clamp(sc.x,0.0,1.0) * clamp(sc.y,0.0,1.0);\n" - "}\n" - "#ifdef EDGE_AA\n" - "// Stroke - from [0..1] to clipped pyramid, where the slope is 1px.\n" - "float strokeMask() {\n" - " return min(1.0, (1.0-abs(ftcoord.x*2.0-1.0))*strokeMult) * min(1.0, ftcoord.y);\n" - "}\n" - "#endif\n" - "\n" - "void main(void) {\n" - " vec4 result;\n" - " float scissor = scissorMask(fpos);\n" - "#ifdef EDGE_AA\n" - " float strokeAlpha = strokeMask();\n" - "#else\n" - " float strokeAlpha = 1.0;\n" - "#endif\n" - " if (type == 0) { // Gradient\n" - " // Calculate gradient color using box gradient\n" - " vec2 pt = (paintMat * vec3(fpos,1.0)).xy;\n" - " float d = clamp((sdroundrect(pt, extent, radius) + feather*0.5) / feather, 0.0, 1.0);\n" - " vec4 color = mix(innerCol,outerCol,d);\n" - " // Combine alpha\n" - " color *= strokeAlpha * scissor;\n" - " result = color;\n" - " } else if (type == 1) { // Image\n" - " // Calculate color fron texture\n" - " vec2 pt = (paintMat * vec3(fpos,1.0)).xy / extent;\n" - "#ifdef NANOVG_GL3\n" - " vec4 color = texture(tex, pt);\n" - "#else\n" - " vec4 color = texture2D(tex, pt);\n" - "#endif\n" - " if (texType == 1) color = vec4(color.xyz*color.w,color.w);" - " if (texType == 2) color = vec4(color.x);" - " // Apply color tint and alpha.\n" - " color *= innerCol;\n" - " // Combine alpha\n" - " color *= strokeAlpha * scissor;\n" - " result = color;\n" - " } else if (type == 2) { // Stencil fill\n" - " result = vec4(1,1,1,1);\n" - " } else if (type == 3) { // Textured tris\n" - "#ifdef NANOVG_GL3\n" - " vec4 color = texture(tex, ftcoord);\n" - "#else\n" - " vec4 color = texture2D(tex, ftcoord);\n" - "#endif\n" - " if (texType == 1) color = vec4(color.xyz*color.w,color.w);" - " if (texType == 2) color = vec4(color.x);" - " color *= scissor;\n" - " result = color * innerCol;\n" - " }\n" - "#ifdef EDGE_AA\n" - "#ifdef STENCIL_STROKES\n" - " if (strokeAlpha < strokeThr) discard;\n" - "#else\n" - " if (strokeAlpha < strokeThr) result.a = 0.0;\n" - "#endif\n" - "#endif\n" - "#ifdef NANOVG_GL3\n" - " outColor = result;\n" - "#else\n" - " gl_FragColor = result;\n" - "#endif\n" - "}\n"; - - glnvg__checkError(gl, "init"); - - char* opts = NULL; - if (gl->flags & NVG_ANTIALIAS) { - if (gl->flags & NVG_STENCIL_STROKES) - opts = "#define EDGE_AA 1\n#define STENCIL_STROKES 1\n"; - else - opts = "#define EDGE_AA 1\n"; - } - if (glnvg__createShader(gl, &gl->shader, "shader", shaderHeader, opts, fillVertShader, fillFragShader) == 0) - return 0; - - glnvg__checkError(gl, "uniform locations"); - glnvg__getUniforms(gl, &gl->shader); - - // Create dynamic vertex array -#if defined NANOVG_GL3 - glGenVertexArrays(1, &gl->vertArr); -#endif - glGenBuffers(1, &gl->vertBuf); - -#if NANOVG_GL_USE_UNIFORMBUFFER - // Create UBOs - glUniformBlockBinding(gl->shader.prog, gl->shader.loc[GLNVG_LOC_FRAG], GLNVG_FRAG_BINDING); - glGenBuffers(1, &gl->fragBuf); - glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &align); -#endif - gl->fragSize = sizeof(GLNVGfragUniforms) + align - sizeof(GLNVGfragUniforms) % align; - - // Some platforms does not allow to have samples to unset textures. - // Create empty one which is bound when there's no texture specified. - gl->dummyTex = glnvg__renderCreateTexture(gl, NVG_TEXTURE_ALPHA, 1, 1, 0, NULL); - - glnvg__checkError(gl, "create done"); - - glFinish(); - - return 1; -} - -static int glnvg__renderCreateTexture(void* uptr, int type, int w, int h, int imageFlags, const unsigned char* data) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - GLNVGtexture* tex = glnvg__allocTexture(gl); - - if (tex == NULL) return 0; - -#ifdef NANOVG_GLES2 - // Check for non-power of 2. - if (glnvg__nearestPow2(w) != (unsigned int)w || glnvg__nearestPow2(h) != (unsigned int)h) { - // No repeat - if ((imageFlags & NVG_IMAGE_REPEATX) != 0 || (imageFlags & NVG_IMAGE_REPEATY) != 0) { - printf("Repeat X/Y is not supported for non power-of-two textures (%d x %d)\n", w, h); - imageFlags &= ~(NVG_IMAGE_REPEATX | NVG_IMAGE_REPEATY); - } - // No mips. - if (imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) { - printf("Mip-maps is not support for non power-of-two textures (%d x %d)\n", w, h); - imageFlags &= ~NVG_IMAGE_GENERATE_MIPMAPS; - } - } -#endif - - glGenTextures(1, &tex->tex); - tex->width = w; - tex->height = h; - tex->type = type; - tex->flags = imageFlags; - glnvg__bindTexture(gl, tex->tex); - - glPixelStorei(GL_UNPACK_ALIGNMENT,1); -#ifndef NANOVG_GLES2 - glPixelStorei(GL_UNPACK_ROW_LENGTH, tex->width); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); -#endif - -#if defined (NANOVG_GL2) - // GL 1.4 and later has support for generating mipmaps using a tex parameter. - if (imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) { - glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); - } -#endif - - if (type == NVG_TEXTURE_RGBA) - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); - else -#if defined(NANOVG_GLES2) || defined (NANOVG_GL2) - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, w, h, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, data); -#elif defined(NANOVG_GLES3) - glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, w, h, 0, GL_RED, GL_UNSIGNED_BYTE, data); -#else - glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, w, h, 0, GL_RED, GL_UNSIGNED_BYTE, data); -#endif - - if (imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) { - if (imageFlags & NVG_IMAGE_NEAREST) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - } - } else { - if (imageFlags & NVG_IMAGE_NEAREST) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - } - } - - if (imageFlags & NVG_IMAGE_NEAREST) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - - if (imageFlags & NVG_IMAGE_REPEATX) - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - else - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - - if (imageFlags & NVG_IMAGE_REPEATY) - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - else - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); -#ifndef NANOVG_GLES2 - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); -#endif - - // The new way to build mipmaps on GLES and GL3 -#if !defined(NANOVG_GL2) - if (imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) { - glGenerateMipmap(GL_TEXTURE_2D); - } -#endif - - glnvg__checkError(gl, "create tex"); - glnvg__bindTexture(gl, 0); - - return tex->id; -} - - -static int glnvg__renderDeleteTexture(void* uptr, int image) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - return glnvg__deleteTexture(gl, image); -} - -static int glnvg__renderUpdateTexture(void* uptr, int image, int x, int y, int w, int h, const unsigned char* data) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - GLNVGtexture* tex = glnvg__findTexture(gl, image); - - if (tex == NULL) return 0; - glnvg__bindTexture(gl, tex->tex); - - glPixelStorei(GL_UNPACK_ALIGNMENT,1); - -#ifndef NANOVG_GLES2 - glPixelStorei(GL_UNPACK_ROW_LENGTH, tex->width); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, x); - glPixelStorei(GL_UNPACK_SKIP_ROWS, y); -#else - // No support for all of skip, need to update a whole row at a time. - if (tex->type == NVG_TEXTURE_RGBA) - data += y*tex->width*4; - else - data += y*tex->width; - x = 0; - w = tex->width; -#endif - - if (tex->type == NVG_TEXTURE_RGBA) - glTexSubImage2D(GL_TEXTURE_2D, 0, x,y, w,h, GL_RGBA, GL_UNSIGNED_BYTE, data); - else -#if defined(NANOVG_GLES2) || defined(NANOVG_GL2) - glTexSubImage2D(GL_TEXTURE_2D, 0, x,y, w,h, GL_LUMINANCE, GL_UNSIGNED_BYTE, data); -#else - glTexSubImage2D(GL_TEXTURE_2D, 0, x,y, w,h, GL_RED, GL_UNSIGNED_BYTE, data); -#endif - - glPixelStorei(GL_UNPACK_ALIGNMENT, 4); -#ifndef NANOVG_GLES2 - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); -#endif - - glnvg__bindTexture(gl, 0); - - return 1; -} - -static int glnvg__renderGetTextureSize(void* uptr, int image, int* w, int* h) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - GLNVGtexture* tex = glnvg__findTexture(gl, image); - if (tex == NULL) return 0; - *w = tex->width; - *h = tex->height; - return 1; -} - -static void glnvg__xformToMat3x4(float* m3, float* t) -{ - m3[0] = t[0]; - m3[1] = t[1]; - m3[2] = 0.0f; - m3[3] = 0.0f; - m3[4] = t[2]; - m3[5] = t[3]; - m3[6] = 0.0f; - m3[7] = 0.0f; - m3[8] = t[4]; - m3[9] = t[5]; - m3[10] = 1.0f; - m3[11] = 0.0f; -} - -static NVGcolor glnvg__premulColor(NVGcolor c) -{ - c.r *= c.a; - c.g *= c.a; - c.b *= c.a; - return c; -} - -static int glnvg__convertPaint(GLNVGcontext* gl, GLNVGfragUniforms* frag, NVGpaint* paint, - NVGscissor* scissor, float width, float fringe, float strokeThr) -{ - GLNVGtexture* tex = NULL; - float invxform[6]; - - memset(frag, 0, sizeof(*frag)); - - frag->innerCol = glnvg__premulColor(paint->innerColor); - frag->outerCol = glnvg__premulColor(paint->outerColor); - - if (scissor->extent[0] < -0.5f || scissor->extent[1] < -0.5f) { - memset(frag->scissorMat, 0, sizeof(frag->scissorMat)); - frag->scissorExt[0] = 1.0f; - frag->scissorExt[1] = 1.0f; - frag->scissorScale[0] = 1.0f; - frag->scissorScale[1] = 1.0f; - } else { - nvgTransformInverse(invxform, scissor->xform); - glnvg__xformToMat3x4(frag->scissorMat, invxform); - frag->scissorExt[0] = scissor->extent[0]; - frag->scissorExt[1] = scissor->extent[1]; - frag->scissorScale[0] = sqrtf(scissor->xform[0]*scissor->xform[0] + scissor->xform[2]*scissor->xform[2]) / fringe; - frag->scissorScale[1] = sqrtf(scissor->xform[1]*scissor->xform[1] + scissor->xform[3]*scissor->xform[3]) / fringe; - } - - memcpy(frag->extent, paint->extent, sizeof(frag->extent)); - frag->strokeMult = (width*0.5f + fringe*0.5f) / fringe; - frag->strokeThr = strokeThr; - - if (paint->image != 0) { - tex = glnvg__findTexture(gl, paint->image); - if (tex == NULL) return 0; - if ((tex->flags & NVG_IMAGE_FLIPY) != 0) { - float m1[6], m2[6]; - nvgTransformTranslate(m1, 0.0f, frag->extent[1] * 0.5f); - nvgTransformMultiply(m1, paint->xform); - nvgTransformScale(m2, 1.0f, -1.0f); - nvgTransformMultiply(m2, m1); - nvgTransformTranslate(m1, 0.0f, -frag->extent[1] * 0.5f); - nvgTransformMultiply(m1, m2); - nvgTransformInverse(invxform, m1); - } else { - nvgTransformInverse(invxform, paint->xform); - } - frag->type = NSVG_SHADER_FILLIMG; - - #if NANOVG_GL_USE_UNIFORMBUFFER - if (tex->type == NVG_TEXTURE_RGBA) - frag->texType = (tex->flags & NVG_IMAGE_PREMULTIPLIED) ? 0 : 1; - else - frag->texType = 2; - #else - if (tex->type == NVG_TEXTURE_RGBA) - frag->texType = (tex->flags & NVG_IMAGE_PREMULTIPLIED) ? 0.0f : 1.0f; - else - frag->texType = 2.0f; - #endif -// printf("frag->texType = %d\n", frag->texType); - } else { - frag->type = NSVG_SHADER_FILLGRAD; - frag->radius = paint->radius; - frag->feather = paint->feather; - nvgTransformInverse(invxform, paint->xform); - } - - glnvg__xformToMat3x4(frag->paintMat, invxform); - - return 1; -} - -static GLNVGfragUniforms* nvg__fragUniformPtr(GLNVGcontext* gl, int i); - -static void glnvg__setUniforms(GLNVGcontext* gl, int uniformOffset, int image) -{ - GLNVGtexture* tex = NULL; -#if NANOVG_GL_USE_UNIFORMBUFFER - glBindBufferRange(GL_UNIFORM_BUFFER, GLNVG_FRAG_BINDING, gl->fragBuf, uniformOffset, sizeof(GLNVGfragUniforms)); -#else - GLNVGfragUniforms* frag = nvg__fragUniformPtr(gl, uniformOffset); - glUniform4fv(gl->shader.loc[GLNVG_LOC_FRAG], NANOVG_GL_UNIFORMARRAY_SIZE, &(frag->uniformArray[0][0])); -#endif - - if (image != 0) { - tex = glnvg__findTexture(gl, image); - } - // If no image is set, use empty texture - if (tex == NULL) { - tex = glnvg__findTexture(gl, gl->dummyTex); - } - glnvg__bindTexture(gl, tex != NULL ? tex->tex : 0); - glnvg__checkError(gl, "tex paint tex"); -} - -static void glnvg__renderViewport(void* uptr, float width, float height, float devicePixelRatio) -{ - NVG_NOTUSED(devicePixelRatio); - GLNVGcontext* gl = (GLNVGcontext*)uptr; - gl->view[0] = width; - gl->view[1] = height; -} - -static void glnvg__fill(GLNVGcontext* gl, GLNVGcall* call) -{ - GLNVGpath* paths = &gl->paths[call->pathOffset]; - int i, npaths = call->pathCount; - - // Draw shapes - glEnable(GL_STENCIL_TEST); - glnvg__stencilMask(gl, 0xff); - glnvg__stencilFunc(gl, GL_ALWAYS, 0, 0xff); - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - - // set bindpoint for solid loc - glnvg__setUniforms(gl, call->uniformOffset, 0); - glnvg__checkError(gl, "fill simple"); - - glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_INCR_WRAP); - glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_DECR_WRAP); - glDisable(GL_CULL_FACE); - for (i = 0; i < npaths; i++) - glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount); - glEnable(GL_CULL_FACE); - - // Draw anti-aliased pixels - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - - glnvg__setUniforms(gl, call->uniformOffset + gl->fragSize, call->image); - glnvg__checkError(gl, "fill fill"); - - if (gl->flags & NVG_ANTIALIAS) { - glnvg__stencilFunc(gl, GL_EQUAL, 0x00, 0xff); - glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); - // Draw fringes - for (i = 0; i < npaths; i++) - glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount); - } - - // Draw fill - glnvg__stencilFunc(gl, GL_NOTEQUAL, 0x0, 0xff); - glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO); - glDrawArrays(GL_TRIANGLE_STRIP, call->triangleOffset, call->triangleCount); - - glDisable(GL_STENCIL_TEST); -} - -static void glnvg__convexFill(GLNVGcontext* gl, GLNVGcall* call) -{ - GLNVGpath* paths = &gl->paths[call->pathOffset]; - int i, npaths = call->pathCount; - - glnvg__setUniforms(gl, call->uniformOffset, call->image); - glnvg__checkError(gl, "convex fill"); - - for (i = 0; i < npaths; i++) { - glDrawArrays(GL_TRIANGLE_FAN, paths[i].fillOffset, paths[i].fillCount); - // Draw fringes - if (paths[i].strokeCount > 0) { - glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount); - } - } -} - -static void glnvg__stroke(GLNVGcontext* gl, GLNVGcall* call) -{ - GLNVGpath* paths = &gl->paths[call->pathOffset]; - int npaths = call->pathCount, i; - - if (gl->flags & NVG_STENCIL_STROKES) { - - glEnable(GL_STENCIL_TEST); - glnvg__stencilMask(gl, 0xff); - - // Fill the stroke base without overlap - glnvg__stencilFunc(gl, GL_EQUAL, 0x0, 0xff); - glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); - glnvg__setUniforms(gl, call->uniformOffset + gl->fragSize, call->image); - glnvg__checkError(gl, "stroke fill 0"); - for (i = 0; i < npaths; i++) - glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount); - - // Draw anti-aliased pixels. - glnvg__setUniforms(gl, call->uniformOffset, call->image); - glnvg__stencilFunc(gl, GL_EQUAL, 0x00, 0xff); - glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); - for (i = 0; i < npaths; i++) - glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount); - - // Clear stencil buffer. - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - glnvg__stencilFunc(gl, GL_ALWAYS, 0x0, 0xff); - glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO); - glnvg__checkError(gl, "stroke fill 1"); - for (i = 0; i < npaths; i++) - glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - - glDisable(GL_STENCIL_TEST); - -// glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset + gl->fragSize), paint, scissor, strokeWidth, fringe, 1.0f - 0.5f/255.0f); - - } else { - glnvg__setUniforms(gl, call->uniformOffset, call->image); - glnvg__checkError(gl, "stroke fill"); - // Draw Strokes - for (i = 0; i < npaths; i++) - glDrawArrays(GL_TRIANGLE_STRIP, paths[i].strokeOffset, paths[i].strokeCount); - } -} - -static void glnvg__triangles(GLNVGcontext* gl, GLNVGcall* call) -{ - glnvg__setUniforms(gl, call->uniformOffset, call->image); - glnvg__checkError(gl, "triangles fill"); - - glDrawArrays(GL_TRIANGLES, call->triangleOffset, call->triangleCount); -} - -static void glnvg__renderCancel(void* uptr) { - GLNVGcontext* gl = (GLNVGcontext*)uptr; - gl->nverts = 0; - gl->npaths = 0; - gl->ncalls = 0; - gl->nuniforms = 0; -} - -static GLenum glnvg_convertBlendFuncFactor(int factor) -{ - if (factor == NVG_ZERO) - return GL_ZERO; - if (factor == NVG_ONE) - return GL_ONE; - if (factor == NVG_SRC_COLOR) - return GL_SRC_COLOR; - if (factor == NVG_ONE_MINUS_SRC_COLOR) - return GL_ONE_MINUS_SRC_COLOR; - if (factor == NVG_DST_COLOR) - return GL_DST_COLOR; - if (factor == NVG_ONE_MINUS_DST_COLOR) - return GL_ONE_MINUS_DST_COLOR; - if (factor == NVG_SRC_ALPHA) - return GL_SRC_ALPHA; - if (factor == NVG_ONE_MINUS_SRC_ALPHA) - return GL_ONE_MINUS_SRC_ALPHA; - if (factor == NVG_DST_ALPHA) - return GL_DST_ALPHA; - if (factor == NVG_ONE_MINUS_DST_ALPHA) - return GL_ONE_MINUS_DST_ALPHA; - if (factor == NVG_SRC_ALPHA_SATURATE) - return GL_SRC_ALPHA_SATURATE; - return GL_INVALID_ENUM; -} - -static GLNVGblend glnvg__blendCompositeOperation(NVGcompositeOperationState op) -{ - GLNVGblend blend; - blend.srcRGB = glnvg_convertBlendFuncFactor(op.srcRGB); - blend.dstRGB = glnvg_convertBlendFuncFactor(op.dstRGB); - blend.srcAlpha = glnvg_convertBlendFuncFactor(op.srcAlpha); - blend.dstAlpha = glnvg_convertBlendFuncFactor(op.dstAlpha); - if (blend.srcRGB == GL_INVALID_ENUM || blend.dstRGB == GL_INVALID_ENUM || blend.srcAlpha == GL_INVALID_ENUM || blend.dstAlpha == GL_INVALID_ENUM) - { - blend.srcRGB = GL_ONE; - blend.dstRGB = GL_ONE_MINUS_SRC_ALPHA; - blend.srcAlpha = GL_ONE; - blend.dstAlpha = GL_ONE_MINUS_SRC_ALPHA; - } - return blend; -} - -static void glnvg__renderFlush(void* uptr) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - int i; - - if (gl->ncalls > 0) { - - // Setup require GL state. - glUseProgram(gl->shader.prog); - - glEnable(GL_CULL_FACE); - glCullFace(GL_BACK); - glFrontFace(GL_CCW); - glEnable(GL_BLEND); - glDisable(GL_DEPTH_TEST); - glDisable(GL_SCISSOR_TEST); - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glStencilMask(0xffffffff); - glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); - glStencilFunc(GL_ALWAYS, 0, 0xffffffff); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, 0); - #if NANOVG_GL_USE_STATE_FILTER - gl->boundTexture = 0; - gl->stencilMask = 0xffffffff; - gl->stencilFunc = GL_ALWAYS; - gl->stencilFuncRef = 0; - gl->stencilFuncMask = 0xffffffff; - gl->blendFunc.srcRGB = GL_INVALID_ENUM; - gl->blendFunc.srcAlpha = GL_INVALID_ENUM; - gl->blendFunc.dstRGB = GL_INVALID_ENUM; - gl->blendFunc.dstAlpha = GL_INVALID_ENUM; - #endif - -#if NANOVG_GL_USE_UNIFORMBUFFER - // Upload ubo for frag shaders - glBindBuffer(GL_UNIFORM_BUFFER, gl->fragBuf); - glBufferData(GL_UNIFORM_BUFFER, gl->nuniforms * gl->fragSize, gl->uniforms, GL_STREAM_DRAW); -#endif - - // Upload vertex data -#if defined NANOVG_GL3 - glBindVertexArray(gl->vertArr); -#endif - glBindBuffer(GL_ARRAY_BUFFER, gl->vertBuf); - glBufferData(GL_ARRAY_BUFFER, gl->nverts * sizeof(NVGvertex), gl->verts, GL_STREAM_DRAW); - glEnableVertexAttribArray(0); - glEnableVertexAttribArray(1); - glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(NVGvertex), (const GLvoid*)(size_t)0); - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(NVGvertex), (const GLvoid*)(0 + 2*sizeof(float))); - - // Set view and texture just once per frame. - glUniform1i(gl->shader.loc[GLNVG_LOC_TEX], 0); - glUniform2fv(gl->shader.loc[GLNVG_LOC_VIEWSIZE], 1, gl->view); - -#if NANOVG_GL_USE_UNIFORMBUFFER - glBindBuffer(GL_UNIFORM_BUFFER, gl->fragBuf); -#endif - - for (i = 0; i < gl->ncalls; i++) { - GLNVGcall* call = &gl->calls[i]; - glnvg__blendFuncSeparate(gl,&call->blendFunc); - if (call->type == GLNVG_FILL) - glnvg__fill(gl, call); - else if (call->type == GLNVG_CONVEXFILL) - glnvg__convexFill(gl, call); - else if (call->type == GLNVG_STROKE) - glnvg__stroke(gl, call); - else if (call->type == GLNVG_TRIANGLES) - glnvg__triangles(gl, call); - } - - glDisableVertexAttribArray(0); - glDisableVertexAttribArray(1); -#if defined NANOVG_GL3 - glBindVertexArray(0); -#endif - glDisable(GL_CULL_FACE); - glBindBuffer(GL_ARRAY_BUFFER, 0); - glUseProgram(0); - glnvg__bindTexture(gl, 0); - } - - // Reset calls - gl->nverts = 0; - gl->npaths = 0; - gl->ncalls = 0; - gl->nuniforms = 0; -} - -static int glnvg__maxVertCount(const NVGpath* paths, int npaths) -{ - int i, count = 0; - for (i = 0; i < npaths; i++) { - count += paths[i].nfill; - count += paths[i].nstroke; - } - return count; -} - -static GLNVGcall* glnvg__allocCall(GLNVGcontext* gl) -{ - GLNVGcall* ret = NULL; - if (gl->ncalls+1 > gl->ccalls) { - GLNVGcall* calls; - int ccalls = glnvg__maxi(gl->ncalls+1, 128) + gl->ccalls/2; // 1.5x Overallocate - calls = (GLNVGcall*)NVG_REALLOC(gl->calls, sizeof(GLNVGcall) * ccalls); - if (calls == NULL) return NULL; - gl->calls = calls; - gl->ccalls = ccalls; - } - ret = &gl->calls[gl->ncalls++]; - memset(ret, 0, sizeof(GLNVGcall)); - return ret; -} - -static int glnvg__allocPaths(GLNVGcontext* gl, int n) -{ - int ret = 0; - if (gl->npaths+n > gl->cpaths) { - GLNVGpath* paths; - int cpaths = glnvg__maxi(gl->npaths + n, 128) + gl->cpaths/2; // 1.5x Overallocate - paths = (GLNVGpath*)NVG_REALLOC(gl->paths, sizeof(GLNVGpath) * cpaths); - if (paths == NULL) return -1; - gl->paths = paths; - gl->cpaths = cpaths; - } - ret = gl->npaths; - gl->npaths += n; - return ret; -} - -static int glnvg__allocVerts(GLNVGcontext* gl, int n) -{ - int ret = 0; - if (gl->nverts+n > gl->cverts) { - NVGvertex* verts; - int cverts = glnvg__maxi(gl->nverts + n, 4096) + gl->cverts/2; // 1.5x Overallocate - verts = (NVGvertex*)NVG_REALLOC(gl->verts, sizeof(NVGvertex) * cverts); - if (verts == NULL) return -1; - gl->verts = verts; - gl->cverts = cverts; - } - ret = gl->nverts; - gl->nverts += n; - return ret; -} - -static int glnvg__allocFragUniforms(GLNVGcontext* gl, int n) -{ - int ret = 0, structSize = gl->fragSize; - if (gl->nuniforms+n > gl->cuniforms) { - unsigned char* uniforms; - int cuniforms = glnvg__maxi(gl->nuniforms+n, 128) + gl->cuniforms/2; // 1.5x Overallocate - uniforms = (unsigned char*)NVG_REALLOC(gl->uniforms, structSize * cuniforms); - if (uniforms == NULL) return -1; - gl->uniforms = uniforms; - gl->cuniforms = cuniforms; - } - ret = gl->nuniforms * structSize; - gl->nuniforms += n; - return ret; -} - -static GLNVGfragUniforms* nvg__fragUniformPtr(GLNVGcontext* gl, int i) -{ - return (GLNVGfragUniforms*)&gl->uniforms[i]; -} - -static void glnvg__vset(NVGvertex* vtx, float x, float y, float u, float v) -{ - vtx->x = x; - vtx->y = y; - vtx->u = u; - vtx->v = v; -} - -static void glnvg__renderFill(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, - const float* bounds, const NVGpath* paths, int npaths) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - GLNVGcall* call = glnvg__allocCall(gl); - NVGvertex* quad; - GLNVGfragUniforms* frag; - int i, maxverts, offset; - - if (call == NULL) return; - - call->type = GLNVG_FILL; - call->triangleCount = 4; - call->pathOffset = glnvg__allocPaths(gl, npaths); - if (call->pathOffset == -1) goto error; - call->pathCount = npaths; - call->image = paint->image; - call->blendFunc = glnvg__blendCompositeOperation(compositeOperation); - - if (npaths == 1 && paths[0].convex) - { - call->type = GLNVG_CONVEXFILL; - call->triangleCount = 0; // Bounding box fill quad not needed for convex fill - } - - // Allocate vertices for all the paths. - maxverts = glnvg__maxVertCount(paths, npaths) + call->triangleCount; - offset = glnvg__allocVerts(gl, maxverts); - if (offset == -1) goto error; - - for (i = 0; i < npaths; i++) { - GLNVGpath* copy = &gl->paths[call->pathOffset + i]; - const NVGpath* path = &paths[i]; - memset(copy, 0, sizeof(GLNVGpath)); - if (path->nfill > 0) { - copy->fillOffset = offset; - copy->fillCount = path->nfill; - memcpy(&gl->verts[offset], path->fill, sizeof(NVGvertex) * path->nfill); - offset += path->nfill; - } - if (path->nstroke > 0) { - copy->strokeOffset = offset; - copy->strokeCount = path->nstroke; - memcpy(&gl->verts[offset], path->stroke, sizeof(NVGvertex) * path->nstroke); - offset += path->nstroke; - } - } - - // Setup uniforms for draw calls - if (call->type == GLNVG_FILL) { - // Quad - call->triangleOffset = offset; - quad = &gl->verts[call->triangleOffset]; - glnvg__vset(&quad[0], bounds[2], bounds[3], 0.5f, 1.0f); - glnvg__vset(&quad[1], bounds[2], bounds[1], 0.5f, 1.0f); - glnvg__vset(&quad[2], bounds[0], bounds[3], 0.5f, 1.0f); - glnvg__vset(&quad[3], bounds[0], bounds[1], 0.5f, 1.0f); - - call->uniformOffset = glnvg__allocFragUniforms(gl, 2); - if (call->uniformOffset == -1) goto error; - // Simple shader for stencil - frag = nvg__fragUniformPtr(gl, call->uniformOffset); - memset(frag, 0, sizeof(*frag)); - frag->strokeThr = -1.0f; - frag->type = NSVG_SHADER_SIMPLE; - // Fill shader - glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset + gl->fragSize), paint, scissor, fringe, fringe, -1.0f); - } else { - call->uniformOffset = glnvg__allocFragUniforms(gl, 1); - if (call->uniformOffset == -1) goto error; - // Fill shader - glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset), paint, scissor, fringe, fringe, -1.0f); - } - - return; - -error: - // We get here if call alloc was ok, but something else is not. - // Roll back the last call to prevent drawing it. - if (gl->ncalls > 0) gl->ncalls--; -} - -static void glnvg__renderStroke(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, - float strokeWidth, const NVGpath* paths, int npaths) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - GLNVGcall* call = glnvg__allocCall(gl); - int i, maxverts, offset; - - if (call == NULL) return; - - call->type = GLNVG_STROKE; - call->pathOffset = glnvg__allocPaths(gl, npaths); - if (call->pathOffset == -1) goto error; - call->pathCount = npaths; - call->image = paint->image; - call->blendFunc = glnvg__blendCompositeOperation(compositeOperation); - - // Allocate vertices for all the paths. - maxverts = glnvg__maxVertCount(paths, npaths); - offset = glnvg__allocVerts(gl, maxverts); - if (offset == -1) goto error; - - for (i = 0; i < npaths; i++) { - GLNVGpath* copy = &gl->paths[call->pathOffset + i]; - const NVGpath* path = &paths[i]; - memset(copy, 0, sizeof(GLNVGpath)); - if (path->nstroke) { - copy->strokeOffset = offset; - copy->strokeCount = path->nstroke; - memcpy(&gl->verts[offset], path->stroke, sizeof(NVGvertex) * path->nstroke); - offset += path->nstroke; - } - } - - if (gl->flags & NVG_STENCIL_STROKES) { - // Fill shader - call->uniformOffset = glnvg__allocFragUniforms(gl, 2); - if (call->uniformOffset == -1) goto error; - - glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset), paint, scissor, strokeWidth, fringe, -1.0f); - glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset + gl->fragSize), paint, scissor, strokeWidth, fringe, 1.0f - 0.5f/255.0f); - - } else { - // Fill shader - call->uniformOffset = glnvg__allocFragUniforms(gl, 1); - if (call->uniformOffset == -1) goto error; - glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset), paint, scissor, strokeWidth, fringe, -1.0f); - } - - return; - -error: - // We get here if call alloc was ok, but something else is not. - // Roll back the last call to prevent drawing it. - if (gl->ncalls > 0) gl->ncalls--; -} - -static void glnvg__renderTriangles(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, - const NVGvertex* verts, int nverts, float fringe) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - GLNVGcall* call = glnvg__allocCall(gl); - GLNVGfragUniforms* frag; - - if (call == NULL) return; - - call->type = GLNVG_TRIANGLES; - call->image = paint->image; - call->blendFunc = glnvg__blendCompositeOperation(compositeOperation); - - // Allocate vertices for all the paths. - call->triangleOffset = glnvg__allocVerts(gl, nverts); - if (call->triangleOffset == -1) goto error; - call->triangleCount = nverts; - - memcpy(&gl->verts[call->triangleOffset], verts, sizeof(NVGvertex) * nverts); - - // Fill shader - call->uniformOffset = glnvg__allocFragUniforms(gl, 1); - if (call->uniformOffset == -1) goto error; - frag = nvg__fragUniformPtr(gl, call->uniformOffset); - glnvg__convertPaint(gl, frag, paint, scissor, 1.0f, fringe, -1.0f); - frag->type = NSVG_SHADER_IMG; - - return; - -error: - // We get here if call alloc was ok, but something else is not. - // Roll back the last call to prevent drawing it. - if (gl->ncalls > 0) gl->ncalls--; -} - -static void glnvg__renderDelete(void* uptr) -{ - GLNVGcontext* gl = (GLNVGcontext*)uptr; - int i; - if (gl == NULL) return; - - glnvg__deleteShader(gl, &gl->shader); - -#if NANOVG_GL3 -#if NANOVG_GL_USE_UNIFORMBUFFER - if (gl->fragBuf != 0) - glDeleteBuffers(1, &gl->fragBuf); -#endif - if (gl->vertArr != 0) - glDeleteVertexArrays(1, &gl->vertArr); -#endif - if (gl->vertBuf != 0) - glDeleteBuffers(1, &gl->vertBuf); - - for (i = 0; i < gl->ntextures; i++) { - if (gl->textures[i].tex != 0 && (gl->textures[i].flags & NVG_IMAGE_NODELETE) == 0) - glDeleteTextures(1, &gl->textures[i].tex); - } - NVG_FREE(gl->textures); - - NVG_FREE(gl->paths); - NVG_FREE(gl->verts); - NVG_FREE(gl->uniforms); - NVG_FREE(gl->calls); - - NVG_FREE(gl); -} - - -NVGcontext* EXT(nvgCreate)(JNIEnv* env, int flags) -{ - jclass NanoVGGLConfig = (*env)->FindClass(env, "org/lwjgl/nanovg/NanoVGGLConfig"); - jmethodID config = (*env)->GetStaticMethodID(env, NanoVGGLConfig, CONFIG_METHOD, "(J)V"); - - NVGparams params; - NVGcontext* ctx = NULL; - GLNVGcontext* gl = (GLNVGcontext*)NVG_MALLOC(sizeof(GLNVGcontext)); - if (gl == NULL) goto error; - memset(gl, 0, sizeof(GLNVGcontext)); - - (*env)->CallStaticVoidMethod(env, NanoVGGLConfig, config, (jlong)(uintptr_t)&gl->ActiveTexture); - if ( (*env)->ExceptionCheck(env) ) - goto error; - - memset(¶ms, 0, sizeof(params)); - params.renderCreate = glnvg__renderCreate; - params.renderCreateTexture = glnvg__renderCreateTexture; - params.renderDeleteTexture = glnvg__renderDeleteTexture; - params.renderUpdateTexture = glnvg__renderUpdateTexture; - params.renderGetTextureSize = glnvg__renderGetTextureSize; - params.renderViewport = glnvg__renderViewport; - params.renderCancel = glnvg__renderCancel; - params.renderFlush = glnvg__renderFlush; - params.renderFill = glnvg__renderFill; - params.renderStroke = glnvg__renderStroke; - params.renderTriangles = glnvg__renderTriangles; - params.renderDelete = glnvg__renderDelete; - params.userPtr = gl; - params.edgeAntiAlias = flags & NVG_ANTIALIAS ? 1 : 0; - - gl->flags = flags; - - ctx = nvgCreateInternal(¶ms); - if (ctx == NULL) goto error; - - return ctx; - -error: - // 'gl' is freed by nvgDeleteInternal. - if (ctx != NULL) nvgDeleteInternal(ctx); - return NULL; -} - -void EXT(nvgDelete)(NVGcontext* ctx) -{ - nvgDeleteInternal(ctx); -} - -int EXT(nvglCreateImageFromHandle)(NVGcontext* ctx, GLuint textureId, int w, int h, int imageFlags) -{ - GLNVGcontext* gl = (GLNVGcontext*)nvgInternalParams(ctx)->userPtr; - GLNVGtexture* tex = glnvg__allocTexture(gl); - - if (tex == NULL) return 0; - - tex->type = NVG_TEXTURE_RGBA; - tex->tex = textureId; - tex->flags = imageFlags; - tex->width = w; - tex->height = h; - - return tex->id; -} - -GLuint EXT(nvglImageHandle)(NVGcontext* ctx, int image) -{ - GLNVGcontext* gl = (GLNVGcontext*)nvgInternalParams(ctx)->userPtr; - GLNVGtexture* tex = glnvg__findTexture(gl, image); - return tex->tex; -} - -#endif /* NANOVG_GL_IMPLEMENTATION */ diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg_gl_utils.h b/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg_gl_utils.h deleted file mode 100644 index 42e503bb..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/nanovg_gl_utils.h +++ /dev/null @@ -1,128 +0,0 @@ -// -// Copyright (c) 2009-2013 Mikko Mononen memon@inside.org -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would be -// appreciated but is not required. -// 2. Altered source versions must be plainly marked as such, and must not be -// misrepresented as being the original software. -// 3. This notice may not be removed or altered from any source distribution. -// -#ifndef NANOVG_GL_UTILS_H -#define NANOVG_GL_UTILS_H - -#if defined NANOVG_GL2 - #define EXT(name) name##GL2 -#elif defined NANOVG_GL3 - #define EXT(name) name##GL3 -#elif defined NANOVG_GLES2 - #define EXT(name) name##GLES2 -#elif defined NANOVG_GLES3 - #define EXT(name) name##GLES3 -#endif - -struct NVGLUframebuffer { - GLuint fbo; - GLuint rbo; - GLuint texture; - int image; -}; -typedef struct NVGLUframebuffer NVGLUframebuffer; - -// Helper function to create GL frame buffer to render to. -void EXT(nvgluBindFramebuffer)(NVGcontext* ctx, NVGLUframebuffer* fb); -NVGLUframebuffer* EXT(nvgluCreateFramebuffer)(NVGcontext* ctx, int w, int h, int imageFlags); -void EXT(nvgluDeleteFramebuffer)(NVGcontext* ctx, NVGLUframebuffer* fb); - -#endif // NANOVG_GL_UTILS_H - -#ifdef NANOVG_GL_IMPLEMENTATION - -static GLint defaultFBO = -1; - -NVGLUframebuffer* EXT(nvgluCreateFramebuffer)(NVGcontext* ctx, int w, int h, int imageFlags) -{ - GLNVGcontext* gl = (GLNVGcontext*)((NVGparams*)ctx)->userPtr; - GLint defaultFBO; - GLint defaultRBO; - NVGLUframebuffer* fb = NULL; - - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO); - glGetIntegerv(GL_RENDERBUFFER_BINDING, &defaultRBO); - - fb = (NVGLUframebuffer*)NVG_MALLOC(sizeof(NVGLUframebuffer)); - if (fb == NULL) goto error; - memset(fb, 0, sizeof(NVGLUframebuffer)); - - fb->image = nvgCreateImageRGBA(ctx, w, h, imageFlags | NVG_IMAGE_FLIPY | NVG_IMAGE_PREMULTIPLIED, NULL); - - fb->texture = EXT(nvglImageHandle)(ctx, fb->image); - - // frame buffer object - glGenFramebuffers(1, &fb->fbo); - glBindFramebuffer(GL_FRAMEBUFFER, fb->fbo); - - // render buffer object - glGenRenderbuffers(1, &fb->rbo); - glBindRenderbuffer(GL_RENDERBUFFER, fb->rbo); - glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, w, h); - - // combine all - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fb->texture, 0); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fb->rbo); - - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { -#ifdef GL_DEPTH24_STENCIL8 - // If GL_STENCIL_INDEX8 is not supported, try GL_DEPTH24_STENCIL8 as a fallback. - // Some graphics cards require a depth buffer along with a stencil. - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, w, h); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fb->texture, 0); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fb->rbo); - - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) -#endif // GL_DEPTH24_STENCIL8 - goto error; - } - - glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); - glBindRenderbuffer(GL_RENDERBUFFER, defaultRBO); - return fb; -error: - glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO); - glBindRenderbuffer(GL_RENDERBUFFER, defaultRBO); - EXT(nvgluDeleteFramebuffer)(ctx, fb); - return NULL; -} - -void EXT(nvgluBindFramebuffer)(NVGcontext* ctx, NVGLUframebuffer* fb) -{ - GLNVGcontext* gl = (GLNVGcontext*)((NVGparams*)ctx)->userPtr; - if (defaultFBO == -1) glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO); - glBindFramebuffer(GL_FRAMEBUFFER, fb != NULL ? fb->fbo : defaultFBO); -} - -void EXT(nvgluDeleteFramebuffer)(NVGcontext* ctx, NVGLUframebuffer* fb) -{ - GLNVGcontext* gl = (GLNVGcontext*)((NVGparams*)ctx)->userPtr; - if (fb == NULL) return; - if (fb->fbo != 0) - glDeleteFramebuffers(1, &fb->fbo); - if (fb->rbo != 0) - glDeleteRenderbuffers(1, &fb->rbo); - if (fb->image >= 0) - nvgDeleteImage(ctx, fb->image); - fb->fbo = 0; - fb->rbo = 0; - fb->texture = 0; - fb->image = -1; - NVG_FREE(fb); -} - -#endif // NANOVG_GL_IMPLEMENTATION diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_Blendish.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_Blendish.c deleted file mode 100644 index 26cd60c2..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_Blendish.c +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" - -#include "nanovg.h" -#define BLENDISH_IMPLEMENTATION -#define BLENDISH_NO_NVG_TYPEDEFS -#include "blendish.h" - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndSetTheme(JNIEnv *__env, jclass clazz, jlong themeAddress) { - BNDtheme *theme = (BNDtheme *)(uintptr_t)themeAddress; - UNUSED_PARAMS(__env, clazz) - bndSetTheme(*theme); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_Blendish_nbndGetTheme(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)bndGetTheme(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_bndSetIconImage(JNIEnv *__env, jclass clazz, jint image) { - UNUSED_PARAMS(__env, clazz) - bndSetIconImage(image); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_bndSetFont(JNIEnv *__env, jclass clazz, jint font) { - UNUSED_PARAMS(__env, clazz) - bndSetFont(font); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndLabel(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint iconid, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - bndLabel(ctx, x, y, w, h, iconid, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndToolButton(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint flags, jint state, jint iconid, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - bndToolButton(ctx, x, y, w, h, flags, (BNDwidgetState)state, iconid, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndRadioButton(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint flags, jint state, jint iconid, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - bndRadioButton(ctx, x, y, w, h, flags, (BNDwidgetState)state, iconid, label); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_Blendish_nbndTextFieldTextPosition(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint iconid, jlong textAddress, jint px, jint py) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *text = (char const *)(uintptr_t)textAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)bndTextFieldTextPosition(ctx, x, y, w, h, iconid, text, px, py); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndTextField(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint flags, jint state, jint iconid, jlong textAddress, jint cbegin, jint cend) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *text = (char const *)(uintptr_t)textAddress; - UNUSED_PARAMS(__env, clazz) - bndTextField(ctx, x, y, w, h, flags, (BNDwidgetState)state, iconid, text, cbegin, cend); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndOptionButton(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint state, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - bndOptionButton(ctx, x, y, w, h, (BNDwidgetState)state, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndChoiceButton(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint flags, jint state, jint iconid, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - bndChoiceButton(ctx, x, y, w, h, flags, (BNDwidgetState)state, iconid, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndColorButton(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint flags, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - bndColorButton(ctx, x, y, w, h, flags, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndNumberField(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint flags, jint state, jlong labelAddress, jlong valueAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - char const *value = (char const *)(uintptr_t)valueAddress; - UNUSED_PARAMS(__env, clazz) - bndNumberField(ctx, x, y, w, h, flags, (BNDwidgetState)state, label, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndSlider(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint flags, jint state, jfloat progress, jlong labelAddress, jlong valueAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - char const *value = (char const *)(uintptr_t)valueAddress; - UNUSED_PARAMS(__env, clazz) - bndSlider(ctx, x, y, w, h, flags, (BNDwidgetState)state, progress, label, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndScrollBar(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint state, jfloat offset, jfloat size) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndScrollBar(ctx, x, y, w, h, (BNDwidgetState)state, offset, size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndMenuBackground(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint flags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndMenuBackground(ctx, x, y, w, h, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndMenuLabel(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint iconid, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - bndMenuLabel(ctx, x, y, w, h, iconid, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndMenuItem(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint state, jint iconid, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - bndMenuItem(ctx, x, y, w, h, (BNDwidgetState)state, iconid, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndTooltipBackground(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndTooltipBackground(ctx, x, y, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndNodePort(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jint state, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - bndNodePort(ctx, x, y, (BNDwidgetState)state, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndNodeWire(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x0, jfloat y0, jfloat x1, jfloat y1, jint state0, jint state1) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndNodeWire(ctx, x0, y0, x1, y1, (BNDwidgetState)state0, (BNDwidgetState)state1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndColoredNodeWire(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x0, jfloat y0, jfloat x1, jfloat y1, jlong color0Address, jlong color1Address) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color0 = (NVGcolor *)(uintptr_t)color0Address; - NVGcolor *color1 = (NVGcolor *)(uintptr_t)color1Address; - UNUSED_PARAMS(__env, clazz) - bndColoredNodeWire(ctx, x0, y0, x1, y1, *color0, *color1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndNodeBackground(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint state, jint iconid, jlong labelAddress, jlong titleColorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - NVGcolor *titleColor = (NVGcolor *)(uintptr_t)titleColorAddress; - UNUSED_PARAMS(__env, clazz) - bndNodeBackground(ctx, x, y, w, h, (BNDwidgetState)state, iconid, label, *titleColor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndSplitterWidgets(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndSplitterWidgets(ctx, x, y, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndJoinAreaOverlay(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint vertical, jint mirror) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndJoinAreaOverlay(ctx, x, y, w, h, vertical, mirror); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_nanovg_Blendish_nbndLabelWidth(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint iconid, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - return (jfloat)bndLabelWidth(ctx, iconid, label); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_nanovg_Blendish_nbndLabelHeight(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint iconid, jlong labelAddress, jfloat width) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - return (jfloat)bndLabelHeight(ctx, iconid, label, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndTransparent(JNIEnv *__env, jclass clazz, jlong colorAddress, jlong __result) { - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = bndTransparent(*color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndOffsetColor(JNIEnv *__env, jclass clazz, jlong colorAddress, jint delta, jlong __result) { - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = bndOffsetColor(*color, delta); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndSelectCorners__JFI(JNIEnv *__env, jclass clazz, jlong radiusesAddress, jfloat r, jint flags) { - float *radiuses = (float *)(uintptr_t)radiusesAddress; - UNUSED_PARAMS(__env, clazz) - bndSelectCorners(radiuses, r, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndInnerColors(JNIEnv *__env, jclass clazz, jlong shade_topAddress, jlong shade_downAddress, jlong themeAddress, jint state, jint flipActive) { - NVGcolor *shade_top = (NVGcolor *)(uintptr_t)shade_topAddress; - NVGcolor *shade_down = (NVGcolor *)(uintptr_t)shade_downAddress; - BNDwidgetTheme const *theme = (BNDwidgetTheme const *)(uintptr_t)themeAddress; - UNUSED_PARAMS(__env, clazz) - bndInnerColors(shade_top, shade_down, theme, (BNDwidgetState)state, flipActive); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndTextColor(JNIEnv *__env, jclass clazz, jlong themeAddress, jint state, jlong __result) { - BNDwidgetTheme const *theme = (BNDwidgetTheme const *)(uintptr_t)themeAddress; - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = bndTextColor(theme, (BNDwidgetState)state); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndScrollHandleRect__JJJJFF(JNIEnv *__env, jclass clazz, jlong xAddress, jlong yAddress, jlong wAddress, jlong hAddress, jfloat offset, jfloat size) { - float *x = (float *)(uintptr_t)xAddress; - float *y = (float *)(uintptr_t)yAddress; - float *w = (float *)(uintptr_t)wAddress; - float *h = (float *)(uintptr_t)hAddress; - UNUSED_PARAMS(__env, clazz) - bndScrollHandleRect(x, y, w, h, offset, size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndRoundedBox(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jfloat cr0, jfloat cr1, jfloat cr2, jfloat cr3) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndRoundedBox(ctx, x, y, w, h, cr0, cr1, cr2, cr3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndBackground(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndBackground(ctx, x, y, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndBevel(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndBevel(ctx, x, y, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndBevelInset(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jfloat cr2, jfloat cr3) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndBevelInset(ctx, x, y, w, h, cr2, cr3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndIcon(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jint iconid) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndIcon(ctx, x, y, iconid); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndDropShadow(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jfloat r, jfloat feather, jfloat alpha) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - bndDropShadow(ctx, x, y, w, h, r, feather, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndInnerBox(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jfloat cr0, jfloat cr1, jfloat cr2, jfloat cr3, jlong shade_topAddress, jlong shade_downAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *shade_top = (NVGcolor *)(uintptr_t)shade_topAddress; - NVGcolor *shade_down = (NVGcolor *)(uintptr_t)shade_downAddress; - UNUSED_PARAMS(__env, clazz) - bndInnerBox(ctx, x, y, w, h, cr0, cr1, cr2, cr3, *shade_top, *shade_down); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndOutlineBox(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jfloat cr0, jfloat cr1, jfloat cr2, jfloat cr3, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - bndOutlineBox(ctx, x, y, w, h, cr0, cr1, cr2, cr3, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndIconLabelValue(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint iconid, jlong colorAddress, jint align, jfloat fontsize, jlong labelAddress, jlong valueAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - char const *value = (char const *)(uintptr_t)valueAddress; - UNUSED_PARAMS(__env, clazz) - bndIconLabelValue(ctx, x, y, w, h, iconid, *color, align, fontsize, label, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndNodeIconLabel(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint iconid, jlong colorAddress, jlong shadowColorAddress, jint align, jfloat fontsize, jlong labelAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - NVGcolor *shadowColor = (NVGcolor *)(uintptr_t)shadowColorAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - bndNodeIconLabel(ctx, x, y, w, h, iconid, *color, *shadowColor, align, fontsize, label); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_Blendish_nbndIconLabelTextPosition(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint iconid, jfloat fontsize, jlong labelAddress, jint px, jint py) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)bndIconLabelTextPosition(ctx, x, y, w, h, iconid, fontsize, label, px, py); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndIconLabelCaret(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jint iconid, jlong colorAddress, jfloat fontsize, jlong labelAddress, jlong caretcolorAddress, jint cbegin, jint cend) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - char const *label = (char const *)(uintptr_t)labelAddress; - NVGcolor *caretcolor = (NVGcolor *)(uintptr_t)caretcolorAddress; - UNUSED_PARAMS(__env, clazz) - bndIconLabelCaret(ctx, x, y, w, h, iconid, *color, fontsize, label, *caretcolor, cbegin, cend); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndCheck(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat ox, jfloat oy, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - bndCheck(ctx, ox, oy, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndArrow(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat s, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - bndArrow(ctx, x, y, s, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndUpDownArrow(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat s, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - bndUpDownArrow(ctx, x, y, s, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndNodeArrowDown(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat s, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - bndNodeArrowDown(ctx, x, y, s, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndNodeWireColor(JNIEnv *__env, jclass clazz, jlong themeAddress, jint state, jlong __result) { - BNDnodeTheme const *theme = (BNDnodeTheme const *)(uintptr_t)themeAddress; - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = bndNodeWireColor(theme, (BNDwidgetState)state); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndSelectCorners___3FFI(JNIEnv *__env, jclass clazz, jfloatArray radiusesAddress, jfloat r, jint flags) { - jfloat *radiuses = (*__env)->GetFloatArrayElements(__env, radiusesAddress, NULL); - UNUSED_PARAMS(__env, clazz) - bndSelectCorners((float *)radiuses, r, flags); - (*__env)->ReleaseFloatArrayElements(__env, radiusesAddress, radiuses, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_Blendish_nbndScrollHandleRect___3F_3F_3F_3FFF(JNIEnv *__env, jclass clazz, jfloatArray xAddress, jfloatArray yAddress, jfloatArray wAddress, jfloatArray hAddress, jfloat offset, jfloat size) { - jfloat *x = (*__env)->GetFloatArrayElements(__env, xAddress, NULL); - jfloat *y = (*__env)->GetFloatArrayElements(__env, yAddress, NULL); - jfloat *w = (*__env)->GetFloatArrayElements(__env, wAddress, NULL); - jfloat *h = (*__env)->GetFloatArrayElements(__env, hAddress, NULL); - UNUSED_PARAMS(__env, clazz) - bndScrollHandleRect((float *)x, (float *)y, (float *)w, (float *)h, offset, size); - (*__env)->ReleaseFloatArrayElements(__env, hAddress, h, 0); - (*__env)->ReleaseFloatArrayElements(__env, wAddress, w, 0); - (*__env)->ReleaseFloatArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseFloatArrayElements(__env, xAddress, x, 0); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_LibNanoVG.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_LibNanoVG.c deleted file mode 100644 index f15648ca..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_LibNanoVG.c +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#define LWJGL_MALLOC_LIB org_lwjgl_nanovg_LibNanoVG -#include "lwjgl/lwjgl_malloc.h" diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoSVG.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoSVG.c deleted file mode 100644 index 53263e90..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoSVG.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "lwjgl/lwjgl_malloc.h" -#define NVG_MALLOC(sz) org_lwjgl_malloc(sz) -#define NVG_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define NVG_FREE(p) org_lwjgl_free(p) -DISABLE_WARNINGS() -#define NANOSVG_IMPLEMENTATION -#include "nanosvg.h" -#define NANOSVGRAST_IMPLEMENTATION -#include "nanosvgrast.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoSVG_nnsvgParseFromFile(JNIEnv *__env, jclass clazz, jlong filenameAddress, jlong unitsAddress, jfloat dpi) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - char const *units = (char const *)(uintptr_t)unitsAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)nsvgParseFromFile(filename, units, dpi); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoSVG_nnsvgParse(JNIEnv *__env, jclass clazz, jlong inputAddress, jlong unitsAddress, jfloat dpi) { - char *input = (char *)(uintptr_t)inputAddress; - char const *units = (char const *)(uintptr_t)unitsAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)nsvgParse(input, units, dpi); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoSVG_nnsvgDuplicatePath(JNIEnv *__env, jclass clazz, jlong pAddress) { - NSVGpath *p = (NSVGpath *)(uintptr_t)pAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)nsvgDuplicatePath(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoSVG_nnsvgDelete(JNIEnv *__env, jclass clazz, jlong imageAddress) { - NSVGimage *image = (NSVGimage *)(uintptr_t)imageAddress; - UNUSED_PARAMS(__env, clazz) - nsvgDelete(image); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoSVG_nsvgCreateRasterizer(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)nsvgCreateRasterizer(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoSVG_nnsvgRasterize(JNIEnv *__env, jclass clazz, jlong rAddress, jlong imageAddress, jfloat tx, jfloat ty, jfloat scale, jlong dstAddress, jint w, jint h, jint stride) { - NSVGrasterizer *r = (NSVGrasterizer *)(uintptr_t)rAddress; - NSVGimage *image = (NSVGimage *)(uintptr_t)imageAddress; - unsigned char *dst = (unsigned char *)(uintptr_t)dstAddress; - UNUSED_PARAMS(__env, clazz) - nsvgRasterize(r, image, tx, ty, scale, dst, w, h, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoSVG_nnsvgDeleteRasterizer(JNIEnv *__env, jclass clazz, jlong rasterizerAddress) { - NSVGrasterizer *rasterizer = (NSVGrasterizer *)(uintptr_t)rasterizerAddress; - UNUSED_PARAMS(__env, clazz) - nsvgDeleteRasterizer(rasterizer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVG.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVG.c deleted file mode 100644 index 3c56d815..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVG.c +++ /dev/null @@ -1,825 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "lwjgl/lwjgl_malloc.h" -#define NVG_MALLOC(sz) org_lwjgl_malloc(sz) -#define NVG_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define NVG_FREE(p) org_lwjgl_free(p) -DISABLE_WARNINGS() -#define STBI_MALLOC(sz) org_lwjgl_malloc(sz) -#define STBI_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define STBI_FREE(p) org_lwjgl_free(p) -#define STBI_FAILURE_USERMSG -#define STBI_ASSERT(x) -#define STB_IMAGE_IMPLEMENTATION -#define STB_IMAGE_STATIC -#define STBTT_malloc(x,u) ((void)(u),org_lwjgl_malloc(x)) -#define STBTT_free(x,u) ((void)(u),org_lwjgl_free(x)) -#define STBTT_assert -#define STB_TRUETYPE_IMPLEMENTATION -#define STBTT_STATIC -#include "nanovg.c" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgBeginFrame(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat windowWidth, jfloat windowHeight, jfloat devicePixelRatio) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgBeginFrame(ctx, windowWidth, windowHeight, devicePixelRatio); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCancelFrame(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgCancelFrame(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgEndFrame(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgEndFrame(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgGlobalCompositeOperation(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint op) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgGlobalCompositeOperation(ctx, op); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgGlobalCompositeBlendFunc(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint sfactor, jint dfactor) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgGlobalCompositeBlendFunc(ctx, sfactor, dfactor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgGlobalCompositeBlendFuncSeparate(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgGlobalCompositeBlendFuncSeparate(ctx, srcRGB, dstRGB, srcAlpha, dstAlpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRGB(JNIEnv *__env, jclass clazz, jbyte r, jbyte g, jbyte b, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgRGB((unsigned char)r, (unsigned char)g, (unsigned char)b); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRGBf(JNIEnv *__env, jclass clazz, jfloat r, jfloat g, jfloat b, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgRGBf(r, g, b); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRGBA(JNIEnv *__env, jclass clazz, jbyte r, jbyte g, jbyte b, jbyte a, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgRGBA((unsigned char)r, (unsigned char)g, (unsigned char)b, (unsigned char)a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRGBAf(JNIEnv *__env, jclass clazz, jfloat r, jfloat g, jfloat b, jfloat a, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgRGBAf(r, g, b, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgLerpRGBA(JNIEnv *__env, jclass clazz, jlong c0Address, jlong c1Address, jfloat u, jlong __result) { - NVGcolor *c0 = (NVGcolor *)(uintptr_t)c0Address; - NVGcolor *c1 = (NVGcolor *)(uintptr_t)c1Address; - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgLerpRGBA(*c0, *c1, u); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransRGBA(JNIEnv *__env, jclass clazz, jlong c0Address, jbyte a, jlong __result) { - NVGcolor *c0 = (NVGcolor *)(uintptr_t)c0Address; - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgTransRGBA(*c0, (unsigned char)a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransRGBAf(JNIEnv *__env, jclass clazz, jlong c0Address, jfloat a, jlong __result) { - NVGcolor *c0 = (NVGcolor *)(uintptr_t)c0Address; - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgTransRGBAf(*c0, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgHSL(JNIEnv *__env, jclass clazz, jfloat h, jfloat s, jfloat l, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgHSL(h, s, l); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgHSLA(JNIEnv *__env, jclass clazz, jfloat h, jfloat s, jfloat l, jbyte a, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((NVGcolor*)(uintptr_t)__result) = nvgHSLA(h, s, l, (unsigned char)a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgSave(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgSave(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRestore(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgRestore(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgReset(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgReset(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgShapeAntiAlias(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint enabled) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgShapeAntiAlias(ctx, enabled); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgStrokeColor(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - nvgStrokeColor(ctx, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgStrokePaint(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong paintAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGpaint *paint = (NVGpaint *)(uintptr_t)paintAddress; - UNUSED_PARAMS(__env, clazz) - nvgStrokePaint(ctx, *paint); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgFillColor(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong colorAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *color = (NVGcolor *)(uintptr_t)colorAddress; - UNUSED_PARAMS(__env, clazz) - nvgFillColor(ctx, *color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgFillPaint(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong paintAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGpaint *paint = (NVGpaint *)(uintptr_t)paintAddress; - UNUSED_PARAMS(__env, clazz) - nvgFillPaint(ctx, *paint); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgMiterLimit(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat limit) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgMiterLimit(ctx, limit); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgStrokeWidth(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat size) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgStrokeWidth(ctx, size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgLineCap(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint cap) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgLineCap(ctx, cap); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgLineJoin(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint join) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgLineJoin(ctx, join); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgGlobalAlpha(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat alpha) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgGlobalAlpha(ctx, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgResetTransform(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgResetTransform(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransform(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat a, jfloat b, jfloat c, jfloat d, jfloat e, jfloat f) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransform(ctx, a, b, c, d, e, f); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTranslate(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgTranslate(ctx, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRotate(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat angle) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgRotate(ctx, angle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgSkewX(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat angle) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgSkewX(ctx, angle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgSkewY(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat angle) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgSkewY(ctx, angle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgScale(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgScale(ctx, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCurrentTransform__JJ(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong xformAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - float *xform = (float *)(uintptr_t)xformAddress; - UNUSED_PARAMS(__env, clazz) - nvgCurrentTransform(ctx, xform); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformIdentity__J(JNIEnv *__env, jclass clazz, jlong dstAddress) { - float *dst = (float *)(uintptr_t)dstAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformIdentity(dst); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformTranslate__JFF(JNIEnv *__env, jclass clazz, jlong dstAddress, jfloat tx, jfloat ty) { - float *dst = (float *)(uintptr_t)dstAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformTranslate(dst, tx, ty); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformScale__JFF(JNIEnv *__env, jclass clazz, jlong dstAddress, jfloat sx, jfloat sy) { - float *dst = (float *)(uintptr_t)dstAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformScale(dst, sx, sy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformRotate__JF(JNIEnv *__env, jclass clazz, jlong dstAddress, jfloat a) { - float *dst = (float *)(uintptr_t)dstAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformRotate(dst, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformSkewX__JF(JNIEnv *__env, jclass clazz, jlong dstAddress, jfloat a) { - float *dst = (float *)(uintptr_t)dstAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformSkewX(dst, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformSkewY__JF(JNIEnv *__env, jclass clazz, jlong dstAddress, jfloat a) { - float *dst = (float *)(uintptr_t)dstAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformSkewY(dst, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformMultiply__JJ(JNIEnv *__env, jclass clazz, jlong dstAddress, jlong srcAddress) { - float *dst = (float *)(uintptr_t)dstAddress; - float const *src = (float const *)(uintptr_t)srcAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformMultiply(dst, src); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformPremultiply__JJ(JNIEnv *__env, jclass clazz, jlong dstAddress, jlong srcAddress) { - float *dst = (float *)(uintptr_t)dstAddress; - float const *src = (float const *)(uintptr_t)srcAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformPremultiply(dst, src); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformInverse__JJ(JNIEnv *__env, jclass clazz, jlong dstAddress, jlong srcAddress) { - float *dst = (float *)(uintptr_t)dstAddress; - float const *src = (float const *)(uintptr_t)srcAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgTransformInverse(dst, src); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformPoint__JJJFF(JNIEnv *__env, jclass clazz, jlong dstxAddress, jlong dstyAddress, jlong xformAddress, jfloat srcx, jfloat srcy) { - float *dstx = (float *)(uintptr_t)dstxAddress; - float *dsty = (float *)(uintptr_t)dstyAddress; - float const *xform = (float const *)(uintptr_t)xformAddress; - UNUSED_PARAMS(__env, clazz) - nvgTransformPoint(dstx, dsty, xform, srcx, srcy); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_nanovg_NanoVG_nvgDegToRad(JNIEnv *__env, jclass clazz, jfloat deg) { - UNUSED_PARAMS(__env, clazz) - return (jfloat)nvgDegToRad(deg); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_nanovg_NanoVG_nvgRadToDeg(JNIEnv *__env, jclass clazz, jfloat rad) { - UNUSED_PARAMS(__env, clazz) - return (jfloat)nvgRadToDeg(rad); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCreateImage(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong filenameAddress, jint imageFlags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *filename = (char const *)(uintptr_t)filenameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgCreateImage(ctx, filename, imageFlags); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCreateImageMem(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint imageFlags, jlong dataAddress, jint ndata) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - unsigned char *data = (unsigned char *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgCreateImageMem(ctx, imageFlags, data, ndata); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCreateImageRGBA(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint w, jint h, jint imageFlags, jlong dataAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - unsigned char const *data = (unsigned char const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgCreateImageRGBA(ctx, w, h, imageFlags, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgUpdateImage(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint image, jlong dataAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - unsigned char const *data = (unsigned char const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - nvgUpdateImage(ctx, image, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgImageSize__JIJJ(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint image, jlong wAddress, jlong hAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - int *w = (int *)(uintptr_t)wAddress; - int *h = (int *)(uintptr_t)hAddress; - UNUSED_PARAMS(__env, clazz) - nvgImageSize(ctx, image, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgDeleteImage(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint image) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgDeleteImage(ctx, image); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgLinearGradient(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat sx, jfloat sy, jfloat ex, jfloat ey, jlong icolAddress, jlong ocolAddress, jlong __result) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *icol = (NVGcolor *)(uintptr_t)icolAddress; - NVGcolor *ocol = (NVGcolor *)(uintptr_t)ocolAddress; - UNUSED_PARAMS(__env, clazz) - *((NVGpaint*)(uintptr_t)__result) = nvgLinearGradient(ctx, sx, sy, ex, ey, *icol, *ocol); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgBoxGradient(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jfloat r, jfloat f, jlong icolAddress, jlong ocolAddress, jlong __result) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *icol = (NVGcolor *)(uintptr_t)icolAddress; - NVGcolor *ocol = (NVGcolor *)(uintptr_t)ocolAddress; - UNUSED_PARAMS(__env, clazz) - *((NVGpaint*)(uintptr_t)__result) = nvgBoxGradient(ctx, x, y, w, h, r, f, *icol, *ocol); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRadialGradient(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat cx, jfloat cy, jfloat inr, jfloat outr, jlong icolAddress, jlong ocolAddress, jlong __result) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGcolor *icol = (NVGcolor *)(uintptr_t)icolAddress; - NVGcolor *ocol = (NVGcolor *)(uintptr_t)ocolAddress; - UNUSED_PARAMS(__env, clazz) - *((NVGpaint*)(uintptr_t)__result) = nvgRadialGradient(ctx, cx, cy, inr, outr, *icol, *ocol); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgImagePattern(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat ox, jfloat oy, jfloat ex, jfloat ey, jfloat angle, jint image, jfloat alpha, jlong __result) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - *((NVGpaint*)(uintptr_t)__result) = nvgImagePattern(ctx, ox, oy, ex, ey, angle, image, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgScissor(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgScissor(ctx, x, y, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgIntersectScissor(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgIntersectScissor(ctx, x, y, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgResetScissor(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgResetScissor(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgBeginPath(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgBeginPath(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgMoveTo(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgMoveTo(ctx, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgLineTo(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgLineTo(ctx, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgBezierTo(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat c1x, jfloat c1y, jfloat c2x, jfloat c2y, jfloat x, jfloat y) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgBezierTo(ctx, c1x, c1y, c2x, c2y, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgQuadTo(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat cx, jfloat cy, jfloat x, jfloat y) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgQuadTo(ctx, cx, cy, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgArcTo(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x1, jfloat y1, jfloat x2, jfloat y2, jfloat radius) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgArcTo(ctx, x1, y1, x2, y2, radius); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgClosePath(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgClosePath(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgPathWinding(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint dir) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgPathWinding(ctx, dir); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgArc(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat cx, jfloat cy, jfloat r, jfloat a0, jfloat a1, jint dir) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgArc(ctx, cx, cy, r, a0, a1, dir); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRect(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgRect(ctx, x, y, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRoundedRect(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jfloat r) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgRoundedRect(ctx, x, y, w, h, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgRoundedRectVarying(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat w, jfloat h, jfloat radTopLeft, jfloat radTopRight, jfloat radBottomRight, jfloat radBottomLeft) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgRoundedRectVarying(ctx, x, y, w, h, radTopLeft, radTopRight, radBottomRight, radBottomLeft); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgEllipse(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat cx, jfloat cy, jfloat rx, jfloat ry) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgEllipse(ctx, cx, cy, rx, ry); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCircle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat cx, jfloat cy, jfloat r) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgCircle(ctx, cx, cy, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgFill(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgFill(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgStroke(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgStroke(ctx); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCreateFont(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong nameAddress, jlong filenameAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *name = (char const *)(uintptr_t)nameAddress; - char const *filename = (char const *)(uintptr_t)filenameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgCreateFont(ctx, name, filename); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCreateFontAtIndex(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong nameAddress, jlong filenameAddress, jint fontIndex) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *name = (char const *)(uintptr_t)nameAddress; - char const *filename = (char const *)(uintptr_t)filenameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgCreateFontAtIndex(ctx, name, filename, fontIndex); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCreateFontMem(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong nameAddress, jlong dataAddress, jint ndata, jint freeData) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *name = (char const *)(uintptr_t)nameAddress; - unsigned char *data = (unsigned char *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgCreateFontMem(ctx, name, data, ndata, freeData); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCreateFontMemAtIndex(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong nameAddress, jlong dataAddress, jint ndata, jint freeData, jint fontIndex) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *name = (char const *)(uintptr_t)nameAddress; - unsigned char *data = (unsigned char *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgCreateFontMemAtIndex(ctx, name, data, ndata, freeData, fontIndex); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgFindFont(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong nameAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *name = (char const *)(uintptr_t)nameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgFindFont(ctx, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgAddFallbackFontId(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint baseFont, jint fallbackFont) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgAddFallbackFontId(ctx, baseFont, fallbackFont); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgAddFallbackFont(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong baseFontAddress, jlong fallbackFontAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *baseFont = (char const *)(uintptr_t)baseFontAddress; - char const *fallbackFont = (char const *)(uintptr_t)fallbackFontAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgAddFallbackFont(ctx, baseFont, fallbackFont); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgResetFallbackFontsId(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint baseFont) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgResetFallbackFontsId(ctx, baseFont); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgResetFallbackFonts(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong baseFontAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *baseFont = (char const *)(uintptr_t)baseFontAddress; - UNUSED_PARAMS(__env, clazz) - nvgResetFallbackFonts(ctx, baseFont); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgFontSize(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat size) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgFontSize(ctx, size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgFontBlur(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat blur) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgFontBlur(ctx, blur); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextLetterSpacing(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat spacing) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgTextLetterSpacing(ctx, spacing); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextLineHeight(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat lineHeight) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgTextLineHeight(ctx, lineHeight); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextAlign(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint align) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgTextAlign(ctx, align); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgFontFaceId(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint font) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgFontFaceId(ctx, font); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgFontFace(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fontAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *font = (char const *)(uintptr_t)fontAddress; - UNUSED_PARAMS(__env, clazz) - nvgFontFace(ctx, font); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgText(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jlong stringAddress, jlong endAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *string = (char const *)(uintptr_t)stringAddress; - char const *end = (char const *)(uintptr_t)endAddress; - UNUSED_PARAMS(__env, clazz) - return (jfloat)nvgText(ctx, x, y, string, end); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextBox(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat breakRowWidth, jlong stringAddress, jlong endAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *string = (char const *)(uintptr_t)stringAddress; - char const *end = (char const *)(uintptr_t)endAddress; - UNUSED_PARAMS(__env, clazz) - nvgTextBox(ctx, x, y, breakRowWidth, string, end); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextBounds__JFFJJJ(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jlong stringAddress, jlong endAddress, jlong boundsAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *string = (char const *)(uintptr_t)stringAddress; - char const *end = (char const *)(uintptr_t)endAddress; - float *bounds = (float *)(uintptr_t)boundsAddress; - UNUSED_PARAMS(__env, clazz) - return (jfloat)nvgTextBounds(ctx, x, y, string, end, bounds); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextBoxBounds__JFFFJJJ(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat breakRowWidth, jlong stringAddress, jlong endAddress, jlong boundsAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *string = (char const *)(uintptr_t)stringAddress; - char const *end = (char const *)(uintptr_t)endAddress; - float *bounds = (float *)(uintptr_t)boundsAddress; - UNUSED_PARAMS(__env, clazz) - nvgTextBoxBounds(ctx, x, y, breakRowWidth, string, end, bounds); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextGlyphPositions(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jlong stringAddress, jlong endAddress, jlong positionsAddress, jint maxPositions) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *string = (char const *)(uintptr_t)stringAddress; - char const *end = (char const *)(uintptr_t)endAddress; - NVGglyphPosition *positions = (NVGglyphPosition *)(uintptr_t)positionsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgTextGlyphPositions(ctx, x, y, string, end, positions, maxPositions); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextMetrics__JJJJ(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong ascenderAddress, jlong descenderAddress, jlong linehAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - float *ascender = (float *)(uintptr_t)ascenderAddress; - float *descender = (float *)(uintptr_t)descenderAddress; - float *lineh = (float *)(uintptr_t)linehAddress; - UNUSED_PARAMS(__env, clazz) - nvgTextMetrics(ctx, ascender, descender, lineh); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextBreakLines(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong stringAddress, jlong endAddress, jfloat breakRowWidth, jlong rowsAddress, jint maxRows) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *string = (char const *)(uintptr_t)stringAddress; - char const *end = (char const *)(uintptr_t)endAddress; - NVGtextRow *rows = (NVGtextRow *)(uintptr_t)rowsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvgTextBreakLines(ctx, string, end, breakRowWidth, rows, maxRows); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVG_nvgCreateInternal(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&nvgCreateInternal; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVG_nvgInternalParams(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&nvgInternalParams; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVG_nvgDeleteInternal(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&nvgDeleteInternal; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgCurrentTransform__J_3F(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloatArray xformAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - jfloat *xform = (*__env)->GetFloatArrayElements(__env, xformAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgCurrentTransform(ctx, (float *)xform); - (*__env)->ReleaseFloatArrayElements(__env, xformAddress, xform, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformIdentity___3F(JNIEnv *__env, jclass clazz, jfloatArray dstAddress) { - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformIdentity((float *)dst); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformTranslate___3FFF(JNIEnv *__env, jclass clazz, jfloatArray dstAddress, jfloat tx, jfloat ty) { - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformTranslate((float *)dst, tx, ty); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformScale___3FFF(JNIEnv *__env, jclass clazz, jfloatArray dstAddress, jfloat sx, jfloat sy) { - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformScale((float *)dst, sx, sy); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformRotate___3FF(JNIEnv *__env, jclass clazz, jfloatArray dstAddress, jfloat a) { - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformRotate((float *)dst, a); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformSkewX___3FF(JNIEnv *__env, jclass clazz, jfloatArray dstAddress, jfloat a) { - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformSkewX((float *)dst, a); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformSkewY___3FF(JNIEnv *__env, jclass clazz, jfloatArray dstAddress, jfloat a) { - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformSkewY((float *)dst, a); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformMultiply___3F_3F(JNIEnv *__env, jclass clazz, jfloatArray dstAddress, jfloatArray srcAddress) { - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - jfloat *src = (*__env)->GetFloatArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformMultiply((float *)dst, (float const *)src); - (*__env)->ReleaseFloatArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformPremultiply___3F_3F(JNIEnv *__env, jclass clazz, jfloatArray dstAddress, jfloatArray srcAddress) { - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - jfloat *src = (*__env)->GetFloatArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformPremultiply((float *)dst, (float const *)src); - (*__env)->ReleaseFloatArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformInverse___3F_3F(JNIEnv *__env, jclass clazz, jfloatArray dstAddress, jfloatArray srcAddress) { - jint __result; - jfloat *dst = (*__env)->GetFloatArrayElements(__env, dstAddress, NULL); - jfloat *src = (*__env)->GetFloatArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)nvgTransformInverse((float *)dst, (float const *)src); - (*__env)->ReleaseFloatArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseFloatArrayElements(__env, dstAddress, dst, 0); - return __result; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTransformPoint___3F_3F_3FFF(JNIEnv *__env, jclass clazz, jfloatArray dstxAddress, jfloatArray dstyAddress, jfloatArray xformAddress, jfloat srcx, jfloat srcy) { - jfloat *dstx = (*__env)->GetFloatArrayElements(__env, dstxAddress, NULL); - jfloat *dsty = (*__env)->GetFloatArrayElements(__env, dstyAddress, NULL); - jfloat *xform = (*__env)->GetFloatArrayElements(__env, xformAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTransformPoint((float *)dstx, (float *)dsty, (float const *)xform, srcx, srcy); - (*__env)->ReleaseFloatArrayElements(__env, xformAddress, xform, 0); - (*__env)->ReleaseFloatArrayElements(__env, dstyAddress, dsty, 0); - (*__env)->ReleaseFloatArrayElements(__env, dstxAddress, dstx, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgImageSize__JI_3I_3I(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint image, jintArray wAddress, jintArray hAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - jint *w = (*__env)->GetIntArrayElements(__env, wAddress, NULL); - jint *h = (*__env)->GetIntArrayElements(__env, hAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgImageSize(ctx, image, (int *)w, (int *)h); - (*__env)->ReleaseIntArrayElements(__env, hAddress, h, 0); - (*__env)->ReleaseIntArrayElements(__env, wAddress, w, 0); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextBounds__JFFJJ_3F(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jlong stringAddress, jlong endAddress, jfloatArray boundsAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *string = (char const *)(uintptr_t)stringAddress; - char const *end = (char const *)(uintptr_t)endAddress; - jfloat __result; - jfloat *bounds = boundsAddress == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, boundsAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jfloat)nvgTextBounds(ctx, x, y, string, end, (float *)bounds); - if (bounds != NULL) { (*__env)->ReleaseFloatArrayElements(__env, boundsAddress, bounds, 0); } - return __result; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextBoxBounds__JFFFJJ_3F(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloat x, jfloat y, jfloat breakRowWidth, jlong stringAddress, jlong endAddress, jfloatArray boundsAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - char const *string = (char const *)(uintptr_t)stringAddress; - char const *end = (char const *)(uintptr_t)endAddress; - jfloat *bounds = boundsAddress == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, boundsAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTextBoxBounds(ctx, x, y, breakRowWidth, string, end, (float *)bounds); - if (bounds != NULL) { (*__env)->ReleaseFloatArrayElements(__env, boundsAddress, bounds, 0); } -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVG_nnvgTextMetrics__J_3F_3F_3F(JNIEnv *__env, jclass clazz, jlong ctxAddress, jfloatArray ascenderAddress, jfloatArray descenderAddress, jfloatArray linehAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - jfloat *ascender = ascenderAddress == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, ascenderAddress, NULL); - jfloat *descender = descenderAddress == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, descenderAddress, NULL); - jfloat *lineh = linehAddress == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, linehAddress, NULL); - UNUSED_PARAMS(__env, clazz) - nvgTextMetrics(ctx, (float *)ascender, (float *)descender, (float *)lineh); - if (lineh != NULL) { (*__env)->ReleaseFloatArrayElements(__env, linehAddress, lineh, 0); } - if (descender != NULL) { (*__env)->ReleaseFloatArrayElements(__env, descenderAddress, descender, 0); } - if (ascender != NULL) { (*__env)->ReleaseFloatArrayElements(__env, ascenderAddress, ascender, 0); } -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGL2.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGL2.c deleted file mode 100644 index c6f49a6b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGL2.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "lwjgl/lwjgl_malloc.h" -#define NVG_MALLOC(sz) org_lwjgl_malloc(sz) -#define NVG_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define NVG_FREE(p) org_lwjgl_free(p) -DISABLE_WARNINGS() -#define NANOVG_GL2_IMPLEMENTATION -#include "nanovg.h" -#include "nanovg_gl.h" -#include "nanovg_gl_utils.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVGGL2_nnvglCreateImageFromHandle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint textureId, jint w, jint h, jint flags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvglCreateImageFromHandleGL2(ctx, (GLuint)textureId, w, h, flags); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVGGL2_nnvglImageHandle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint image) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvglImageHandleGL2(ctx, image); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVGGL2_nnvgCreate(JNIEnv *__env, jclass clazz, jint flags) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)nvgCreateGL2(__env, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGL2_nnvgDelete(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgDeleteGL2(ctx); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVGGL2_nnvgluCreateFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint w, jint h, jint imageFlags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)nvgluCreateFramebufferGL2(ctx, w, h, imageFlags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGL2_nnvgluBindFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fbAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGLUframebuffer *fb = (NVGLUframebuffer *)(uintptr_t)fbAddress; - UNUSED_PARAMS(__env, clazz) - nvgluBindFramebufferGL2(ctx, fb); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGL2_nnvgluDeleteFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fbAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGLUframebuffer *fb = (NVGLUframebuffer *)(uintptr_t)fbAddress; - UNUSED_PARAMS(__env, clazz) - nvgluDeleteFramebufferGL2(ctx, fb); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGL3.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGL3.c deleted file mode 100644 index b829a734..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGL3.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "lwjgl/lwjgl_malloc.h" -#define NVG_MALLOC(sz) org_lwjgl_malloc(sz) -#define NVG_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define NVG_FREE(p) org_lwjgl_free(p) -DISABLE_WARNINGS() -#define NANOVG_GL3_IMPLEMENTATION -#include "nanovg.h" -#include "nanovg_gl.h" -#include "nanovg_gl_utils.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVGGL3_nnvglCreateImageFromHandle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint textureId, jint w, jint h, jint flags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvglCreateImageFromHandleGL3(ctx, (GLuint)textureId, w, h, flags); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVGGL3_nnvglImageHandle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint image) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvglImageHandleGL3(ctx, image); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVGGL3_nnvgCreate(JNIEnv *__env, jclass clazz, jint flags) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)nvgCreateGL3(__env, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGL3_nnvgDelete(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgDeleteGL3(ctx); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVGGL3_nnvgluCreateFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint w, jint h, jint imageFlags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)nvgluCreateFramebufferGL3(ctx, w, h, imageFlags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGL3_nnvgluBindFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fbAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGLUframebuffer *fb = (NVGLUframebuffer *)(uintptr_t)fbAddress; - UNUSED_PARAMS(__env, clazz) - nvgluBindFramebufferGL3(ctx, fb); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGL3_nnvgluDeleteFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fbAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGLUframebuffer *fb = (NVGLUframebuffer *)(uintptr_t)fbAddress; - UNUSED_PARAMS(__env, clazz) - nvgluDeleteFramebufferGL3(ctx, fb); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGLES2.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGLES2.c deleted file mode 100644 index 43b9925c..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGLES2.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "lwjgl/lwjgl_malloc.h" -#define NVG_MALLOC(sz) org_lwjgl_malloc(sz) -#define NVG_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define NVG_FREE(p) org_lwjgl_free(p) -DISABLE_WARNINGS() -#define NANOVG_GLES2_IMPLEMENTATION -#include "nanovg.h" -#include "nanovg_gl.h" -#include "nanovg_gl_utils.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVGGLES2_nnvglCreateImageFromHandle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint textureId, jint w, jint h, jint flags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvglCreateImageFromHandleGLES2(ctx, (GLuint)textureId, w, h, flags); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVGGLES2_nnvglImageHandle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint image) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvglImageHandleGLES2(ctx, image); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVGGLES2_nnvgCreate(JNIEnv *__env, jclass clazz, jint flags) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)nvgCreateGLES2(__env, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGLES2_nnvgDelete(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgDeleteGLES2(ctx); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVGGLES2_nnvgluCreateFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint w, jint h, jint imageFlags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)nvgluCreateFramebufferGLES2(ctx, w, h, imageFlags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGLES2_nnvgluBindFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fbAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGLUframebuffer *fb = (NVGLUframebuffer *)(uintptr_t)fbAddress; - UNUSED_PARAMS(__env, clazz) - nvgluBindFramebufferGLES2(ctx, fb); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGLES2_nnvgluDeleteFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fbAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGLUframebuffer *fb = (NVGLUframebuffer *)(uintptr_t)fbAddress; - UNUSED_PARAMS(__env, clazz) - nvgluDeleteFramebufferGLES2(ctx, fb); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGLES3.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGLES3.c deleted file mode 100644 index 84fe24c3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_NanoVGGLES3.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "lwjgl/lwjgl_malloc.h" -#define NVG_MALLOC(sz) org_lwjgl_malloc(sz) -#define NVG_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define NVG_FREE(p) org_lwjgl_free(p) -DISABLE_WARNINGS() -#define NANOVG_GLES3_IMPLEMENTATION -#include "nanovg.h" -#include "nanovg_gl.h" -#include "nanovg_gl_utils.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVGGLES3_nnvglCreateImageFromHandle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint textureId, jint w, jint h, jint flags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvglCreateImageFromHandleGLES3(ctx, (GLuint)textureId, w, h, flags); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_NanoVGGLES3_nnvglImageHandle(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint image) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)nvglImageHandleGLES3(ctx, image); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVGGLES3_nnvgCreate(JNIEnv *__env, jclass clazz, jint flags) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)nvgCreateGLES3(__env, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGLES3_nnvgDelete(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - nvgDeleteGLES3(ctx); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_NanoVGGLES3_nnvgluCreateFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jint w, jint h, jint imageFlags) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)nvgluCreateFramebufferGLES3(ctx, w, h, imageFlags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGLES3_nnvgluBindFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fbAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGLUframebuffer *fb = (NVGLUframebuffer *)(uintptr_t)fbAddress; - UNUSED_PARAMS(__env, clazz) - nvgluBindFramebufferGLES3(ctx, fb); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_NanoVGGLES3_nnvgluDeleteFramebuffer(JNIEnv *__env, jclass clazz, jlong ctxAddress, jlong fbAddress) { - NVGcontext *ctx = (NVGcontext *)(uintptr_t)ctxAddress; - NVGLUframebuffer *fb = (NVGLUframebuffer *)(uintptr_t)fbAddress; - UNUSED_PARAMS(__env, clazz) - nvgluDeleteFramebufferGLES3(ctx, fb); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_OUI.c b/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_OUI.c deleted file mode 100644 index 45f44204..00000000 --- a/FCLauncher/src/main/jni/lwjgl/nanovg/org_lwjgl_nanovg_OUI.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" - -#include -#include -#include -#include "lwjgl/lwjgl_malloc.h" -#define OUI_IMPLEMENTATION -#include "lwjgl/oui.h" - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_OUI_uiCreateContext(JNIEnv *__env, jclass clazz, jint item_capacity, jint buffer_capacity) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)uiCreateContext((unsigned int)item_capacity, (unsigned int)buffer_capacity); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiMakeCurrent(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - UIcontext *ctx = (UIcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - uiMakeCurrent(ctx); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiDestroyContext(JNIEnv *__env, jclass clazz, jlong ctxAddress) { - UIcontext *ctx = (UIcontext *)(uintptr_t)ctxAddress; - UNUSED_PARAMS(__env, clazz) - uiDestroyContext(ctx); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_OUI_uiGetContext(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)uiGetContext(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetCursor(JNIEnv *__env, jclass clazz, jint x, jint y) { - UNUSED_PARAMS(__env, clazz) - uiSetCursor(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiGetCursor(JNIEnv *__env, jclass clazz, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((UIvec2*)(uintptr_t)__result) = uiGetCursor(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiGetCursorDelta(JNIEnv *__env, jclass clazz, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((UIvec2*)(uintptr_t)__result) = uiGetCursorDelta(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiGetCursorStart(JNIEnv *__env, jclass clazz, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((UIvec2*)(uintptr_t)__result) = uiGetCursorStart(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiGetCursorStartDelta(JNIEnv *__env, jclass clazz, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((UIvec2*)(uintptr_t)__result) = uiGetCursorStartDelta(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiSetButton(JNIEnv *__env, jclass clazz, jint button, jint mod, jint enabled) { - UNUSED_PARAMS(__env, clazz) - uiSetButton((unsigned int)button, (unsigned int)mod, enabled); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_nuiGetButton(JNIEnv *__env, jclass clazz, jint button) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetButton((unsigned int)button); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetClicks(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetClicks(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiSetKey(JNIEnv *__env, jclass clazz, jint key, jint mod, jint enabled) { - UNUSED_PARAMS(__env, clazz) - uiSetKey((unsigned int)key, (unsigned int)mod, enabled); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetChar(JNIEnv *__env, jclass clazz, jint value) { - UNUSED_PARAMS(__env, clazz) - uiSetChar((unsigned int)value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetScroll(JNIEnv *__env, jclass clazz, jint x, jint y) { - UNUSED_PARAMS(__env, clazz) - uiSetScroll(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiGetScroll(JNIEnv *__env, jclass clazz, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((UIvec2*)(uintptr_t)__result) = uiGetScroll(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiBeginLayout(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - uiBeginLayout(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiEndLayout(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - uiEndLayout(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiUpdateHotItem(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - uiUpdateHotItem(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiProcess(JNIEnv *__env, jclass clazz, jint timestamp) { - UNUSED_PARAMS(__env, clazz) - uiProcess(timestamp); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiClearState(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - uiClearState(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiItem(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiItem(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiSetFrozen(JNIEnv *__env, jclass clazz, jint item, jint enable) { - UNUSED_PARAMS(__env, clazz) - uiSetFrozen(item, enable); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetHandle(JNIEnv *__env, jclass clazz, jint item, jlong handleAddress) { - void *handle = (void *)(uintptr_t)handleAddress; - UNUSED_PARAMS(__env, clazz) - uiSetHandle(item, handle); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_OUI_nuiAllocHandle(JNIEnv *__env, jclass clazz, jint item, jint size) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)uiAllocHandle(item, (unsigned int)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiSetHandler(JNIEnv *__env, jclass clazz, jlong handlerAddress) { - UIhandler handler = (UIhandler)(uintptr_t)handlerAddress; - UNUSED_PARAMS(__env, clazz) - uiSetHandler(handler); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetEvents(JNIEnv *__env, jclass clazz, jint item, jint flags) { - UNUSED_PARAMS(__env, clazz) - uiSetEvents(item, (unsigned int)flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetFlags(JNIEnv *__env, jclass clazz, jint item, jint flags) { - UNUSED_PARAMS(__env, clazz) - uiSetFlags(item, (unsigned int)flags); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiInsert(JNIEnv *__env, jclass clazz, jint item, jint child) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiInsert(item, child); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiAppend(JNIEnv *__env, jclass clazz, jint item, jint sibling) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiAppend(item, sibling); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiInsertBack(JNIEnv *__env, jclass clazz, jint item, jint child) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiInsertBack(item, child); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiInsertFront(JNIEnv *__env, jclass clazz, jint item, jint child) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiInsertFront(item, child); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetSize(JNIEnv *__env, jclass clazz, jint item, jint w, jint h) { - UNUSED_PARAMS(__env, clazz) - uiSetSize(item, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetLayout(JNIEnv *__env, jclass clazz, jint item, jint flags) { - UNUSED_PARAMS(__env, clazz) - uiSetLayout(item, (unsigned int)flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiSetBox(JNIEnv *__env, jclass clazz, jint item, jint flags) { - UNUSED_PARAMS(__env, clazz) - uiSetBox(item, (unsigned int)flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiSetMargins(JNIEnv *__env, jclass clazz, jint item, jshort l, jshort t, jshort r, jshort b) { - UNUSED_PARAMS(__env, clazz) - uiSetMargins(item, l, t, r, b); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiFocus(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - uiFocus(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiFirstChild(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiFirstChild(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiNextSibling(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiNextSibling(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetItemCount(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetItemCount(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetAllocSize(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetAllocSize(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetState(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetState(item); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_OUI_uiGetHandle(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)uiGetHandle(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetHotItem(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetHotItem(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetFocusedItem(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetFocusedItem(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiFindItem(JNIEnv *__env, jclass clazz, jint item, jint x, jint y, jint flags, jint mask) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiFindItem(item, x, y, (unsigned int)flags, (unsigned int)mask); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_nanovg_OUI_nuiGetHandler(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)uiGetHandler(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetEvents(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetEvents(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetFlags(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetFlags(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetKey(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetKey(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetModifier(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetModifier(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_nuiGetRect(JNIEnv *__env, jclass clazz, jint item, jlong __result) { - UNUSED_PARAMS(__env, clazz) - *((UIrect*)(uintptr_t)__result) = uiGetRect(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_nuiContains(JNIEnv *__env, jclass clazz, jint item, jint x, jint y) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiContains(item, x, y); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetWidth(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetWidth(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetHeight(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetHeight(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetLayout(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetLayout(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetBox(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetBox(item); -} - -JNIEXPORT jshort JNICALL Java_org_lwjgl_nanovg_OUI_uiGetMarginLeft(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jshort)uiGetMarginLeft(item); -} - -JNIEXPORT jshort JNICALL Java_org_lwjgl_nanovg_OUI_uiGetMarginTop(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jshort)uiGetMarginTop(item); -} - -JNIEXPORT jshort JNICALL Java_org_lwjgl_nanovg_OUI_uiGetMarginRight(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jshort)uiGetMarginRight(item); -} - -JNIEXPORT jshort JNICALL Java_org_lwjgl_nanovg_OUI_uiGetMarginDown(JNIEnv *__env, jclass clazz, jint item) { - UNUSED_PARAMS(__env, clazz) - return (jshort)uiGetMarginDown(item); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiRecoverItem(JNIEnv *__env, jclass clazz, jint olditem) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiRecoverItem(olditem); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_nanovg_OUI_uiRemapItem(JNIEnv *__env, jclass clazz, jint olditem, jint newitem) { - UNUSED_PARAMS(__env, clazz) - uiRemapItem(olditem, newitem); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_nanovg_OUI_uiGetLastItemCount(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)uiGetLastItemCount(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/opengl.h b/FCLauncher/src/main/jni/lwjgl/opengl/opengl.h deleted file mode 100644 index a82008a7..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/opengl.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ -#pragma once -#include "lwjgl/common_tools.h" - -#ifdef LWJGL_WINDOWS - #define APIENTRY __stdcall -#else - #define APIENTRY -#endif - -#define tlsGetFunction(index) (uintptr_t)((void **)(*__env)->reserved3)[index] diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDDebugOutput.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDDebugOutput.c deleted file mode 100644 index b6bf5677..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDDebugOutput.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDebugMessageEnableAMDPROC) (jint, jint, jint, uintptr_t, jboolean); -typedef void (APIENTRY *glDebugMessageInsertAMDPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glDebugMessageCallbackAMDPROC) (uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetDebugMessageLogAMDPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDDebugOutput_nglDebugMessageEnableAMD__IIIJZ(JNIEnv *__env, jclass clazz, jint category, jint severity, jint count, jlong idsAddress, jboolean enabled) { - glDebugMessageEnableAMDPROC glDebugMessageEnableAMD = (glDebugMessageEnableAMDPROC)tlsGetFunction(1048); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glDebugMessageEnableAMD(category, severity, count, ids, enabled); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDDebugOutput_nglDebugMessageInsertAMD(JNIEnv *__env, jclass clazz, jint category, jint severity, jint id, jint length, jlong bufAddress) { - glDebugMessageInsertAMDPROC glDebugMessageInsertAMD = (glDebugMessageInsertAMDPROC)tlsGetFunction(1049); - uintptr_t buf = (uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - glDebugMessageInsertAMD(category, severity, id, length, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDDebugOutput_nglDebugMessageCallbackAMD(JNIEnv *__env, jclass clazz, jlong callbackAddress, jlong userParamAddress) { - glDebugMessageCallbackAMDPROC glDebugMessageCallbackAMD = (glDebugMessageCallbackAMDPROC)tlsGetFunction(1050); - uintptr_t callback = (uintptr_t)callbackAddress; - uintptr_t userParam = (uintptr_t)userParamAddress; - UNUSED_PARAM(clazz) - glDebugMessageCallbackAMD(callback, userParam); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_AMDDebugOutput_nglGetDebugMessageLogAMD__IIJJJJJ(JNIEnv *__env, jclass clazz, jint count, jint bufsize, jlong categoriesAddress, jlong severitiesAddress, jlong idsAddress, jlong lengthsAddress, jlong messageLogAddress) { - glGetDebugMessageLogAMDPROC glGetDebugMessageLogAMD = (glGetDebugMessageLogAMDPROC)tlsGetFunction(1051); - uintptr_t categories = (uintptr_t)categoriesAddress; - uintptr_t severities = (uintptr_t)severitiesAddress; - uintptr_t ids = (uintptr_t)idsAddress; - uintptr_t lengths = (uintptr_t)lengthsAddress; - uintptr_t messageLog = (uintptr_t)messageLogAddress; - UNUSED_PARAM(clazz) - return glGetDebugMessageLogAMD(count, bufsize, categories, severities, ids, lengths, messageLog); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDDrawBuffersBlend.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDDrawBuffersBlend.c deleted file mode 100644 index 2a17fe0a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDDrawBuffersBlend.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendFuncIndexedAMDPROC) (jint, jint, jint); -typedef void (APIENTRY *glBlendFuncSeparateIndexedAMDPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glBlendEquationIndexedAMDPROC) (jint, jint); -typedef void (APIENTRY *glBlendEquationSeparateIndexedAMDPROC) (jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDDrawBuffersBlend_glBlendFuncIndexedAMD(JNIEnv *__env, jclass clazz, jint buf, jint src, jint dst) { - glBlendFuncIndexedAMDPROC glBlendFuncIndexedAMD = (glBlendFuncIndexedAMDPROC)tlsGetFunction(1052); - UNUSED_PARAM(clazz) - glBlendFuncIndexedAMD(buf, src, dst); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDDrawBuffersBlend_glBlendFuncSeparateIndexedAMD(JNIEnv *__env, jclass clazz, jint buf, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { - glBlendFuncSeparateIndexedAMDPROC glBlendFuncSeparateIndexedAMD = (glBlendFuncSeparateIndexedAMDPROC)tlsGetFunction(1053); - UNUSED_PARAM(clazz) - glBlendFuncSeparateIndexedAMD(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDDrawBuffersBlend_glBlendEquationIndexedAMD(JNIEnv *__env, jclass clazz, jint buf, jint mode) { - glBlendEquationIndexedAMDPROC glBlendEquationIndexedAMD = (glBlendEquationIndexedAMDPROC)tlsGetFunction(1054); - UNUSED_PARAM(clazz) - glBlendEquationIndexedAMD(buf, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDDrawBuffersBlend_glBlendEquationSeparateIndexedAMD(JNIEnv *__env, jclass clazz, jint buf, jint modeRGB, jint modeAlpha) { - glBlendEquationSeparateIndexedAMDPROC glBlendEquationSeparateIndexedAMD = (glBlendEquationSeparateIndexedAMDPROC)tlsGetFunction(1055); - UNUSED_PARAM(clazz) - glBlendEquationSeparateIndexedAMD(buf, modeRGB, modeAlpha); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDFramebufferMultisampleAdvanced.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDFramebufferMultisampleAdvanced.c deleted file mode 100644 index b03cdff2..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDFramebufferMultisampleAdvanced.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glRenderbufferStorageMultisampleAdvancedAMDPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedRenderbufferStorageMultisampleAdvancedAMDPROC) (jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDFramebufferMultisampleAdvanced_glRenderbufferStorageMultisampleAdvancedAMD(JNIEnv *__env, jclass clazz, jint target, jint samples, jint storageSamples, jint internalformat, jint width, jint height) { - glRenderbufferStorageMultisampleAdvancedAMDPROC glRenderbufferStorageMultisampleAdvancedAMD = (glRenderbufferStorageMultisampleAdvancedAMDPROC)tlsGetFunction(1056); - UNUSED_PARAM(clazz) - glRenderbufferStorageMultisampleAdvancedAMD(target, samples, storageSamples, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDFramebufferMultisampleAdvanced_glNamedRenderbufferStorageMultisampleAdvancedAMD(JNIEnv *__env, jclass clazz, jint renderbuffer, jint samples, jint storageSamples, jint internalformat, jint width, jint height) { - glNamedRenderbufferStorageMultisampleAdvancedAMDPROC glNamedRenderbufferStorageMultisampleAdvancedAMD = (glNamedRenderbufferStorageMultisampleAdvancedAMDPROC)tlsGetFunction(1057); - UNUSED_PARAM(clazz) - glNamedRenderbufferStorageMultisampleAdvancedAMD(renderbuffer, samples, storageSamples, internalformat, width, height); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDInterleavedElements.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDInterleavedElements.c deleted file mode 100644 index fcbc1e50..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDInterleavedElements.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexAttribParameteriAMDPROC) (jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDInterleavedElements_glVertexAttribParameteriAMD(JNIEnv *__env, jclass clazz, jint index, jint pname, jint param) { - glVertexAttribParameteriAMDPROC glVertexAttribParameteriAMD = (glVertexAttribParameteriAMDPROC)tlsGetFunction(1092); - UNUSED_PARAM(clazz) - glVertexAttribParameteriAMD(index, pname, param); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDOcclusionQueryEvent.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDOcclusionQueryEvent.c deleted file mode 100644 index 3d9b5284..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDOcclusionQueryEvent.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glQueryObjectParameteruiAMDPROC) (jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDOcclusionQueryEvent_glQueryObjectParameteruiAMD(JNIEnv *__env, jclass clazz, jint target, jint id, jint pname, jint param) { - glQueryObjectParameteruiAMDPROC glQueryObjectParameteruiAMD = (glQueryObjectParameteruiAMDPROC)tlsGetFunction(1093); - UNUSED_PARAM(clazz) - glQueryObjectParameteruiAMD(target, id, pname, param); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDPerformanceMonitor.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDPerformanceMonitor.c deleted file mode 100644 index a3c36d29..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDPerformanceMonitor.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetPerfMonitorGroupsAMDPROC) (uintptr_t, jint, uintptr_t); -typedef void (APIENTRY *glGetPerfMonitorCountersAMDPROC) (jint, uintptr_t, uintptr_t, jint, uintptr_t); -typedef void (APIENTRY *glGetPerfMonitorGroupStringAMDPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetPerfMonitorCounterStringAMDPROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetPerfMonitorCounterInfoAMDPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGenPerfMonitorsAMDPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeletePerfMonitorsAMDPROC) (jint, uintptr_t); -typedef void (APIENTRY *glSelectPerfMonitorCountersAMDPROC) (jint, jboolean, jint, jint, uintptr_t); -typedef void (APIENTRY *glBeginPerfMonitorAMDPROC) (jint); -typedef void (APIENTRY *glEndPerfMonitorAMDPROC) (jint); -typedef void (APIENTRY *glGetPerfMonitorCounterDataAMDPROC) (jint, jint, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglGetPerfMonitorGroupsAMD__JIJ(JNIEnv *__env, jclass clazz, jlong numGroupsAddress, jint groupsSize, jlong groupsAddress) { - glGetPerfMonitorGroupsAMDPROC glGetPerfMonitorGroupsAMD = (glGetPerfMonitorGroupsAMDPROC)tlsGetFunction(1094); - uintptr_t numGroups = (uintptr_t)numGroupsAddress; - uintptr_t groups = (uintptr_t)groupsAddress; - UNUSED_PARAM(clazz) - glGetPerfMonitorGroupsAMD(numGroups, groupsSize, groups); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglGetPerfMonitorCountersAMD__IJJIJ(JNIEnv *__env, jclass clazz, jint group, jlong numCountersAddress, jlong maxActiveCountersAddress, jint counterSize, jlong countersAddress) { - glGetPerfMonitorCountersAMDPROC glGetPerfMonitorCountersAMD = (glGetPerfMonitorCountersAMDPROC)tlsGetFunction(1095); - uintptr_t numCounters = (uintptr_t)numCountersAddress; - uintptr_t maxActiveCounters = (uintptr_t)maxActiveCountersAddress; - uintptr_t counters = (uintptr_t)countersAddress; - UNUSED_PARAM(clazz) - glGetPerfMonitorCountersAMD(group, numCounters, maxActiveCounters, counterSize, counters); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglGetPerfMonitorGroupStringAMD__IIJJ(JNIEnv *__env, jclass clazz, jint group, jint bufSize, jlong lengthAddress, jlong groupStringAddress) { - glGetPerfMonitorGroupStringAMDPROC glGetPerfMonitorGroupStringAMD = (glGetPerfMonitorGroupStringAMDPROC)tlsGetFunction(1096); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t groupString = (uintptr_t)groupStringAddress; - UNUSED_PARAM(clazz) - glGetPerfMonitorGroupStringAMD(group, bufSize, length, groupString); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglGetPerfMonitorCounterStringAMD__IIIJJ(JNIEnv *__env, jclass clazz, jint group, jint counter, jint bufSize, jlong lengthAddress, jlong counterStringAddress) { - glGetPerfMonitorCounterStringAMDPROC glGetPerfMonitorCounterStringAMD = (glGetPerfMonitorCounterStringAMDPROC)tlsGetFunction(1097); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t counterString = (uintptr_t)counterStringAddress; - UNUSED_PARAM(clazz) - glGetPerfMonitorCounterStringAMD(group, counter, bufSize, length, counterString); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglGetPerfMonitorCounterInfoAMD__IIIJ(JNIEnv *__env, jclass clazz, jint group, jint counter, jint pname, jlong dataAddress) { - glGetPerfMonitorCounterInfoAMDPROC glGetPerfMonitorCounterInfoAMD = (glGetPerfMonitorCounterInfoAMDPROC)tlsGetFunction(1098); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetPerfMonitorCounterInfoAMD(group, counter, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglGenPerfMonitorsAMD__IJ(JNIEnv *__env, jclass clazz, jint n, jlong monitorsAddress) { - glGenPerfMonitorsAMDPROC glGenPerfMonitorsAMD = (glGenPerfMonitorsAMDPROC)tlsGetFunction(1099); - uintptr_t monitors = (uintptr_t)monitorsAddress; - UNUSED_PARAM(clazz) - glGenPerfMonitorsAMD(n, monitors); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglDeletePerfMonitorsAMD__IJ(JNIEnv *__env, jclass clazz, jint n, jlong monitorsAddress) { - glDeletePerfMonitorsAMDPROC glDeletePerfMonitorsAMD = (glDeletePerfMonitorsAMDPROC)tlsGetFunction(1100); - uintptr_t monitors = (uintptr_t)monitorsAddress; - UNUSED_PARAM(clazz) - glDeletePerfMonitorsAMD(n, monitors); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglSelectPerfMonitorCountersAMD__IZIIJ(JNIEnv *__env, jclass clazz, jint monitor, jboolean enable, jint group, jint numCounters, jlong counterListAddress) { - glSelectPerfMonitorCountersAMDPROC glSelectPerfMonitorCountersAMD = (glSelectPerfMonitorCountersAMDPROC)tlsGetFunction(1101); - uintptr_t counterList = (uintptr_t)counterListAddress; - UNUSED_PARAM(clazz) - glSelectPerfMonitorCountersAMD(monitor, enable, group, numCounters, counterList); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_glBeginPerfMonitorAMD(JNIEnv *__env, jclass clazz, jint monitor) { - glBeginPerfMonitorAMDPROC glBeginPerfMonitorAMD = (glBeginPerfMonitorAMDPROC)tlsGetFunction(1102); - UNUSED_PARAM(clazz) - glBeginPerfMonitorAMD(monitor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_glEndPerfMonitorAMD(JNIEnv *__env, jclass clazz, jint monitor) { - glEndPerfMonitorAMDPROC glEndPerfMonitorAMD = (glEndPerfMonitorAMDPROC)tlsGetFunction(1103); - UNUSED_PARAM(clazz) - glEndPerfMonitorAMD(monitor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDPerformanceMonitor_nglGetPerfMonitorCounterDataAMD__IIIJJ(JNIEnv *__env, jclass clazz, jint monitor, jint pname, jint dataSize, jlong dataAddress, jlong bytesWrittenAddress) { - glGetPerfMonitorCounterDataAMDPROC glGetPerfMonitorCounterDataAMD = (glGetPerfMonitorCounterDataAMDPROC)tlsGetFunction(1104); - uintptr_t data = (uintptr_t)dataAddress; - uintptr_t bytesWritten = (uintptr_t)bytesWrittenAddress; - UNUSED_PARAM(clazz) - glGetPerfMonitorCounterDataAMD(monitor, pname, dataSize, data, bytesWritten); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDSamplePositions.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDSamplePositions.c deleted file mode 100644 index 7f7aed7b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDSamplePositions.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glSetMultisamplefvAMDPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDSamplePositions_nglSetMultisamplefvAMD__IIJ(JNIEnv *__env, jclass clazz, jint pname, jint index, jlong valAddress) { - glSetMultisamplefvAMDPROC glSetMultisamplefvAMD = (glSetMultisamplefvAMDPROC)tlsGetFunction(1105); - uintptr_t val = (uintptr_t)valAddress; - UNUSED_PARAM(clazz) - glSetMultisamplefvAMD(pname, index, val); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDSparseTexture.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDSparseTexture.c deleted file mode 100644 index 28ec1366..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDSparseTexture.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTexStorageSparseAMDPROC) (jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorageSparseAMDPROC) (jint, jint, jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDSparseTexture_glTexStorageSparseAMD(JNIEnv *__env, jclass clazz, jint target, jint internalFormat, jint width, jint height, jint depth, jint layers, jint flags) { - glTexStorageSparseAMDPROC glTexStorageSparseAMD = (glTexStorageSparseAMDPROC)tlsGetFunction(1106); - UNUSED_PARAM(clazz) - glTexStorageSparseAMD(target, internalFormat, width, height, depth, layers, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDSparseTexture_glTextureStorageSparseAMD(JNIEnv *__env, jclass clazz, jint texture, jint target, jint internalFormat, jint width, jint height, jint depth, jint layers, jint flags) { - glTextureStorageSparseAMDPROC glTextureStorageSparseAMD = (glTextureStorageSparseAMDPROC)tlsGetFunction(1107); - UNUSED_PARAM(clazz) - glTextureStorageSparseAMD(texture, target, internalFormat, width, height, depth, layers, flags); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDStencilOperationExtended.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDStencilOperationExtended.c deleted file mode 100644 index 1b956e69..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDStencilOperationExtended.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glStencilOpValueAMDPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDStencilOperationExtended_glStencilOpValueAMD(JNIEnv *__env, jclass clazz, jint face, jint value) { - glStencilOpValueAMDPROC glStencilOpValueAMD = (glStencilOpValueAMDPROC)tlsGetFunction(1108); - UNUSED_PARAM(clazz) - glStencilOpValueAMD(face, value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDVertexShaderTessellator.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDVertexShaderTessellator.c deleted file mode 100644 index ce6b1ff3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_AMDVertexShaderTessellator.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTessellationFactorAMDPROC) (jfloat); -typedef void (APIENTRY *glTessellationModeAMDPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDVertexShaderTessellator_glTessellationFactorAMD(JNIEnv *__env, jclass clazz, jfloat factor) { - glTessellationFactorAMDPROC glTessellationFactorAMD = (glTessellationFactorAMDPROC)tlsGetFunction(1109); - UNUSED_PARAM(clazz) - glTessellationFactorAMD(factor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_AMDVertexShaderTessellator_glTessellationModeAMD(JNIEnv *__env, jclass clazz, jint mode) { - glTessellationModeAMDPROC glTessellationModeAMD = (glTessellationModeAMDPROC)tlsGetFunction(1110); - UNUSED_PARAM(clazz) - glTessellationModeAMD(mode); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBBindlessTexture.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBBindlessTexture.c deleted file mode 100644 index a2081bac..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBBindlessTexture.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jlong (APIENTRY *glGetTextureHandleARBPROC) (jint); -typedef jlong (APIENTRY *glGetTextureSamplerHandleARBPROC) (jint, jint); -typedef void (APIENTRY *glMakeTextureHandleResidentARBPROC) (jlong); -typedef void (APIENTRY *glMakeTextureHandleNonResidentARBPROC) (jlong); -typedef jlong (APIENTRY *glGetImageHandleARBPROC) (jint, jint, jboolean, jint, jint); -typedef void (APIENTRY *glMakeImageHandleResidentARBPROC) (jlong, jint); -typedef void (APIENTRY *glMakeImageHandleNonResidentARBPROC) (jlong); -typedef void (APIENTRY *glUniformHandleui64ARBPROC) (jint, jlong); -typedef void (APIENTRY *glUniformHandleui64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniformHandleui64ARBPROC) (jint, jint, jlong); -typedef void (APIENTRY *glProgramUniformHandleui64vARBPROC) (jint, jint, jint, uintptr_t); -typedef jboolean (APIENTRY *glIsTextureHandleResidentARBPROC) (jlong); -typedef jboolean (APIENTRY *glIsImageHandleResidentARBPROC) (jlong); -typedef void (APIENTRY *glVertexAttribL1ui64ARBPROC) (jint, jlong); -typedef void (APIENTRY *glVertexAttribL1ui64vARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribLui64vARBPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glGetTextureHandleARB(JNIEnv *__env, jclass clazz, jint texture) { - glGetTextureHandleARBPROC glGetTextureHandleARB = (glGetTextureHandleARBPROC)tlsGetFunction(1111); - UNUSED_PARAM(clazz) - return glGetTextureHandleARB(texture); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glGetTextureSamplerHandleARB(JNIEnv *__env, jclass clazz, jint texture, jint sampler) { - glGetTextureSamplerHandleARBPROC glGetTextureSamplerHandleARB = (glGetTextureSamplerHandleARBPROC)tlsGetFunction(1112); - UNUSED_PARAM(clazz) - return glGetTextureSamplerHandleARB(texture, sampler); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glMakeTextureHandleResidentARB(JNIEnv *__env, jclass clazz, jlong handle) { - glMakeTextureHandleResidentARBPROC glMakeTextureHandleResidentARB = (glMakeTextureHandleResidentARBPROC)tlsGetFunction(1113); - UNUSED_PARAM(clazz) - glMakeTextureHandleResidentARB(handle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glMakeTextureHandleNonResidentARB(JNIEnv *__env, jclass clazz, jlong handle) { - glMakeTextureHandleNonResidentARBPROC glMakeTextureHandleNonResidentARB = (glMakeTextureHandleNonResidentARBPROC)tlsGetFunction(1114); - UNUSED_PARAM(clazz) - glMakeTextureHandleNonResidentARB(handle); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glGetImageHandleARB(JNIEnv *__env, jclass clazz, jint texture, jint level, jboolean layered, jint layer, jint format) { - glGetImageHandleARBPROC glGetImageHandleARB = (glGetImageHandleARBPROC)tlsGetFunction(1115); - UNUSED_PARAM(clazz) - return glGetImageHandleARB(texture, level, layered, layer, format); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glMakeImageHandleResidentARB(JNIEnv *__env, jclass clazz, jlong handle, jint access) { - glMakeImageHandleResidentARBPROC glMakeImageHandleResidentARB = (glMakeImageHandleResidentARBPROC)tlsGetFunction(1116); - UNUSED_PARAM(clazz) - glMakeImageHandleResidentARB(handle, access); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glMakeImageHandleNonResidentARB(JNIEnv *__env, jclass clazz, jlong handle) { - glMakeImageHandleNonResidentARBPROC glMakeImageHandleNonResidentARB = (glMakeImageHandleNonResidentARBPROC)tlsGetFunction(1117); - UNUSED_PARAM(clazz) - glMakeImageHandleNonResidentARB(handle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glUniformHandleui64ARB(JNIEnv *__env, jclass clazz, jint location, jlong value) { - glUniformHandleui64ARBPROC glUniformHandleui64ARB = (glUniformHandleui64ARBPROC)tlsGetFunction(1118); - UNUSED_PARAM(clazz) - glUniformHandleui64ARB(location, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_nglUniformHandleui64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valuesAddress) { - glUniformHandleui64vARBPROC glUniformHandleui64vARB = (glUniformHandleui64vARBPROC)tlsGetFunction(1119); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glUniformHandleui64vARB(location, count, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glProgramUniformHandleui64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong value) { - glProgramUniformHandleui64ARBPROC glProgramUniformHandleui64ARB = (glProgramUniformHandleui64ARBPROC)tlsGetFunction(1120); - UNUSED_PARAM(clazz) - glProgramUniformHandleui64ARB(program, location, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_nglProgramUniformHandleui64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valuesAddress) { - glProgramUniformHandleui64vARBPROC glProgramUniformHandleui64vARB = (glProgramUniformHandleui64vARBPROC)tlsGetFunction(1121); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glProgramUniformHandleui64vARB(program, location, count, values); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glIsTextureHandleResidentARB(JNIEnv *__env, jclass clazz, jlong handle) { - glIsTextureHandleResidentARBPROC glIsTextureHandleResidentARB = (glIsTextureHandleResidentARBPROC)tlsGetFunction(1122); - UNUSED_PARAM(clazz) - return glIsTextureHandleResidentARB(handle); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glIsImageHandleResidentARB(JNIEnv *__env, jclass clazz, jlong handle) { - glIsImageHandleResidentARBPROC glIsImageHandleResidentARB = (glIsImageHandleResidentARBPROC)tlsGetFunction(1123); - UNUSED_PARAM(clazz) - return glIsImageHandleResidentARB(handle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_glVertexAttribL1ui64ARB(JNIEnv *__env, jclass clazz, jint index, jlong x) { - glVertexAttribL1ui64ARBPROC glVertexAttribL1ui64ARB = (glVertexAttribL1ui64ARBPROC)tlsGetFunction(1124); - UNUSED_PARAM(clazz) - glVertexAttribL1ui64ARB(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_nglVertexAttribL1ui64vARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL1ui64vARBPROC glVertexAttribL1ui64vARB = (glVertexAttribL1ui64vARBPROC)tlsGetFunction(1125); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL1ui64vARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBindlessTexture_nglGetVertexAttribLui64vARB__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribLui64vARBPROC glGetVertexAttribLui64vARB = (glGetVertexAttribLui64vARBPROC)tlsGetFunction(1126); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribLui64vARB(index, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBBufferStorage.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBBufferStorage.c deleted file mode 100644 index f262a278..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBBufferStorage.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glNamedBufferStorageEXTPROC) (jint, uintptr_t, uintptr_t, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBBufferStorage_nglNamedBufferStorageEXT__IJJI(JNIEnv *__env, jclass clazz, jint buffer, jlong size, jlong dataAddress, jint flags) { - glNamedBufferStorageEXTPROC glNamedBufferStorageEXT = (glNamedBufferStorageEXTPROC)tlsGetFunction(1127); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glNamedBufferStorageEXT(buffer, (uintptr_t)size, data, flags); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBCLEvent.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBCLEvent.c deleted file mode 100644 index 230fdf34..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBCLEvent.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef uintptr_t (APIENTRY *glCreateSyncFromCLeventARBPROC) (uintptr_t, uintptr_t, jint); - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_ARBCLEvent_nglCreateSyncFromCLeventARB(JNIEnv *__env, jclass clazz, jlong contextAddress, jlong eventAddress, jint flags) { - glCreateSyncFromCLeventARBPROC glCreateSyncFromCLeventARB = (glCreateSyncFromCLeventARBPROC)tlsGetFunction(1128); - uintptr_t context = (uintptr_t)contextAddress; - uintptr_t event = (uintptr_t)eventAddress; - UNUSED_PARAM(clazz) - return (jlong)glCreateSyncFromCLeventARB(context, event, flags); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBClearBufferObject.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBClearBufferObject.c deleted file mode 100644 index edb37974..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBClearBufferObject.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glClearNamedBufferDataEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glClearNamedBufferSubDataEXTPROC) (jint, jint, uintptr_t, uintptr_t, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBClearBufferObject_nglClearNamedBufferDataEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint buffer, jint internalformat, jint format, jint type, jlong dataAddress) { - glClearNamedBufferDataEXTPROC glClearNamedBufferDataEXT = (glClearNamedBufferDataEXTPROC)tlsGetFunction(1128); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glClearNamedBufferDataEXT(buffer, internalformat, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBClearBufferObject_nglClearNamedBufferSubDataEXT__IIJJIIJ(JNIEnv *__env, jclass clazz, jint buffer, jint internalformat, jlong offset, jlong size, jint format, jint type, jlong dataAddress) { - glClearNamedBufferSubDataEXTPROC glClearNamedBufferSubDataEXT = (glClearNamedBufferSubDataEXTPROC)tlsGetFunction(1129); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glClearNamedBufferSubDataEXT(buffer, internalformat, (uintptr_t)offset, (uintptr_t)size, format, type, data); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBColorBufferFloat.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBColorBufferFloat.c deleted file mode 100644 index ef5a6dfa..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBColorBufferFloat.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glClampColorARBPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBColorBufferFloat_glClampColorARB(JNIEnv *__env, jclass clazz, jint target, jint clamp) { - glClampColorARBPROC glClampColorARB = (glClampColorARBPROC)tlsGetFunction(1130); - UNUSED_PARAM(clazz) - glClampColorARB(target, clamp); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBComputeVariableGroupSize.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBComputeVariableGroupSize.c deleted file mode 100644 index 79901baa..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBComputeVariableGroupSize.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDispatchComputeGroupSizeARBPROC) (jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBComputeVariableGroupSize_glDispatchComputeGroupSizeARB(JNIEnv *__env, jclass clazz, jint num_groups_x, jint num_groups_y, jint num_groups_z, jint group_size_x, jint group_size_y, jint group_size_z) { - glDispatchComputeGroupSizeARBPROC glDispatchComputeGroupSizeARB = (glDispatchComputeGroupSizeARBPROC)tlsGetFunction(1131); - UNUSED_PARAM(clazz) - glDispatchComputeGroupSizeARB(num_groups_x, num_groups_y, num_groups_z, group_size_x, group_size_y, group_size_z); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDebugOutput.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDebugOutput.c deleted file mode 100644 index 9e3b90c6..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDebugOutput.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDebugMessageControlARBPROC) (jint, jint, jint, jint, uintptr_t, jboolean); -typedef void (APIENTRY *glDebugMessageInsertARBPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glDebugMessageCallbackARBPROC) (uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetDebugMessageLogARBPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDebugOutput_nglDebugMessageControlARB__IIIIJZ(JNIEnv *__env, jclass clazz, jint source, jint type, jint severity, jint count, jlong idsAddress, jboolean enabled) { - glDebugMessageControlARBPROC glDebugMessageControlARB = (glDebugMessageControlARBPROC)tlsGetFunction(1132); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glDebugMessageControlARB(source, type, severity, count, ids, enabled); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDebugOutput_nglDebugMessageInsertARB(JNIEnv *__env, jclass clazz, jint source, jint type, jint id, jint severity, jint length, jlong bufAddress) { - glDebugMessageInsertARBPROC glDebugMessageInsertARB = (glDebugMessageInsertARBPROC)tlsGetFunction(1133); - uintptr_t buf = (uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - glDebugMessageInsertARB(source, type, id, severity, length, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDebugOutput_nglDebugMessageCallbackARB(JNIEnv *__env, jclass clazz, jlong callbackAddress, jlong userParamAddress) { - glDebugMessageCallbackARBPROC glDebugMessageCallbackARB = (glDebugMessageCallbackARBPROC)tlsGetFunction(1134); - uintptr_t callback = (uintptr_t)callbackAddress; - uintptr_t userParam = (uintptr_t)userParamAddress; - UNUSED_PARAM(clazz) - glDebugMessageCallbackARB(callback, userParam); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_ARBDebugOutput_nglGetDebugMessageLogARB__IIJJJJJJ(JNIEnv *__env, jclass clazz, jint count, jint bufSize, jlong sourcesAddress, jlong typesAddress, jlong idsAddress, jlong severitiesAddress, jlong lengthsAddress, jlong messageLogAddress) { - glGetDebugMessageLogARBPROC glGetDebugMessageLogARB = (glGetDebugMessageLogARBPROC)tlsGetFunction(1135); - uintptr_t sources = (uintptr_t)sourcesAddress; - uintptr_t types = (uintptr_t)typesAddress; - uintptr_t ids = (uintptr_t)idsAddress; - uintptr_t severities = (uintptr_t)severitiesAddress; - uintptr_t lengths = (uintptr_t)lengthsAddress; - uintptr_t messageLog = (uintptr_t)messageLogAddress; - UNUSED_PARAM(clazz) - return glGetDebugMessageLogARB(count, bufSize, sources, types, ids, severities, lengths, messageLog); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawBuffers.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawBuffers.c deleted file mode 100644 index c47ca9f3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawBuffers.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDrawBuffersARBPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawBuffers_nglDrawBuffersARB__IJ(JNIEnv *__env, jclass clazz, jint n, jlong bufsAddress) { - glDrawBuffersARBPROC glDrawBuffersARB = (glDrawBuffersARBPROC)tlsGetFunction(1136); - uintptr_t bufs = (uintptr_t)bufsAddress; - UNUSED_PARAM(clazz) - glDrawBuffersARB(n, bufs); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawBuffersBlend.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawBuffersBlend.c deleted file mode 100644 index 75b32331..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawBuffersBlend.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendEquationiARBPROC) (jint, jint); -typedef void (APIENTRY *glBlendEquationSeparateiARBPROC) (jint, jint, jint); -typedef void (APIENTRY *glBlendFunciARBPROC) (jint, jint, jint); -typedef void (APIENTRY *glBlendFuncSeparateiARBPROC) (jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawBuffersBlend_glBlendEquationiARB(JNIEnv *__env, jclass clazz, jint buf, jint mode) { - glBlendEquationiARBPROC glBlendEquationiARB = (glBlendEquationiARBPROC)tlsGetFunction(1137); - UNUSED_PARAM(clazz) - glBlendEquationiARB(buf, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawBuffersBlend_glBlendEquationSeparateiARB(JNIEnv *__env, jclass clazz, jint buf, jint modeRGB, jint modeAlpha) { - glBlendEquationSeparateiARBPROC glBlendEquationSeparateiARB = (glBlendEquationSeparateiARBPROC)tlsGetFunction(1138); - UNUSED_PARAM(clazz) - glBlendEquationSeparateiARB(buf, modeRGB, modeAlpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawBuffersBlend_glBlendFunciARB(JNIEnv *__env, jclass clazz, jint buf, jint src, jint dst) { - glBlendFunciARBPROC glBlendFunciARB = (glBlendFunciARBPROC)tlsGetFunction(1139); - UNUSED_PARAM(clazz) - glBlendFunciARB(buf, src, dst); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawBuffersBlend_glBlendFuncSeparateiARB(JNIEnv *__env, jclass clazz, jint buf, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { - glBlendFuncSeparateiARBPROC glBlendFuncSeparateiARB = (glBlendFuncSeparateiARBPROC)tlsGetFunction(1140); - UNUSED_PARAM(clazz) - glBlendFuncSeparateiARB(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawInstanced.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawInstanced.c deleted file mode 100644 index b8c73be6..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBDrawInstanced.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDrawArraysInstancedARBPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glDrawElementsInstancedARBPROC) (jint, jint, jint, uintptr_t, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawInstanced_glDrawArraysInstancedARB(JNIEnv *__env, jclass clazz, jint mode, jint first, jint count, jint primcount) { - glDrawArraysInstancedARBPROC glDrawArraysInstancedARB = (glDrawArraysInstancedARBPROC)tlsGetFunction(1141); - UNUSED_PARAM(clazz) - glDrawArraysInstancedARB(mode, first, count, primcount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawInstanced_nglDrawElementsInstancedARB(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress, jint primcount) { - glDrawElementsInstancedARBPROC glDrawElementsInstancedARB = (glDrawElementsInstancedARBPROC)tlsGetFunction(1142); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawElementsInstancedARB(mode, count, type, indices, primcount); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBES32Compatibility.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBES32Compatibility.c deleted file mode 100644 index 4d4768aa..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBES32Compatibility.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glPrimitiveBoundingBoxARBPROC) (jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBES32Compatibility_glPrimitiveBoundingBoxARB(JNIEnv *__env, jclass clazz, jfloat minX, jfloat minY, jfloat minZ, jfloat minW, jfloat maxX, jfloat maxY, jfloat maxZ, jfloat maxW) { - glPrimitiveBoundingBoxARBPROC glPrimitiveBoundingBoxARB = (glPrimitiveBoundingBoxARBPROC)tlsGetFunction(1143); - UNUSED_PARAM(clazz) - glPrimitiveBoundingBoxARB(minX, minY, minZ, minW, maxX, maxY, maxZ, maxW); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBFramebufferNoAttachments.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBFramebufferNoAttachments.c deleted file mode 100644 index 6f0a587b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBFramebufferNoAttachments.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glNamedFramebufferParameteriEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glGetNamedFramebufferParameterivEXTPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBFramebufferNoAttachments_glNamedFramebufferParameteriEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint pname, jint param) { - glNamedFramebufferParameteriEXTPROC glNamedFramebufferParameteriEXT = (glNamedFramebufferParameteriEXTPROC)tlsGetFunction(1144); - UNUSED_PARAM(clazz) - glNamedFramebufferParameteriEXT(framebuffer, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBFramebufferNoAttachments_nglGetNamedFramebufferParameterivEXT__IIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint pname, jlong paramsAddress) { - glGetNamedFramebufferParameterivEXTPROC glGetNamedFramebufferParameterivEXT = (glGetNamedFramebufferParameterivEXTPROC)tlsGetFunction(1145); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedFramebufferParameterivEXT(framebuffer, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGLSPIRV.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGLSPIRV.c deleted file mode 100644 index f8feaea9..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGLSPIRV.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glSpecializeShaderARBPROC) (jint, uintptr_t, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGLSPIRV_nglSpecializeShaderARB__IJIJJ(JNIEnv *__env, jclass clazz, jint shader, jlong pEntryPointAddress, jint numSpecializationConstants, jlong pConstantIndexAddress, jlong pConstantValueAddress) { - glSpecializeShaderARBPROC glSpecializeShaderARB = (glSpecializeShaderARBPROC)tlsGetFunction(1150); - uintptr_t pEntryPoint = (uintptr_t)pEntryPointAddress; - uintptr_t pConstantIndex = (uintptr_t)pConstantIndexAddress; - uintptr_t pConstantValue = (uintptr_t)pConstantValueAddress; - UNUSED_PARAM(clazz) - glSpecializeShaderARB(shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGPUShaderFP64.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGPUShaderFP64.c deleted file mode 100644 index 5912b065..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGPUShaderFP64.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glProgramUniform1dEXTPROC) (jint, jint, jdouble); -typedef void (APIENTRY *glProgramUniform2dEXTPROC) (jint, jint, jdouble, jdouble); -typedef void (APIENTRY *glProgramUniform3dEXTPROC) (jint, jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glProgramUniform4dEXTPROC) (jint, jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glProgramUniform1dvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2dvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3dvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4dvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2x3dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2x4dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3x2dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3x4dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4x2dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4x3dvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_glProgramUniform1dEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jdouble x) { - glProgramUniform1dEXTPROC glProgramUniform1dEXT = (glProgramUniform1dEXTPROC)tlsGetFunction(1151); - UNUSED_PARAM(clazz) - glProgramUniform1dEXT(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_glProgramUniform2dEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jdouble x, jdouble y) { - glProgramUniform2dEXTPROC glProgramUniform2dEXT = (glProgramUniform2dEXTPROC)tlsGetFunction(1152); - UNUSED_PARAM(clazz) - glProgramUniform2dEXT(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_glProgramUniform3dEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jdouble x, jdouble y, jdouble z) { - glProgramUniform3dEXTPROC glProgramUniform3dEXT = (glProgramUniform3dEXTPROC)tlsGetFunction(1153); - UNUSED_PARAM(clazz) - glProgramUniform3dEXT(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_glProgramUniform4dEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jdouble x, jdouble y, jdouble z, jdouble w) { - glProgramUniform4dEXTPROC glProgramUniform4dEXT = (glProgramUniform4dEXTPROC)tlsGetFunction(1154); - UNUSED_PARAM(clazz) - glProgramUniform4dEXT(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniform1dvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1dvEXTPROC glProgramUniform1dvEXT = (glProgramUniform1dvEXTPROC)tlsGetFunction(1155); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1dvEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniform2dvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2dvEXTPROC glProgramUniform2dvEXT = (glProgramUniform2dvEXTPROC)tlsGetFunction(1156); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2dvEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniform3dvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3dvEXTPROC glProgramUniform3dvEXT = (glProgramUniform3dvEXTPROC)tlsGetFunction(1157); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3dvEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniform4dvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4dvEXTPROC glProgramUniform4dvEXT = (glProgramUniform4dvEXTPROC)tlsGetFunction(1158); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4dvEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix2dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2dvEXTPROC glProgramUniformMatrix2dvEXT = (glProgramUniformMatrix2dvEXTPROC)tlsGetFunction(1159); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2dvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix3dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3dvEXTPROC glProgramUniformMatrix3dvEXT = (glProgramUniformMatrix3dvEXTPROC)tlsGetFunction(1160); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3dvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix4dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4dvEXTPROC glProgramUniformMatrix4dvEXT = (glProgramUniformMatrix4dvEXTPROC)tlsGetFunction(1161); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4dvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix2x3dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2x3dvEXTPROC glProgramUniformMatrix2x3dvEXT = (glProgramUniformMatrix2x3dvEXTPROC)tlsGetFunction(1162); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2x3dvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix2x4dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2x4dvEXTPROC glProgramUniformMatrix2x4dvEXT = (glProgramUniformMatrix2x4dvEXTPROC)tlsGetFunction(1163); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2x4dvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix3x2dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3x2dvEXTPROC glProgramUniformMatrix3x2dvEXT = (glProgramUniformMatrix3x2dvEXTPROC)tlsGetFunction(1164); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3x2dvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix3x4dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3x4dvEXTPROC glProgramUniformMatrix3x4dvEXT = (glProgramUniformMatrix3x4dvEXTPROC)tlsGetFunction(1165); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3x4dvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix4x2dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4x2dvEXTPROC glProgramUniformMatrix4x2dvEXT = (glProgramUniformMatrix4x2dvEXTPROC)tlsGetFunction(1166); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4x2dvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderFP64_nglProgramUniformMatrix4x3dvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4x3dvEXTPROC glProgramUniformMatrix4x3dvEXT = (glProgramUniformMatrix4x3dvEXTPROC)tlsGetFunction(1167); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4x3dvEXT(program, location, count, transpose, value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGPUShaderInt64.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGPUShaderInt64.c deleted file mode 100644 index 3e294ec3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGPUShaderInt64.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glUniform1i64ARBPROC) (jint, jlong); -typedef void (APIENTRY *glUniform1i64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1i64ARBPROC) (jint, jint, jlong); -typedef void (APIENTRY *glProgramUniform1i64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2i64ARBPROC) (jint, jlong, jlong); -typedef void (APIENTRY *glUniform2i64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2i64ARBPROC) (jint, jint, jlong, jlong); -typedef void (APIENTRY *glProgramUniform2i64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3i64ARBPROC) (jint, jlong, jlong, jlong); -typedef void (APIENTRY *glUniform3i64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3i64ARBPROC) (jint, jint, jlong, jlong, jlong); -typedef void (APIENTRY *glProgramUniform3i64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4i64ARBPROC) (jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glUniform4i64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4i64ARBPROC) (jint, jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glProgramUniform4i64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform1ui64ARBPROC) (jint, jlong); -typedef void (APIENTRY *glUniform1ui64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1ui64ARBPROC) (jint, jint, jlong); -typedef void (APIENTRY *glProgramUniform1ui64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2ui64ARBPROC) (jint, jlong, jlong); -typedef void (APIENTRY *glUniform2ui64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2ui64ARBPROC) (jint, jint, jlong, jlong); -typedef void (APIENTRY *glProgramUniform2ui64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3ui64ARBPROC) (jint, jlong, jlong, jlong); -typedef void (APIENTRY *glUniform3ui64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3ui64ARBPROC) (jint, jint, jlong, jlong, jlong); -typedef void (APIENTRY *glProgramUniform3ui64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4ui64ARBPROC) (jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glUniform4ui64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4ui64ARBPROC) (jint, jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glProgramUniform4ui64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformi64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformui64vARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformi64vARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformui64vARBPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glUniform1i64ARB(JNIEnv *__env, jclass clazz, jint location, jlong x) { - glUniform1i64ARBPROC glUniform1i64ARB = (glUniform1i64ARBPROC)tlsGetFunction(1168); - UNUSED_PARAM(clazz) - glUniform1i64ARB(location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglUniform1i64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1i64vARBPROC glUniform1i64vARB = (glUniform1i64vARBPROC)tlsGetFunction(1169); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1i64vARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glProgramUniform1i64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x) { - glProgramUniform1i64ARBPROC glProgramUniform1i64ARB = (glProgramUniform1i64ARBPROC)tlsGetFunction(1170); - UNUSED_PARAM(clazz) - glProgramUniform1i64ARB(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglProgramUniform1i64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1i64vARBPROC glProgramUniform1i64vARB = (glProgramUniform1i64vARBPROC)tlsGetFunction(1171); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1i64vARB(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glUniform2i64ARB(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y) { - glUniform2i64ARBPROC glUniform2i64ARB = (glUniform2i64ARBPROC)tlsGetFunction(1172); - UNUSED_PARAM(clazz) - glUniform2i64ARB(location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglUniform2i64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2i64vARBPROC glUniform2i64vARB = (glUniform2i64vARBPROC)tlsGetFunction(1173); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2i64vARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glProgramUniform2i64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y) { - glProgramUniform2i64ARBPROC glProgramUniform2i64ARB = (glProgramUniform2i64ARBPROC)tlsGetFunction(1174); - UNUSED_PARAM(clazz) - glProgramUniform2i64ARB(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglProgramUniform2i64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2i64vARBPROC glProgramUniform2i64vARB = (glProgramUniform2i64vARBPROC)tlsGetFunction(1175); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2i64vARB(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glUniform3i64ARB(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y, jlong z) { - glUniform3i64ARBPROC glUniform3i64ARB = (glUniform3i64ARBPROC)tlsGetFunction(1176); - UNUSED_PARAM(clazz) - glUniform3i64ARB(location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglUniform3i64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3i64vARBPROC glUniform3i64vARB = (glUniform3i64vARBPROC)tlsGetFunction(1177); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3i64vARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glProgramUniform3i64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y, jlong z) { - glProgramUniform3i64ARBPROC glProgramUniform3i64ARB = (glProgramUniform3i64ARBPROC)tlsGetFunction(1178); - UNUSED_PARAM(clazz) - glProgramUniform3i64ARB(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglProgramUniform3i64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3i64vARBPROC glProgramUniform3i64vARB = (glProgramUniform3i64vARBPROC)tlsGetFunction(1179); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3i64vARB(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glUniform4i64ARB(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y, jlong z, jlong w) { - glUniform4i64ARBPROC glUniform4i64ARB = (glUniform4i64ARBPROC)tlsGetFunction(1180); - UNUSED_PARAM(clazz) - glUniform4i64ARB(location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglUniform4i64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4i64vARBPROC glUniform4i64vARB = (glUniform4i64vARBPROC)tlsGetFunction(1181); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4i64vARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glProgramUniform4i64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y, jlong z, jlong w) { - glProgramUniform4i64ARBPROC glProgramUniform4i64ARB = (glProgramUniform4i64ARBPROC)tlsGetFunction(1182); - UNUSED_PARAM(clazz) - glProgramUniform4i64ARB(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglProgramUniform4i64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4i64vARBPROC glProgramUniform4i64vARB = (glProgramUniform4i64vARBPROC)tlsGetFunction(1183); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4i64vARB(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glUniform1ui64ARB(JNIEnv *__env, jclass clazz, jint location, jlong x) { - glUniform1ui64ARBPROC glUniform1ui64ARB = (glUniform1ui64ARBPROC)tlsGetFunction(1184); - UNUSED_PARAM(clazz) - glUniform1ui64ARB(location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglUniform1ui64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1ui64vARBPROC glUniform1ui64vARB = (glUniform1ui64vARBPROC)tlsGetFunction(1185); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1ui64vARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glProgramUniform1ui64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x) { - glProgramUniform1ui64ARBPROC glProgramUniform1ui64ARB = (glProgramUniform1ui64ARBPROC)tlsGetFunction(1186); - UNUSED_PARAM(clazz) - glProgramUniform1ui64ARB(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglProgramUniform1ui64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1ui64vARBPROC glProgramUniform1ui64vARB = (glProgramUniform1ui64vARBPROC)tlsGetFunction(1187); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1ui64vARB(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glUniform2ui64ARB(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y) { - glUniform2ui64ARBPROC glUniform2ui64ARB = (glUniform2ui64ARBPROC)tlsGetFunction(1188); - UNUSED_PARAM(clazz) - glUniform2ui64ARB(location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglUniform2ui64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2ui64vARBPROC glUniform2ui64vARB = (glUniform2ui64vARBPROC)tlsGetFunction(1189); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2ui64vARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glProgramUniform2ui64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y) { - glProgramUniform2ui64ARBPROC glProgramUniform2ui64ARB = (glProgramUniform2ui64ARBPROC)tlsGetFunction(1190); - UNUSED_PARAM(clazz) - glProgramUniform2ui64ARB(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglProgramUniform2ui64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2ui64vARBPROC glProgramUniform2ui64vARB = (glProgramUniform2ui64vARBPROC)tlsGetFunction(1191); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2ui64vARB(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glUniform3ui64ARB(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y, jlong z) { - glUniform3ui64ARBPROC glUniform3ui64ARB = (glUniform3ui64ARBPROC)tlsGetFunction(1192); - UNUSED_PARAM(clazz) - glUniform3ui64ARB(location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglUniform3ui64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3ui64vARBPROC glUniform3ui64vARB = (glUniform3ui64vARBPROC)tlsGetFunction(1193); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3ui64vARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glProgramUniform3ui64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y, jlong z) { - glProgramUniform3ui64ARBPROC glProgramUniform3ui64ARB = (glProgramUniform3ui64ARBPROC)tlsGetFunction(1194); - UNUSED_PARAM(clazz) - glProgramUniform3ui64ARB(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglProgramUniform3ui64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3ui64vARBPROC glProgramUniform3ui64vARB = (glProgramUniform3ui64vARBPROC)tlsGetFunction(1195); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3ui64vARB(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glUniform4ui64ARB(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y, jlong z, jlong w) { - glUniform4ui64ARBPROC glUniform4ui64ARB = (glUniform4ui64ARBPROC)tlsGetFunction(1196); - UNUSED_PARAM(clazz) - glUniform4ui64ARB(location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglUniform4ui64vARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4ui64vARBPROC glUniform4ui64vARB = (glUniform4ui64vARBPROC)tlsGetFunction(1197); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4ui64vARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_glProgramUniform4ui64ARB(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y, jlong z, jlong w) { - glProgramUniform4ui64ARBPROC glProgramUniform4ui64ARB = (glProgramUniform4ui64ARBPROC)tlsGetFunction(1198); - UNUSED_PARAM(clazz) - glProgramUniform4ui64ARB(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglProgramUniform4ui64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4ui64vARBPROC glProgramUniform4ui64vARB = (glProgramUniform4ui64vARBPROC)tlsGetFunction(1199); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4ui64vARB(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglGetUniformi64vARB__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformi64vARBPROC glGetUniformi64vARB = (glGetUniformi64vARBPROC)tlsGetFunction(1200); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformi64vARB(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglGetUniformui64vARB__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformui64vARBPROC glGetUniformui64vARB = (glGetUniformui64vARBPROC)tlsGetFunction(1201); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformui64vARB(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglGetnUniformi64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformi64vARBPROC glGetnUniformi64vARB = (glGetnUniformi64vARBPROC)tlsGetFunction(1202); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformi64vARB(program, location, bufSize, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGPUShaderInt64_nglGetnUniformui64vARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformui64vARBPROC glGetnUniformui64vARB = (glGetnUniformui64vARBPROC)tlsGetFunction(1203); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformui64vARB(program, location, bufSize, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGeometryShader4.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGeometryShader4.c deleted file mode 100644 index b12bc84d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBGeometryShader4.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glProgramParameteriARBPROC) (jint, jint, jint); -typedef void (APIENTRY *glFramebufferTextureARBPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferTextureLayerARBPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferTextureFaceARBPROC) (jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGeometryShader4_glProgramParameteriARB(JNIEnv *__env, jclass clazz, jint program, jint pname, jint value) { - glProgramParameteriARBPROC glProgramParameteriARB = (glProgramParameteriARBPROC)tlsGetFunction(1146); - UNUSED_PARAM(clazz) - glProgramParameteriARB(program, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGeometryShader4_glFramebufferTextureARB(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level) { - glFramebufferTextureARBPROC glFramebufferTextureARB = (glFramebufferTextureARBPROC)tlsGetFunction(1147); - UNUSED_PARAM(clazz) - glFramebufferTextureARB(target, attachment, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGeometryShader4_glFramebufferTextureLayerARB(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level, jint layer) { - glFramebufferTextureLayerARBPROC glFramebufferTextureLayerARB = (glFramebufferTextureLayerARBPROC)tlsGetFunction(1148); - UNUSED_PARAM(clazz) - glFramebufferTextureLayerARB(target, attachment, texture, level, layer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBGeometryShader4_glFramebufferTextureFaceARB(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level, jint face) { - glFramebufferTextureFaceARBPROC glFramebufferTextureFaceARB = (glFramebufferTextureFaceARBPROC)tlsGetFunction(1149); - UNUSED_PARAM(clazz) - glFramebufferTextureFaceARB(target, attachment, texture, level, face); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBImaging.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBImaging.c deleted file mode 100644 index abbf9703..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBImaging.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glColorTablePROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyColorTablePROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glColorTableParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glColorTableParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetColorTablePROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetColorTableParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetColorTableParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glColorSubTablePROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyColorSubTablePROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glConvolutionFilter1DPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glConvolutionFilter2DPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyConvolutionFilter1DPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyConvolutionFilter2DPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glGetConvolutionFilterPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glSeparableFilter2DPROC) (jint, jint, jint, jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetSeparableFilterPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glConvolutionParameteriPROC) (jint, jint, jint); -typedef void (APIENTRY *glConvolutionParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glConvolutionParameterfPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glConvolutionParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetConvolutionParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetConvolutionParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glHistogramPROC) (jint, jint, jint, jboolean); -typedef void (APIENTRY *glResetHistogramPROC) (jint); -typedef void (APIENTRY *glGetHistogramPROC) (jint, jboolean, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetHistogramParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetHistogramParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glMinmaxPROC) (jint, jint, jboolean); -typedef void (APIENTRY *glResetMinmaxPROC) (jint); -typedef void (APIENTRY *glGetMinmaxPROC) (jint, jboolean, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMinmaxParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMinmaxParameterfvPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorTable__IIIIIJ(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint width, jint format, jint type, jlong tableAddress) { - glColorTablePROC glColorTable = (glColorTablePROC)tlsGetFunction(1204); - uintptr_t table = (uintptr_t)tableAddress; - UNUSED_PARAM(clazz) - glColorTable(target, internalformat, width, format, type, table); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glCopyColorTable(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint x, jint y, jint width) { - glCopyColorTablePROC glCopyColorTable = (glCopyColorTablePROC)tlsGetFunction(1205); - UNUSED_PARAM(clazz) - glCopyColorTable(target, internalformat, x, y, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorTableParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glColorTableParameterivPROC glColorTableParameteriv = (glColorTableParameterivPROC)tlsGetFunction(1206); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glColorTableParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorTableParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glColorTableParameterfvPROC glColorTableParameterfv = (glColorTableParameterfvPROC)tlsGetFunction(1207); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glColorTableParameterfv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetColorTable__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jlong tableAddress) { - glGetColorTablePROC glGetColorTable = (glGetColorTablePROC)tlsGetFunction(1208); - uintptr_t table = (uintptr_t)tableAddress; - UNUSED_PARAM(clazz) - glGetColorTable(target, format, type, table); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetColorTableParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetColorTableParameterivPROC glGetColorTableParameteriv = (glGetColorTableParameterivPROC)tlsGetFunction(1209); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetColorTableParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetColorTableParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetColorTableParameterfvPROC glGetColorTableParameterfv = (glGetColorTableParameterfvPROC)tlsGetFunction(1210); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetColorTableParameterfv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorSubTable(JNIEnv *__env, jclass clazz, jint target, jint start, jint count, jint format, jint type, jlong dataAddress) { - glColorSubTablePROC glColorSubTable = (glColorSubTablePROC)tlsGetFunction(1211); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glColorSubTable(target, start, count, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glCopyColorSubTable(JNIEnv *__env, jclass clazz, jint target, jint start, jint x, jint y, jint width) { - glCopyColorSubTablePROC glCopyColorSubTable = (glCopyColorSubTablePROC)tlsGetFunction(1212); - UNUSED_PARAM(clazz) - glCopyColorSubTable(target, start, x, y, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglConvolutionFilter1D(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint width, jint format, jint type, jlong dataAddress) { - glConvolutionFilter1DPROC glConvolutionFilter1D = (glConvolutionFilter1DPROC)tlsGetFunction(1213); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glConvolutionFilter1D(target, internalformat, width, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglConvolutionFilter2D(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint width, jint height, jint format, jint type, jlong dataAddress) { - glConvolutionFilter2DPROC glConvolutionFilter2D = (glConvolutionFilter2DPROC)tlsGetFunction(1214); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glConvolutionFilter2D(target, internalformat, width, height, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glCopyConvolutionFilter1D(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint x, jint y, jint width) { - glCopyConvolutionFilter1DPROC glCopyConvolutionFilter1D = (glCopyConvolutionFilter1DPROC)tlsGetFunction(1215); - UNUSED_PARAM(clazz) - glCopyConvolutionFilter1D(target, internalformat, x, y, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glCopyConvolutionFilter2D(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint x, jint y, jint width, jint height) { - glCopyConvolutionFilter2DPROC glCopyConvolutionFilter2D = (glCopyConvolutionFilter2DPROC)tlsGetFunction(1216); - UNUSED_PARAM(clazz) - glCopyConvolutionFilter2D(target, internalformat, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetConvolutionFilter(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jlong imageAddress) { - glGetConvolutionFilterPROC glGetConvolutionFilter = (glGetConvolutionFilterPROC)tlsGetFunction(1217); - uintptr_t image = (uintptr_t)imageAddress; - UNUSED_PARAM(clazz) - glGetConvolutionFilter(target, format, type, image); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglSeparableFilter2D(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint width, jint height, jint format, jint type, jlong rowAddress, jlong columnAddress) { - glSeparableFilter2DPROC glSeparableFilter2D = (glSeparableFilter2DPROC)tlsGetFunction(1218); - uintptr_t row = (uintptr_t)rowAddress; - uintptr_t column = (uintptr_t)columnAddress; - UNUSED_PARAM(clazz) - glSeparableFilter2D(target, internalformat, width, height, format, type, row, column); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetSeparableFilter(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jlong rowAddress, jlong columnAddress, jlong spanAddress) { - glGetSeparableFilterPROC glGetSeparableFilter = (glGetSeparableFilterPROC)tlsGetFunction(1219); - uintptr_t row = (uintptr_t)rowAddress; - uintptr_t column = (uintptr_t)columnAddress; - uintptr_t span = (uintptr_t)spanAddress; - UNUSED_PARAM(clazz) - glGetSeparableFilter(target, format, type, row, column, span); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glConvolutionParameteri(JNIEnv *__env, jclass clazz, jint target, jint pname, jint param) { - glConvolutionParameteriPROC glConvolutionParameteri = (glConvolutionParameteriPROC)tlsGetFunction(1220); - UNUSED_PARAM(clazz) - glConvolutionParameteri(target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglConvolutionParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glConvolutionParameterivPROC glConvolutionParameteriv = (glConvolutionParameterivPROC)tlsGetFunction(1221); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glConvolutionParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glConvolutionParameterf(JNIEnv *__env, jclass clazz, jint target, jint pname, jfloat param) { - glConvolutionParameterfPROC glConvolutionParameterf = (glConvolutionParameterfPROC)tlsGetFunction(1222); - UNUSED_PARAM(clazz) - glConvolutionParameterf(target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglConvolutionParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glConvolutionParameterfvPROC glConvolutionParameterfv = (glConvolutionParameterfvPROC)tlsGetFunction(1223); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glConvolutionParameterfv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetConvolutionParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetConvolutionParameterivPROC glGetConvolutionParameteriv = (glGetConvolutionParameterivPROC)tlsGetFunction(1224); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetConvolutionParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetConvolutionParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetConvolutionParameterfvPROC glGetConvolutionParameterfv = (glGetConvolutionParameterfvPROC)tlsGetFunction(1225); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetConvolutionParameterfv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glHistogram(JNIEnv *__env, jclass clazz, jint target, jint width, jint internalformat, jboolean sink) { - glHistogramPROC glHistogram = (glHistogramPROC)tlsGetFunction(1226); - UNUSED_PARAM(clazz) - glHistogram(target, width, internalformat, sink); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glResetHistogram(JNIEnv *__env, jclass clazz, jint target) { - glResetHistogramPROC glResetHistogram = (glResetHistogramPROC)tlsGetFunction(1227); - UNUSED_PARAM(clazz) - glResetHistogram(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetHistogram(JNIEnv *__env, jclass clazz, jint target, jboolean reset, jint format, jint type, jlong valuesAddress) { - glGetHistogramPROC glGetHistogram = (glGetHistogramPROC)tlsGetFunction(1228); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetHistogram(target, reset, format, type, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetHistogramParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetHistogramParameterivPROC glGetHistogramParameteriv = (glGetHistogramParameterivPROC)tlsGetFunction(1229); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetHistogramParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetHistogramParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetHistogramParameterfvPROC glGetHistogramParameterfv = (glGetHistogramParameterfvPROC)tlsGetFunction(1230); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetHistogramParameterfv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glMinmax(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jboolean sink) { - glMinmaxPROC glMinmax = (glMinmaxPROC)tlsGetFunction(1231); - UNUSED_PARAM(clazz) - glMinmax(target, internalformat, sink); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_glResetMinmax(JNIEnv *__env, jclass clazz, jint target) { - glResetMinmaxPROC glResetMinmax = (glResetMinmaxPROC)tlsGetFunction(1232); - UNUSED_PARAM(clazz) - glResetMinmax(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetMinmax(JNIEnv *__env, jclass clazz, jint target, jboolean reset, jint format, jint type, jlong valuesAddress) { - glGetMinmaxPROC glGetMinmax = (glGetMinmaxPROC)tlsGetFunction(1233); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetMinmax(target, reset, format, type, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetMinmaxParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetMinmaxParameterivPROC glGetMinmaxParameteriv = (glGetMinmaxParameterivPROC)tlsGetFunction(1234); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMinmaxParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglGetMinmaxParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetMinmaxParameterfvPROC glGetMinmaxParameterfv = (glGetMinmaxParameterfvPROC)tlsGetFunction(1235); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMinmaxParameterfv(target, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBIndirectParameters.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBIndirectParameters.c deleted file mode 100644 index a8ee91b1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBIndirectParameters.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glMultiDrawArraysIndirectCountARBPROC) (jint, uintptr_t, uintptr_t, jint, jint); -typedef void (APIENTRY *glMultiDrawElementsIndirectCountARBPROC) (jint, jint, uintptr_t, uintptr_t, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBIndirectParameters_nglMultiDrawArraysIndirectCountARB__IJJII(JNIEnv *__env, jclass clazz, jint mode, jlong indirectAddress, jlong drawcount, jint maxdrawcount, jint stride) { - glMultiDrawArraysIndirectCountARBPROC glMultiDrawArraysIndirectCountARB = (glMultiDrawArraysIndirectCountARBPROC)tlsGetFunction(1236); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawArraysIndirectCountARB(mode, indirect, (uintptr_t)drawcount, maxdrawcount, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBIndirectParameters_nglMultiDrawElementsIndirectCountARB__IIJJII(JNIEnv *__env, jclass clazz, jint mode, jint type, jlong indirectAddress, jlong drawcount, jint maxdrawcount, jint stride) { - glMultiDrawElementsIndirectCountARBPROC glMultiDrawElementsIndirectCountARB = (glMultiDrawElementsIndirectCountARBPROC)tlsGetFunction(1237); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawElementsIndirectCountARB(mode, type, indirect, (uintptr_t)drawcount, maxdrawcount, stride); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBInstancedArrays.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBInstancedArrays.c deleted file mode 100644 index 7bcf5efc..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBInstancedArrays.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexAttribDivisorARBPROC) (jint, jint); -typedef void (APIENTRY *glVertexArrayVertexAttribDivisorEXTPROC) (jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBInstancedArrays_glVertexAttribDivisorARB(JNIEnv *__env, jclass clazz, jint index, jint divisor) { - glVertexAttribDivisorARBPROC glVertexAttribDivisorARB = (glVertexAttribDivisorARBPROC)tlsGetFunction(1238); - UNUSED_PARAM(clazz) - glVertexAttribDivisorARB(index, divisor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBInstancedArrays_glVertexArrayVertexAttribDivisorEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint index, jint divisor) { - glVertexArrayVertexAttribDivisorEXTPROC glVertexArrayVertexAttribDivisorEXT = (glVertexArrayVertexAttribDivisorEXTPROC)tlsGetFunction(1239); - UNUSED_PARAM(clazz) - glVertexArrayVertexAttribDivisorEXT(vaobj, index, divisor); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMatrixPalette.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMatrixPalette.c deleted file mode 100644 index 67cad1d7..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMatrixPalette.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glCurrentPaletteMatrixARBPROC) (jint); -typedef void (APIENTRY *glMatrixIndexuivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixIndexubvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixIndexusvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixIndexPointerARBPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_glCurrentPaletteMatrixARB(JNIEnv *__env, jclass clazz, jint index) { - glCurrentPaletteMatrixARBPROC glCurrentPaletteMatrixARB = (glCurrentPaletteMatrixARBPROC)tlsGetFunction(1240); - UNUSED_PARAM(clazz) - glCurrentPaletteMatrixARB(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexuivARB__IJ(JNIEnv *__env, jclass clazz, jint size, jlong indicesAddress) { - glMatrixIndexuivARBPROC glMatrixIndexuivARB = (glMatrixIndexuivARBPROC)tlsGetFunction(1241); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glMatrixIndexuivARB(size, indices); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexubvARB(JNIEnv *__env, jclass clazz, jint size, jlong indicesAddress) { - glMatrixIndexubvARBPROC glMatrixIndexubvARB = (glMatrixIndexubvARBPROC)tlsGetFunction(1242); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glMatrixIndexubvARB(size, indices); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexusvARB__IJ(JNIEnv *__env, jclass clazz, jint size, jlong indicesAddress) { - glMatrixIndexusvARBPROC glMatrixIndexusvARB = (glMatrixIndexusvARBPROC)tlsGetFunction(1243); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glMatrixIndexusvARB(size, indices); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMatrixPalette_nglMatrixIndexPointerARB(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride, jlong pointerAddress) { - glMatrixIndexPointerARBPROC glMatrixIndexPointerARB = (glMatrixIndexPointerARBPROC)tlsGetFunction(1244); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glMatrixIndexPointerARB(size, type, stride, pointer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMultisample.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMultisample.c deleted file mode 100644 index a48dbea4..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMultisample.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glSampleCoverageARBPROC) (jfloat, jboolean); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultisample_glSampleCoverageARB(JNIEnv *__env, jclass clazz, jfloat value, jboolean invert) { - glSampleCoverageARBPROC glSampleCoverageARB = (glSampleCoverageARBPROC)tlsGetFunction(1245); - UNUSED_PARAM(clazz) - glSampleCoverageARB(value, invert); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMultitexture.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMultitexture.c deleted file mode 100644 index cfc3827d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBMultitexture.c +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glActiveTextureARBPROC) (jint); -typedef void (APIENTRY *glClientActiveTextureARBPROC) (jint); -typedef void (APIENTRY *glMultiTexCoord1fARBPROC) (jint, jfloat); -typedef void (APIENTRY *glMultiTexCoord1sARBPROC) (jint, jshort); -typedef void (APIENTRY *glMultiTexCoord1iARBPROC) (jint, jint); -typedef void (APIENTRY *glMultiTexCoord1dARBPROC) (jint, jdouble); -typedef void (APIENTRY *glMultiTexCoord1fvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord1svARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord1ivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord1dvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2fARBPROC) (jint, jfloat, jfloat); -typedef void (APIENTRY *glMultiTexCoord2sARBPROC) (jint, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord2iARBPROC) (jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoord2dARBPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glMultiTexCoord2fvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2svARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2ivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2dvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3fARBPROC) (jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glMultiTexCoord3sARBPROC) (jint, jshort, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord3iARBPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoord3dARBPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMultiTexCoord3fvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3svARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3ivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3dvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4fARBPROC) (jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glMultiTexCoord4sARBPROC) (jint, jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord4iARBPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoord4dARBPROC) (jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMultiTexCoord4fvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4svARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4ivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4dvARBPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glActiveTextureARB(JNIEnv *__env, jclass clazz, jint texture) { - glActiveTextureARBPROC glActiveTextureARB = (glActiveTextureARBPROC)tlsGetFunction(1246); - UNUSED_PARAM(clazz) - glActiveTextureARB(texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glClientActiveTextureARB(JNIEnv *__env, jclass clazz, jint texture) { - glClientActiveTextureARBPROC glClientActiveTextureARB = (glClientActiveTextureARBPROC)tlsGetFunction(1247); - UNUSED_PARAM(clazz) - glClientActiveTextureARB(texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord1fARB(JNIEnv *__env, jclass clazz, jint texture, jfloat s) { - glMultiTexCoord1fARBPROC glMultiTexCoord1fARB = (glMultiTexCoord1fARBPROC)tlsGetFunction(1248); - UNUSED_PARAM(clazz) - glMultiTexCoord1fARB(texture, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord1sARB(JNIEnv *__env, jclass clazz, jint texture, jshort s) { - glMultiTexCoord1sARBPROC glMultiTexCoord1sARB = (glMultiTexCoord1sARBPROC)tlsGetFunction(1249); - UNUSED_PARAM(clazz) - glMultiTexCoord1sARB(texture, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord1iARB(JNIEnv *__env, jclass clazz, jint texture, jint s) { - glMultiTexCoord1iARBPROC glMultiTexCoord1iARB = (glMultiTexCoord1iARBPROC)tlsGetFunction(1250); - UNUSED_PARAM(clazz) - glMultiTexCoord1iARB(texture, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord1dARB(JNIEnv *__env, jclass clazz, jint texture, jdouble s) { - glMultiTexCoord1dARBPROC glMultiTexCoord1dARB = (glMultiTexCoord1dARBPROC)tlsGetFunction(1251); - UNUSED_PARAM(clazz) - glMultiTexCoord1dARB(texture, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord1fvARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord1fvARBPROC glMultiTexCoord1fvARB = (glMultiTexCoord1fvARBPROC)tlsGetFunction(1252); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1fvARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord1svARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord1svARBPROC glMultiTexCoord1svARB = (glMultiTexCoord1svARBPROC)tlsGetFunction(1253); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1svARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord1ivARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord1ivARBPROC glMultiTexCoord1ivARB = (glMultiTexCoord1ivARBPROC)tlsGetFunction(1254); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1ivARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord1dvARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord1dvARBPROC glMultiTexCoord1dvARB = (glMultiTexCoord1dvARBPROC)tlsGetFunction(1255); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1dvARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord2fARB(JNIEnv *__env, jclass clazz, jint texture, jfloat s, jfloat t) { - glMultiTexCoord2fARBPROC glMultiTexCoord2fARB = (glMultiTexCoord2fARBPROC)tlsGetFunction(1256); - UNUSED_PARAM(clazz) - glMultiTexCoord2fARB(texture, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord2sARB(JNIEnv *__env, jclass clazz, jint texture, jshort s, jshort t) { - glMultiTexCoord2sARBPROC glMultiTexCoord2sARB = (glMultiTexCoord2sARBPROC)tlsGetFunction(1257); - UNUSED_PARAM(clazz) - glMultiTexCoord2sARB(texture, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord2iARB(JNIEnv *__env, jclass clazz, jint texture, jint s, jint t) { - glMultiTexCoord2iARBPROC glMultiTexCoord2iARB = (glMultiTexCoord2iARBPROC)tlsGetFunction(1258); - UNUSED_PARAM(clazz) - glMultiTexCoord2iARB(texture, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord2dARB(JNIEnv *__env, jclass clazz, jint texture, jdouble s, jdouble t) { - glMultiTexCoord2dARBPROC glMultiTexCoord2dARB = (glMultiTexCoord2dARBPROC)tlsGetFunction(1259); - UNUSED_PARAM(clazz) - glMultiTexCoord2dARB(texture, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord2fvARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord2fvARBPROC glMultiTexCoord2fvARB = (glMultiTexCoord2fvARBPROC)tlsGetFunction(1260); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2fvARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord2svARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord2svARBPROC glMultiTexCoord2svARB = (glMultiTexCoord2svARBPROC)tlsGetFunction(1261); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2svARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord2ivARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord2ivARBPROC glMultiTexCoord2ivARB = (glMultiTexCoord2ivARBPROC)tlsGetFunction(1262); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2ivARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord2dvARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord2dvARBPROC glMultiTexCoord2dvARB = (glMultiTexCoord2dvARBPROC)tlsGetFunction(1263); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2dvARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord3fARB(JNIEnv *__env, jclass clazz, jint texture, jfloat s, jfloat t, jfloat r) { - glMultiTexCoord3fARBPROC glMultiTexCoord3fARB = (glMultiTexCoord3fARBPROC)tlsGetFunction(1264); - UNUSED_PARAM(clazz) - glMultiTexCoord3fARB(texture, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord3sARB(JNIEnv *__env, jclass clazz, jint texture, jshort s, jshort t, jshort r) { - glMultiTexCoord3sARBPROC glMultiTexCoord3sARB = (glMultiTexCoord3sARBPROC)tlsGetFunction(1265); - UNUSED_PARAM(clazz) - glMultiTexCoord3sARB(texture, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord3iARB(JNIEnv *__env, jclass clazz, jint texture, jint s, jint t, jint r) { - glMultiTexCoord3iARBPROC glMultiTexCoord3iARB = (glMultiTexCoord3iARBPROC)tlsGetFunction(1266); - UNUSED_PARAM(clazz) - glMultiTexCoord3iARB(texture, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord3dARB(JNIEnv *__env, jclass clazz, jint texture, jdouble s, jdouble t, jdouble r) { - glMultiTexCoord3dARBPROC glMultiTexCoord3dARB = (glMultiTexCoord3dARBPROC)tlsGetFunction(1267); - UNUSED_PARAM(clazz) - glMultiTexCoord3dARB(texture, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord3fvARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord3fvARBPROC glMultiTexCoord3fvARB = (glMultiTexCoord3fvARBPROC)tlsGetFunction(1268); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3fvARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord3svARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord3svARBPROC glMultiTexCoord3svARB = (glMultiTexCoord3svARBPROC)tlsGetFunction(1269); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3svARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord3ivARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord3ivARBPROC glMultiTexCoord3ivARB = (glMultiTexCoord3ivARBPROC)tlsGetFunction(1270); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3ivARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord3dvARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord3dvARBPROC glMultiTexCoord3dvARB = (glMultiTexCoord3dvARBPROC)tlsGetFunction(1271); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3dvARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord4fARB(JNIEnv *__env, jclass clazz, jint texture, jfloat s, jfloat t, jfloat r, jfloat q) { - glMultiTexCoord4fARBPROC glMultiTexCoord4fARB = (glMultiTexCoord4fARBPROC)tlsGetFunction(1272); - UNUSED_PARAM(clazz) - glMultiTexCoord4fARB(texture, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord4sARB(JNIEnv *__env, jclass clazz, jint texture, jshort s, jshort t, jshort r, jshort q) { - glMultiTexCoord4sARBPROC glMultiTexCoord4sARB = (glMultiTexCoord4sARBPROC)tlsGetFunction(1273); - UNUSED_PARAM(clazz) - glMultiTexCoord4sARB(texture, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord4iARB(JNIEnv *__env, jclass clazz, jint texture, jint s, jint t, jint r, jint q) { - glMultiTexCoord4iARBPROC glMultiTexCoord4iARB = (glMultiTexCoord4iARBPROC)tlsGetFunction(1274); - UNUSED_PARAM(clazz) - glMultiTexCoord4iARB(texture, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_glMultiTexCoord4dARB(JNIEnv *__env, jclass clazz, jint texture, jdouble s, jdouble t, jdouble r, jdouble q) { - glMultiTexCoord4dARBPROC glMultiTexCoord4dARB = (glMultiTexCoord4dARBPROC)tlsGetFunction(1275); - UNUSED_PARAM(clazz) - glMultiTexCoord4dARB(texture, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord4fvARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord4fvARBPROC glMultiTexCoord4fvARB = (glMultiTexCoord4fvARBPROC)tlsGetFunction(1276); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4fvARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord4svARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord4svARBPROC glMultiTexCoord4svARB = (glMultiTexCoord4svARBPROC)tlsGetFunction(1277); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4svARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord4ivARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord4ivARBPROC glMultiTexCoord4ivARB = (glMultiTexCoord4ivARBPROC)tlsGetFunction(1278); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4ivARB(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBMultitexture_nglMultiTexCoord4dvARB__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord4dvARBPROC glMultiTexCoord4dvARB = (glMultiTexCoord4dvARBPROC)tlsGetFunction(1279); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4dvARB(texture, v); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBOcclusionQuery.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBOcclusionQuery.c deleted file mode 100644 index c2733173..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBOcclusionQuery.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGenQueriesARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeleteQueriesARBPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsQueryARBPROC) (jint); -typedef void (APIENTRY *glBeginQueryARBPROC) (jint, jint); -typedef void (APIENTRY *glEndQueryARBPROC) (jint); -typedef void (APIENTRY *glGetQueryivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryObjectivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryObjectuivARBPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGenQueriesARB__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glGenQueriesARBPROC glGenQueriesARB = (glGenQueriesARBPROC)tlsGetFunction(1280); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glGenQueriesARB(n, ids); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglDeleteQueriesARB__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glDeleteQueriesARBPROC glDeleteQueriesARB = (glDeleteQueriesARBPROC)tlsGetFunction(1281); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glDeleteQueriesARB(n, ids); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_glIsQueryARB(JNIEnv *__env, jclass clazz, jint id) { - glIsQueryARBPROC glIsQueryARB = (glIsQueryARBPROC)tlsGetFunction(1282); - UNUSED_PARAM(clazz) - return glIsQueryARB(id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_glBeginQueryARB(JNIEnv *__env, jclass clazz, jint target, jint id) { - glBeginQueryARBPROC glBeginQueryARB = (glBeginQueryARBPROC)tlsGetFunction(1283); - UNUSED_PARAM(clazz) - glBeginQueryARB(target, id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_glEndQueryARB(JNIEnv *__env, jclass clazz, jint target) { - glEndQueryARBPROC glEndQueryARB = (glEndQueryARBPROC)tlsGetFunction(1284); - UNUSED_PARAM(clazz) - glEndQueryARB(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryivARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetQueryivARBPROC glGetQueryivARB = (glGetQueryivARBPROC)tlsGetFunction(1285); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryivARB(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryObjectivARB__IIJ(JNIEnv *__env, jclass clazz, jint id, jint pname, jlong paramsAddress) { - glGetQueryObjectivARBPROC glGetQueryObjectivARB = (glGetQueryObjectivARBPROC)tlsGetFunction(1286); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryObjectivARB(id, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBOcclusionQuery_nglGetQueryObjectuivARB__IIJ(JNIEnv *__env, jclass clazz, jint id, jint pname, jlong paramsAddress) { - glGetQueryObjectuivARBPROC glGetQueryObjectuivARB = (glGetQueryObjectuivARBPROC)tlsGetFunction(1287); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryObjectuivARB(id, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBParallelShaderCompile.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBParallelShaderCompile.c deleted file mode 100644 index 7873d559..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBParallelShaderCompile.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glMaxShaderCompilerThreadsARBPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBParallelShaderCompile_glMaxShaderCompilerThreadsARB(JNIEnv *__env, jclass clazz, jint count) { - glMaxShaderCompilerThreadsARBPROC glMaxShaderCompilerThreadsARB = (glMaxShaderCompilerThreadsARBPROC)tlsGetFunction(1288); - UNUSED_PARAM(clazz) - glMaxShaderCompilerThreadsARB(count); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBPointParameters.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBPointParameters.c deleted file mode 100644 index 8a6acacc..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBPointParameters.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glPointParameterfARBPROC) (jint, jfloat); -typedef void (APIENTRY *glPointParameterfvARBPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBPointParameters_glPointParameterfARB(JNIEnv *__env, jclass clazz, jint pname, jfloat param) { - glPointParameterfARBPROC glPointParameterfARB = (glPointParameterfARBPROC)tlsGetFunction(1289); - UNUSED_PARAM(clazz) - glPointParameterfARB(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBPointParameters_nglPointParameterfvARB__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glPointParameterfvARBPROC glPointParameterfvARB = (glPointParameterfvARBPROC)tlsGetFunction(1290); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glPointParameterfvARB(pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBRobustness.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBRobustness.c deleted file mode 100644 index a88fe55e..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBRobustness.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jint (APIENTRY *glGetGraphicsResetStatusARBPROC) (void); -typedef void (APIENTRY *glGetnMapdvARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnMapfvARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnMapivARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnPixelMapfvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnPixelMapuivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnPixelMapusvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnPolygonStippleARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetnTexImageARBPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glReadnPixelsARBPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnColorTableARBPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnConvolutionFilterARBPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnSeparableFilterARBPROC) (jint, jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetnHistogramARBPROC) (jint, jboolean, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnMinmaxARBPROC) (jint, jboolean, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnCompressedTexImageARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformfvARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformivARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformuivARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformdvARBPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_ARBRobustness_glGetGraphicsResetStatusARB(JNIEnv *__env, jclass clazz) { - glGetGraphicsResetStatusARBPROC glGetGraphicsResetStatusARB = (glGetGraphicsResetStatusARBPROC)tlsGetFunction(1291); - UNUSED_PARAM(clazz) - return glGetGraphicsResetStatusARB(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnMapdvARB__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jint bufSize, jlong dataAddress) { - glGetnMapdvARBPROC glGetnMapdvARB = (glGetnMapdvARBPROC)tlsGetFunction(1292); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnMapdvARB(target, query, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnMapfvARB__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jint bufSize, jlong dataAddress) { - glGetnMapfvARBPROC glGetnMapfvARB = (glGetnMapfvARBPROC)tlsGetFunction(1293); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnMapfvARB(target, query, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnMapivARB__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jint bufSize, jlong dataAddress) { - glGetnMapivARBPROC glGetnMapivARB = (glGetnMapivARBPROC)tlsGetFunction(1294); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnMapivARB(target, query, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnPixelMapfvARB__IIJ(JNIEnv *__env, jclass clazz, jint map, jint bufSize, jlong dataAddress) { - glGetnPixelMapfvARBPROC glGetnPixelMapfvARB = (glGetnPixelMapfvARBPROC)tlsGetFunction(1295); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnPixelMapfvARB(map, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnPixelMapuivARB__IIJ(JNIEnv *__env, jclass clazz, jint map, jint bufSize, jlong dataAddress) { - glGetnPixelMapuivARBPROC glGetnPixelMapuivARB = (glGetnPixelMapuivARBPROC)tlsGetFunction(1296); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnPixelMapuivARB(map, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnPixelMapusvARB__IIJ(JNIEnv *__env, jclass clazz, jint map, jint bufSize, jlong dataAddress) { - glGetnPixelMapusvARBPROC glGetnPixelMapusvARB = (glGetnPixelMapusvARBPROC)tlsGetFunction(1297); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnPixelMapusvARB(map, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnPolygonStippleARB(JNIEnv *__env, jclass clazz, jint bufSize, jlong patternAddress) { - glGetnPolygonStippleARBPROC glGetnPolygonStippleARB = (glGetnPolygonStippleARBPROC)tlsGetFunction(1298); - uintptr_t pattern = (uintptr_t)patternAddress; - UNUSED_PARAM(clazz) - glGetnPolygonStippleARB(bufSize, pattern); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnTexImageARB__IIIIIJ(JNIEnv *__env, jclass clazz, jint tex, jint level, jint format, jint type, jint bufSize, jlong imgAddress) { - glGetnTexImageARBPROC glGetnTexImageARB = (glGetnTexImageARBPROC)tlsGetFunction(1299); - uintptr_t img = (uintptr_t)imgAddress; - UNUSED_PARAM(clazz) - glGetnTexImageARB(tex, level, format, type, bufSize, img); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglReadnPixelsARB__IIIIIIIJ(JNIEnv *__env, jclass clazz, jint x, jint y, jint width, jint height, jint format, jint type, jint bufSize, jlong dataAddress) { - glReadnPixelsARBPROC glReadnPixelsARB = (glReadnPixelsARBPROC)tlsGetFunction(1300); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glReadnPixelsARB(x, y, width, height, format, type, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnColorTableARB__IIIIJ(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jint bufSize, jlong tableAddress) { - glGetnColorTableARBPROC glGetnColorTableARB = (glGetnColorTableARBPROC)tlsGetFunction(1301); - uintptr_t table = (uintptr_t)tableAddress; - UNUSED_PARAM(clazz) - glGetnColorTableARB(target, format, type, bufSize, table); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnConvolutionFilterARB(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jint bufSize, jlong imageAddress) { - glGetnConvolutionFilterARBPROC glGetnConvolutionFilterARB = (glGetnConvolutionFilterARBPROC)tlsGetFunction(1302); - uintptr_t image = (uintptr_t)imageAddress; - UNUSED_PARAM(clazz) - glGetnConvolutionFilterARB(target, format, type, bufSize, image); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnSeparableFilterARB(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jint rowBufSize, jlong rowAddress, jint columnBufSize, jlong columnAddress, jlong spanAddress) { - glGetnSeparableFilterARBPROC glGetnSeparableFilterARB = (glGetnSeparableFilterARBPROC)tlsGetFunction(1303); - uintptr_t row = (uintptr_t)rowAddress; - uintptr_t column = (uintptr_t)columnAddress; - uintptr_t span = (uintptr_t)spanAddress; - UNUSED_PARAM(clazz) - glGetnSeparableFilterARB(target, format, type, rowBufSize, row, columnBufSize, column, span); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnHistogramARB(JNIEnv *__env, jclass clazz, jint target, jboolean reset, jint format, jint type, jint bufSize, jlong valuesAddress) { - glGetnHistogramARBPROC glGetnHistogramARB = (glGetnHistogramARBPROC)tlsGetFunction(1304); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetnHistogramARB(target, reset, format, type, bufSize, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnMinmaxARB(JNIEnv *__env, jclass clazz, jint target, jboolean reset, jint format, jint type, jint bufSize, jlong valuesAddress) { - glGetnMinmaxARBPROC glGetnMinmaxARB = (glGetnMinmaxARBPROC)tlsGetFunction(1305); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetnMinmaxARB(target, reset, format, type, bufSize, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnCompressedTexImageARB(JNIEnv *__env, jclass clazz, jint target, jint level, jint bufSize, jlong imgAddress) { - glGetnCompressedTexImageARBPROC glGetnCompressedTexImageARB = (glGetnCompressedTexImageARBPROC)tlsGetFunction(1306); - uintptr_t img = (uintptr_t)imgAddress; - UNUSED_PARAM(clazz) - glGetnCompressedTexImageARB(target, level, bufSize, img); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnUniformfvARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformfvARBPROC glGetnUniformfvARB = (glGetnUniformfvARBPROC)tlsGetFunction(1307); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformfvARB(program, location, bufSize, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnUniformivARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformivARBPROC glGetnUniformivARB = (glGetnUniformivARBPROC)tlsGetFunction(1308); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformivARB(program, location, bufSize, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnUniformuivARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformuivARBPROC glGetnUniformuivARB = (glGetnUniformuivARBPROC)tlsGetFunction(1309); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformuivARB(program, location, bufSize, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBRobustness_nglGetnUniformdvARB__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformdvARBPROC glGetnUniformdvARB = (glGetnUniformdvARBPROC)tlsGetFunction(1310); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformdvARB(program, location, bufSize, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSampleLocations.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSampleLocations.c deleted file mode 100644 index 80317db1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSampleLocations.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFramebufferSampleLocationsfvARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedFramebufferSampleLocationsfvARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glEvaluateDepthValuesARBPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSampleLocations_nglFramebufferSampleLocationsfvARB__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint start, jint count, jlong vAddress) { - glFramebufferSampleLocationsfvARBPROC glFramebufferSampleLocationsfvARB = (glFramebufferSampleLocationsfvARBPROC)tlsGetFunction(1311); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glFramebufferSampleLocationsfvARB(target, start, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSampleLocations_nglNamedFramebufferSampleLocationsfvARB__IIIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint start, jint count, jlong vAddress) { - glNamedFramebufferSampleLocationsfvARBPROC glNamedFramebufferSampleLocationsfvARB = (glNamedFramebufferSampleLocationsfvARBPROC)tlsGetFunction(1312); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glNamedFramebufferSampleLocationsfvARB(framebuffer, start, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSampleLocations_glEvaluateDepthValuesARB(JNIEnv *__env, jclass clazz) { - glEvaluateDepthValuesARBPROC glEvaluateDepthValuesARB = (glEvaluateDepthValuesARBPROC)tlsGetFunction(1313); - UNUSED_PARAM(clazz) - glEvaluateDepthValuesARB(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSampleShading.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSampleShading.c deleted file mode 100644 index 7decbeaa..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSampleShading.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glMinSampleShadingARBPROC) (jfloat); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSampleShading_glMinSampleShadingARB(JNIEnv *__env, jclass clazz, jfloat value) { - glMinSampleShadingARBPROC glMinSampleShadingARB = (glMinSampleShadingARBPROC)tlsGetFunction(1314); - UNUSED_PARAM(clazz) - glMinSampleShadingARB(value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBShaderObjects.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBShaderObjects.c deleted file mode 100644 index a4ab03f3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBShaderObjects.c +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDeleteObjectARBPROC) (jint); -typedef jint (APIENTRY *glGetHandleARBPROC) (jint); -typedef void (APIENTRY *glDetachObjectARBPROC) (jint, jint); -typedef jint (APIENTRY *glCreateShaderObjectARBPROC) (jint); -typedef void (APIENTRY *glShaderSourceARBPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glCompileShaderARBPROC) (jint); -typedef jint (APIENTRY *glCreateProgramObjectARBPROC) (void); -typedef void (APIENTRY *glAttachObjectARBPROC) (jint, jint); -typedef void (APIENTRY *glLinkProgramARBPROC) (jint); -typedef void (APIENTRY *glUseProgramObjectARBPROC) (jint); -typedef void (APIENTRY *glValidateProgramARBPROC) (jint); -typedef void (APIENTRY *glUniform1fARBPROC) (jint, jfloat); -typedef void (APIENTRY *glUniform2fARBPROC) (jint, jfloat, jfloat); -typedef void (APIENTRY *glUniform3fARBPROC) (jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glUniform4fARBPROC) (jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glUniform1iARBPROC) (jint, jint); -typedef void (APIENTRY *glUniform2iARBPROC) (jint, jint, jint); -typedef void (APIENTRY *glUniform3iARBPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glUniform4iARBPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glUniform1fvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2fvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3fvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4fvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform1ivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2ivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3ivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4ivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniformMatrix2fvARBPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix3fvARBPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix4fvARBPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glGetObjectParameterfvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetObjectParameterivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetInfoLogARBPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetAttachedObjectsARBPROC) (jint, jint, uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetUniformLocationARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetActiveUniformARBPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetUniformfvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetShaderSourceARBPROC) (jint, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glDeleteObjectARB(JNIEnv *__env, jclass clazz, jint obj) { - glDeleteObjectARBPROC glDeleteObjectARB = (glDeleteObjectARBPROC)tlsGetFunction(1315); - UNUSED_PARAM(clazz) - glDeleteObjectARB(obj); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glGetHandleARB(JNIEnv *__env, jclass clazz, jint pname) { - glGetHandleARBPROC glGetHandleARB = (glGetHandleARBPROC)tlsGetFunction(1316); - UNUSED_PARAM(clazz) - return glGetHandleARB(pname); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glDetachObjectARB(JNIEnv *__env, jclass clazz, jint containerObj, jint attachedObj) { - glDetachObjectARBPROC glDetachObjectARB = (glDetachObjectARBPROC)tlsGetFunction(1317); - UNUSED_PARAM(clazz) - glDetachObjectARB(containerObj, attachedObj); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glCreateShaderObjectARB(JNIEnv *__env, jclass clazz, jint shaderType) { - glCreateShaderObjectARBPROC glCreateShaderObjectARB = (glCreateShaderObjectARBPROC)tlsGetFunction(1318); - UNUSED_PARAM(clazz) - return glCreateShaderObjectARB(shaderType); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglShaderSourceARB__IIJJ(JNIEnv *__env, jclass clazz, jint shaderObj, jint count, jlong stringAddress, jlong lengthAddress) { - glShaderSourceARBPROC glShaderSourceARB = (glShaderSourceARBPROC)tlsGetFunction(1319); - uintptr_t string = (uintptr_t)stringAddress; - uintptr_t length = (uintptr_t)lengthAddress; - UNUSED_PARAM(clazz) - glShaderSourceARB(shaderObj, count, string, length); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glCompileShaderARB(JNIEnv *__env, jclass clazz, jint shaderObj) { - glCompileShaderARBPROC glCompileShaderARB = (glCompileShaderARBPROC)tlsGetFunction(1320); - UNUSED_PARAM(clazz) - glCompileShaderARB(shaderObj); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glCreateProgramObjectARB(JNIEnv *__env, jclass clazz) { - glCreateProgramObjectARBPROC glCreateProgramObjectARB = (glCreateProgramObjectARBPROC)tlsGetFunction(1321); - UNUSED_PARAM(clazz) - return glCreateProgramObjectARB(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glAttachObjectARB(JNIEnv *__env, jclass clazz, jint containerObj, jint obj) { - glAttachObjectARBPROC glAttachObjectARB = (glAttachObjectARBPROC)tlsGetFunction(1322); - UNUSED_PARAM(clazz) - glAttachObjectARB(containerObj, obj); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glLinkProgramARB(JNIEnv *__env, jclass clazz, jint programObj) { - glLinkProgramARBPROC glLinkProgramARB = (glLinkProgramARBPROC)tlsGetFunction(1323); - UNUSED_PARAM(clazz) - glLinkProgramARB(programObj); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUseProgramObjectARB(JNIEnv *__env, jclass clazz, jint programObj) { - glUseProgramObjectARBPROC glUseProgramObjectARB = (glUseProgramObjectARBPROC)tlsGetFunction(1324); - UNUSED_PARAM(clazz) - glUseProgramObjectARB(programObj); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glValidateProgramARB(JNIEnv *__env, jclass clazz, jint programObj) { - glValidateProgramARBPROC glValidateProgramARB = (glValidateProgramARBPROC)tlsGetFunction(1325); - UNUSED_PARAM(clazz) - glValidateProgramARB(programObj); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUniform1fARB(JNIEnv *__env, jclass clazz, jint location, jfloat v0) { - glUniform1fARBPROC glUniform1fARB = (glUniform1fARBPROC)tlsGetFunction(1326); - UNUSED_PARAM(clazz) - glUniform1fARB(location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUniform2fARB(JNIEnv *__env, jclass clazz, jint location, jfloat v0, jfloat v1) { - glUniform2fARBPROC glUniform2fARB = (glUniform2fARBPROC)tlsGetFunction(1327); - UNUSED_PARAM(clazz) - glUniform2fARB(location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUniform3fARB(JNIEnv *__env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2) { - glUniform3fARBPROC glUniform3fARB = (glUniform3fARBPROC)tlsGetFunction(1328); - UNUSED_PARAM(clazz) - glUniform3fARB(location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUniform4fARB(JNIEnv *__env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jfloat v3) { - glUniform4fARBPROC glUniform4fARB = (glUniform4fARBPROC)tlsGetFunction(1329); - UNUSED_PARAM(clazz) - glUniform4fARB(location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUniform1iARB(JNIEnv *__env, jclass clazz, jint location, jint v0) { - glUniform1iARBPROC glUniform1iARB = (glUniform1iARBPROC)tlsGetFunction(1330); - UNUSED_PARAM(clazz) - glUniform1iARB(location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUniform2iARB(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1) { - glUniform2iARBPROC glUniform2iARB = (glUniform2iARBPROC)tlsGetFunction(1331); - UNUSED_PARAM(clazz) - glUniform2iARB(location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUniform3iARB(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1, jint v2) { - glUniform3iARBPROC glUniform3iARB = (glUniform3iARBPROC)tlsGetFunction(1332); - UNUSED_PARAM(clazz) - glUniform3iARB(location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_glUniform4iARB(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1, jint v2, jint v3) { - glUniform4iARBPROC glUniform4iARB = (glUniform4iARBPROC)tlsGetFunction(1333); - UNUSED_PARAM(clazz) - glUniform4iARB(location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniform1fvARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1fvARBPROC glUniform1fvARB = (glUniform1fvARBPROC)tlsGetFunction(1334); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1fvARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniform2fvARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2fvARBPROC glUniform2fvARB = (glUniform2fvARBPROC)tlsGetFunction(1335); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2fvARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniform3fvARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3fvARBPROC glUniform3fvARB = (glUniform3fvARBPROC)tlsGetFunction(1336); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3fvARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniform4fvARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4fvARBPROC glUniform4fvARB = (glUniform4fvARBPROC)tlsGetFunction(1337); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4fvARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniform1ivARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1ivARBPROC glUniform1ivARB = (glUniform1ivARBPROC)tlsGetFunction(1338); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1ivARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniform2ivARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2ivARBPROC glUniform2ivARB = (glUniform2ivARBPROC)tlsGetFunction(1339); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2ivARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniform3ivARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3ivARBPROC glUniform3ivARB = (glUniform3ivARBPROC)tlsGetFunction(1340); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3ivARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniform4ivARB__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4ivARBPROC glUniform4ivARB = (glUniform4ivARBPROC)tlsGetFunction(1341); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4ivARB(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniformMatrix2fvARB__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix2fvARBPROC glUniformMatrix2fvARB = (glUniformMatrix2fvARBPROC)tlsGetFunction(1342); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix2fvARB(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniformMatrix3fvARB__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix3fvARBPROC glUniformMatrix3fvARB = (glUniformMatrix3fvARBPROC)tlsGetFunction(1343); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix3fvARB(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglUniformMatrix4fvARB__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix4fvARBPROC glUniformMatrix4fvARB = (glUniformMatrix4fvARBPROC)tlsGetFunction(1344); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix4fvARB(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetObjectParameterfvARB__IIJ(JNIEnv *__env, jclass clazz, jint obj, jint pname, jlong paramsAddress) { - glGetObjectParameterfvARBPROC glGetObjectParameterfvARB = (glGetObjectParameterfvARBPROC)tlsGetFunction(1345); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetObjectParameterfvARB(obj, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetObjectParameterivARB__IIJ(JNIEnv *__env, jclass clazz, jint obj, jint pname, jlong paramsAddress) { - glGetObjectParameterivARBPROC glGetObjectParameterivARB = (glGetObjectParameterivARBPROC)tlsGetFunction(1346); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetObjectParameterivARB(obj, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetInfoLogARB__IIJJ(JNIEnv *__env, jclass clazz, jint obj, jint maxLength, jlong lengthAddress, jlong infoLogAddress) { - glGetInfoLogARBPROC glGetInfoLogARB = (glGetInfoLogARBPROC)tlsGetFunction(1347); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t infoLog = (uintptr_t)infoLogAddress; - UNUSED_PARAM(clazz) - glGetInfoLogARB(obj, maxLength, length, infoLog); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetAttachedObjectsARB__IIJJ(JNIEnv *__env, jclass clazz, jint containerObj, jint maxCount, jlong countAddress, jlong objAddress) { - glGetAttachedObjectsARBPROC glGetAttachedObjectsARB = (glGetAttachedObjectsARBPROC)tlsGetFunction(1348); - uintptr_t count = (uintptr_t)countAddress; - uintptr_t obj = (uintptr_t)objAddress; - UNUSED_PARAM(clazz) - glGetAttachedObjectsARB(containerObj, maxCount, count, obj); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetUniformLocationARB(JNIEnv *__env, jclass clazz, jint programObj, jlong nameAddress) { - glGetUniformLocationARBPROC glGetUniformLocationARB = (glGetUniformLocationARBPROC)tlsGetFunction(1349); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetUniformLocationARB(programObj, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetActiveUniformARB__IIIJJJJ(JNIEnv *__env, jclass clazz, jint programObj, jint index, jint maxLength, jlong lengthAddress, jlong sizeAddress, jlong typeAddress, jlong nameAddress) { - glGetActiveUniformARBPROC glGetActiveUniformARB = (glGetActiveUniformARBPROC)tlsGetFunction(1350); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t size = (uintptr_t)sizeAddress; - uintptr_t type = (uintptr_t)typeAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetActiveUniformARB(programObj, index, maxLength, length, size, type, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetUniformfvARB__IIJ(JNIEnv *__env, jclass clazz, jint programObj, jint location, jlong paramsAddress) { - glGetUniformfvARBPROC glGetUniformfvARB = (glGetUniformfvARBPROC)tlsGetFunction(1351); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformfvARB(programObj, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetUniformivARB__IIJ(JNIEnv *__env, jclass clazz, jint programObj, jint location, jlong paramsAddress) { - glGetUniformivARBPROC glGetUniformivARB = (glGetUniformivARBPROC)tlsGetFunction(1352); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformivARB(programObj, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShaderObjects_nglGetShaderSourceARB__IIJJ(JNIEnv *__env, jclass clazz, jint obj, jint maxLength, jlong lengthAddress, jlong sourceAddress) { - glGetShaderSourceARBPROC glGetShaderSourceARB = (glGetShaderSourceARBPROC)tlsGetFunction(1353); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t source = (uintptr_t)sourceAddress; - UNUSED_PARAM(clazz) - glGetShaderSourceARB(obj, maxLength, length, source); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBShadingLanguageInclude.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBShadingLanguageInclude.c deleted file mode 100644 index 8f718090..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBShadingLanguageInclude.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glNamedStringARBPROC) (jint, jint, uintptr_t, jint, uintptr_t); -typedef void (APIENTRY *glDeleteNamedStringARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glCompileShaderIncludeARBPROC) (jint, jint, uintptr_t, uintptr_t); -typedef jboolean (APIENTRY *glIsNamedStringARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetNamedStringARBPROC) (jint, uintptr_t, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetNamedStringivARBPROC) (jint, uintptr_t, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShadingLanguageInclude_nglNamedStringARB(JNIEnv *__env, jclass clazz, jint type, jint namelen, jlong nameAddress, jint stringlen, jlong stringAddress) { - glNamedStringARBPROC glNamedStringARB = (glNamedStringARBPROC)tlsGetFunction(1354); - uintptr_t name = (uintptr_t)nameAddress; - uintptr_t string = (uintptr_t)stringAddress; - UNUSED_PARAM(clazz) - glNamedStringARB(type, namelen, name, stringlen, string); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShadingLanguageInclude_nglDeleteNamedStringARB(JNIEnv *__env, jclass clazz, jint namelen, jlong nameAddress) { - glDeleteNamedStringARBPROC glDeleteNamedStringARB = (glDeleteNamedStringARBPROC)tlsGetFunction(1355); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glDeleteNamedStringARB(namelen, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShadingLanguageInclude_nglCompileShaderIncludeARB__IIJJ(JNIEnv *__env, jclass clazz, jint shader, jint count, jlong pathAddress, jlong lengthAddress) { - glCompileShaderIncludeARBPROC glCompileShaderIncludeARB = (glCompileShaderIncludeARBPROC)tlsGetFunction(1356); - uintptr_t path = (uintptr_t)pathAddress; - uintptr_t length = (uintptr_t)lengthAddress; - UNUSED_PARAM(clazz) - glCompileShaderIncludeARB(shader, count, path, length); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_ARBShadingLanguageInclude_nglIsNamedStringARB(JNIEnv *__env, jclass clazz, jint namelen, jlong nameAddress) { - glIsNamedStringARBPROC glIsNamedStringARB = (glIsNamedStringARBPROC)tlsGetFunction(1357); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glIsNamedStringARB(namelen, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShadingLanguageInclude_nglGetNamedStringARB__IJIJJ(JNIEnv *__env, jclass clazz, jint namelen, jlong nameAddress, jint bufSize, jlong stringlenAddress, jlong stringAddress) { - glGetNamedStringARBPROC glGetNamedStringARB = (glGetNamedStringARBPROC)tlsGetFunction(1358); - uintptr_t name = (uintptr_t)nameAddress; - uintptr_t stringlen = (uintptr_t)stringlenAddress; - uintptr_t string = (uintptr_t)stringAddress; - UNUSED_PARAM(clazz) - glGetNamedStringARB(namelen, name, bufSize, stringlen, string); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBShadingLanguageInclude_nglGetNamedStringivARB__IJIJ(JNIEnv *__env, jclass clazz, jint namelen, jlong nameAddress, jint pname, jlong paramsAddress) { - glGetNamedStringivARBPROC glGetNamedStringivARB = (glGetNamedStringivARBPROC)tlsGetFunction(1359); - uintptr_t name = (uintptr_t)nameAddress; - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedStringivARB(namelen, name, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSparseBuffer.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSparseBuffer.c deleted file mode 100644 index c3a93e31..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSparseBuffer.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBufferPageCommitmentARBPROC) (jint, uintptr_t, uintptr_t, jboolean); -typedef void (APIENTRY *glNamedBufferPageCommitmentEXTPROC) (jint, uintptr_t, uintptr_t, jboolean); -typedef void (APIENTRY *glNamedBufferPageCommitmentARBPROC) (jint, uintptr_t, uintptr_t, jboolean); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSparseBuffer_glBufferPageCommitmentARB(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong size, jboolean commit) { - glBufferPageCommitmentARBPROC glBufferPageCommitmentARB = (glBufferPageCommitmentARBPROC)tlsGetFunction(1360); - UNUSED_PARAM(clazz) - glBufferPageCommitmentARB(target, (uintptr_t)offset, (uintptr_t)size, commit); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSparseBuffer_glNamedBufferPageCommitmentEXT(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong size, jboolean commit) { - glNamedBufferPageCommitmentEXTPROC glNamedBufferPageCommitmentEXT = (glNamedBufferPageCommitmentEXTPROC)tlsGetFunction(1361); - UNUSED_PARAM(clazz) - glNamedBufferPageCommitmentEXT(buffer, (uintptr_t)offset, (uintptr_t)size, commit); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSparseBuffer_glNamedBufferPageCommitmentARB(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong size, jboolean commit) { - glNamedBufferPageCommitmentARBPROC glNamedBufferPageCommitmentARB = (glNamedBufferPageCommitmentARBPROC)tlsGetFunction(1362); - UNUSED_PARAM(clazz) - glNamedBufferPageCommitmentARB(buffer, (uintptr_t)offset, (uintptr_t)size, commit); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSparseTexture.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSparseTexture.c deleted file mode 100644 index 37734620..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBSparseTexture.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTexPageCommitmentARBPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTexturePageCommitmentEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jboolean); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSparseTexture_glTexPageCommitmentARB(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jboolean commit) { - glTexPageCommitmentARBPROC glTexPageCommitmentARB = (glTexPageCommitmentARBPROC)tlsGetFunction(1363); - UNUSED_PARAM(clazz) - glTexPageCommitmentARB(target, level, xoffset, yoffset, zoffset, width, height, depth, commit); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBSparseTexture_glTexturePageCommitmentEXT(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jboolean commit) { - glTexturePageCommitmentEXTPROC glTexturePageCommitmentEXT = (glTexturePageCommitmentEXTPROC)tlsGetFunction(1364); - UNUSED_PARAM(clazz) - glTexturePageCommitmentEXT(texture, level, xoffset, yoffset, zoffset, width, height, depth, commit); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureBufferObject.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureBufferObject.c deleted file mode 100644 index e29a3a00..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureBufferObject.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTexBufferARBPROC) (jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureBufferObject_glTexBufferARB(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint buffer) { - glTexBufferARBPROC glTexBufferARB = (glTexBufferARBPROC)tlsGetFunction(1365); - UNUSED_PARAM(clazz) - glTexBufferARB(target, internalformat, buffer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureBufferRange.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureBufferRange.c deleted file mode 100644 index 82bfc1fb..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureBufferRange.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTextureBufferRangeEXTPROC) (jint, jint, jint, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureBufferRange_glTextureBufferRangeEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint internalformat, jint buffer, jlong offset, jlong size) { - glTextureBufferRangeEXTPROC glTextureBufferRangeEXT = (glTextureBufferRangeEXTPROC)tlsGetFunction(1366); - UNUSED_PARAM(clazz) - glTextureBufferRangeEXT(texture, target, internalformat, buffer, (uintptr_t)offset, (uintptr_t)size); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureCompression.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureCompression.c deleted file mode 100644 index 5277a2d2..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureCompression.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glCompressedTexImage3DARBPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexImage2DARBPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexImage1DARBPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexSubImage3DARBPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexSubImage2DARBPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexSubImage1DARBPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetCompressedTexImageARBPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureCompression_nglCompressedTexImage3DARB(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jlong dataAddress) { - glCompressedTexImage3DARBPROC glCompressedTexImage3DARB = (glCompressedTexImage3DARBPROC)tlsGetFunction(1367); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureCompression_nglCompressedTexImage2DARB(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jlong dataAddress) { - glCompressedTexImage2DARBPROC glCompressedTexImage2DARB = (glCompressedTexImage2DARBPROC)tlsGetFunction(1368); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureCompression_nglCompressedTexImage1DARB(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint border, jint imageSize, jlong dataAddress) { - glCompressedTexImage1DARBPROC glCompressedTexImage1DARB = (glCompressedTexImage1DARBPROC)tlsGetFunction(1369); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureCompression_nglCompressedTexSubImage3DARB(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jlong dataAddress) { - glCompressedTexSubImage3DARBPROC glCompressedTexSubImage3DARB = (glCompressedTexSubImage3DARBPROC)tlsGetFunction(1370); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureCompression_nglCompressedTexSubImage2DARB(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jlong dataAddress) { - glCompressedTexSubImage2DARBPROC glCompressedTexSubImage2DARB = (glCompressedTexSubImage2DARBPROC)tlsGetFunction(1371); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureCompression_nglCompressedTexSubImage1DARB(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint width, jint format, jint imageSize, jlong dataAddress) { - glCompressedTexSubImage1DARBPROC glCompressedTexSubImage1DARB = (glCompressedTexSubImage1DARBPROC)tlsGetFunction(1372); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureCompression_nglGetCompressedTexImageARB(JNIEnv *__env, jclass clazz, jint target, jint level, jlong pixelsAddress) { - glGetCompressedTexImageARBPROC glGetCompressedTexImageARB = (glGetCompressedTexImageARBPROC)tlsGetFunction(1373); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetCompressedTexImageARB(target, level, pixels); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureStorage.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureStorage.c deleted file mode 100644 index bae12d65..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureStorage.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTextureStorage1DEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorage2DEXTPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureStorage_glTextureStorage1DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width) { - glTextureStorage1DEXTPROC glTextureStorage1DEXT = (glTextureStorage1DEXTPROC)tlsGetFunction(1374); - UNUSED_PARAM(clazz) - glTextureStorage1DEXT(texture, target, levels, internalformat, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureStorage_glTextureStorage2DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width, jint height) { - glTextureStorage2DEXTPROC glTextureStorage2DEXT = (glTextureStorage2DEXTPROC)tlsGetFunction(1375); - UNUSED_PARAM(clazz) - glTextureStorage2DEXT(texture, target, levels, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureStorage_glTextureStorage3DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) { - glTextureStorage3DEXTPROC glTextureStorage3DEXT = (glTextureStorage3DEXTPROC)tlsGetFunction(1376); - UNUSED_PARAM(clazz) - glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureStorageMultisample.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureStorageMultisample.c deleted file mode 100644 index 570c3676..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTextureStorageMultisample.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTextureStorage2DMultisampleEXTPROC) (jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTextureStorage3DMultisampleEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jboolean); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureStorageMultisample_glTextureStorage2DMultisampleEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint samples, jint internalformat, jint width, jint height, jboolean fixedsamplelocations) { - glTextureStorage2DMultisampleEXTPROC glTextureStorage2DMultisampleEXT = (glTextureStorage2DMultisampleEXTPROC)tlsGetFunction(1377); - UNUSED_PARAM(clazz) - glTextureStorage2DMultisampleEXT(texture, target, samples, internalformat, width, height, fixedsamplelocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureStorageMultisample_glTextureStorage3DMultisampleEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) { - glTextureStorage3DMultisampleEXTPROC glTextureStorage3DMultisampleEXT = (glTextureStorage3DMultisampleEXTPROC)tlsGetFunction(1378); - UNUSED_PARAM(clazz) - glTextureStorage3DMultisampleEXT(texture, target, samples, internalformat, width, height, depth, fixedsamplelocations); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTransposeMatrix.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTransposeMatrix.c deleted file mode 100644 index aedef903..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBTransposeMatrix.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glLoadTransposeMatrixfARBPROC) (uintptr_t); -typedef void (APIENTRY *glLoadTransposeMatrixdARBPROC) (uintptr_t); -typedef void (APIENTRY *glMultTransposeMatrixfARBPROC) (uintptr_t); -typedef void (APIENTRY *glMultTransposeMatrixdARBPROC) (uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTransposeMatrix_nglLoadTransposeMatrixfARB__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glLoadTransposeMatrixfARBPROC glLoadTransposeMatrixfARB = (glLoadTransposeMatrixfARBPROC)tlsGetFunction(1379); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glLoadTransposeMatrixfARB(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTransposeMatrix_nglLoadTransposeMatrixdARB__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glLoadTransposeMatrixdARBPROC glLoadTransposeMatrixdARB = (glLoadTransposeMatrixdARBPROC)tlsGetFunction(1380); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glLoadTransposeMatrixdARB(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTransposeMatrix_nglMultTransposeMatrixfARB__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glMultTransposeMatrixfARBPROC glMultTransposeMatrixfARB = (glMultTransposeMatrixfARBPROC)tlsGetFunction(1381); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMultTransposeMatrixfARB(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTransposeMatrix_nglMultTransposeMatrixdARB__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glMultTransposeMatrixdARBPROC glMultTransposeMatrixdARB = (glMultTransposeMatrixdARBPROC)tlsGetFunction(1382); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMultTransposeMatrixdARB(m); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexAttrib64Bit.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexAttrib64Bit.c deleted file mode 100644 index 72029258..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexAttrib64Bit.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexArrayVertexAttribLOffsetEXTPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexAttrib64Bit_glVertexArrayVertexAttribLOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint index, jint size, jint type, jint stride, jlong offset) { - glVertexArrayVertexAttribLOffsetEXTPROC glVertexArrayVertexAttribLOffsetEXT = (glVertexArrayVertexAttribLOffsetEXTPROC)tlsGetFunction(1383); - UNUSED_PARAM(clazz) - glVertexArrayVertexAttribLOffsetEXT(vaobj, buffer, index, size, type, stride, (uintptr_t)offset); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexAttribBinding.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexAttribBinding.c deleted file mode 100644 index 7ec5dfc9..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexAttribBinding.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexArrayBindVertexBufferEXTPROC) (jint, jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glVertexArrayVertexAttribFormatEXTPROC) (jint, jint, jint, jint, jboolean, jint); -typedef void (APIENTRY *glVertexArrayVertexAttribIFormatEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glVertexArrayVertexAttribLFormatEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glVertexArrayVertexAttribBindingEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glVertexArrayVertexBindingDivisorEXTPROC) (jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexAttribBinding_glVertexArrayBindVertexBufferEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint bindingindex, jint buffer, jlong offset, jint stride) { - glVertexArrayBindVertexBufferEXTPROC glVertexArrayBindVertexBufferEXT = (glVertexArrayBindVertexBufferEXTPROC)tlsGetFunction(1384); - UNUSED_PARAM(clazz) - glVertexArrayBindVertexBufferEXT(vaobj, bindingindex, buffer, (uintptr_t)offset, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexAttribBinding_glVertexArrayVertexAttribFormatEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint attribindex, jint size, jint type, jboolean normalized, jint relativeoffset) { - glVertexArrayVertexAttribFormatEXTPROC glVertexArrayVertexAttribFormatEXT = (glVertexArrayVertexAttribFormatEXTPROC)tlsGetFunction(1385); - UNUSED_PARAM(clazz) - glVertexArrayVertexAttribFormatEXT(vaobj, attribindex, size, type, normalized, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexAttribBinding_glVertexArrayVertexAttribIFormatEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint attribindex, jint size, jint type, jint relativeoffset) { - glVertexArrayVertexAttribIFormatEXTPROC glVertexArrayVertexAttribIFormatEXT = (glVertexArrayVertexAttribIFormatEXTPROC)tlsGetFunction(1386); - UNUSED_PARAM(clazz) - glVertexArrayVertexAttribIFormatEXT(vaobj, attribindex, size, type, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexAttribBinding_glVertexArrayVertexAttribLFormatEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint attribindex, jint size, jint type, jint relativeoffset) { - glVertexArrayVertexAttribLFormatEXTPROC glVertexArrayVertexAttribLFormatEXT = (glVertexArrayVertexAttribLFormatEXTPROC)tlsGetFunction(1387); - UNUSED_PARAM(clazz) - glVertexArrayVertexAttribLFormatEXT(vaobj, attribindex, size, type, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexAttribBinding_glVertexArrayVertexAttribBindingEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint attribindex, jint bindingindex) { - glVertexArrayVertexAttribBindingEXTPROC glVertexArrayVertexAttribBindingEXT = (glVertexArrayVertexAttribBindingEXTPROC)tlsGetFunction(1388); - UNUSED_PARAM(clazz) - glVertexArrayVertexAttribBindingEXT(vaobj, attribindex, bindingindex); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexAttribBinding_glVertexArrayVertexBindingDivisorEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint bindingindex, jint divisor) { - glVertexArrayVertexBindingDivisorEXTPROC glVertexArrayVertexBindingDivisorEXT = (glVertexArrayVertexBindingDivisorEXTPROC)tlsGetFunction(1389); - UNUSED_PARAM(clazz) - glVertexArrayVertexBindingDivisorEXT(vaobj, bindingindex, divisor); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexBlend.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexBlend.c deleted file mode 100644 index 285a33db..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexBlend.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glWeightfvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glWeightbvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glWeightubvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glWeightsvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glWeightusvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glWeightivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glWeightuivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glWeightdvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glWeightPointerARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexBlendARBPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightfvARB__IJ(JNIEnv *__env, jclass clazz, jint size, jlong weightsAddress) { - glWeightfvARBPROC glWeightfvARB = (glWeightfvARBPROC)tlsGetFunction(1390); - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightfvARB(size, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightbvARB(JNIEnv *__env, jclass clazz, jint size, jlong weightsAddress) { - glWeightbvARBPROC glWeightbvARB = (glWeightbvARBPROC)tlsGetFunction(1391); - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightbvARB(size, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightubvARB(JNIEnv *__env, jclass clazz, jint size, jlong weightsAddress) { - glWeightubvARBPROC glWeightubvARB = (glWeightubvARBPROC)tlsGetFunction(1392); - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightubvARB(size, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightsvARB__IJ(JNIEnv *__env, jclass clazz, jint size, jlong weightsAddress) { - glWeightsvARBPROC glWeightsvARB = (glWeightsvARBPROC)tlsGetFunction(1393); - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightsvARB(size, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightusvARB__IJ(JNIEnv *__env, jclass clazz, jint size, jlong weightsAddress) { - glWeightusvARBPROC glWeightusvARB = (glWeightusvARBPROC)tlsGetFunction(1394); - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightusvARB(size, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightivARB__IJ(JNIEnv *__env, jclass clazz, jint size, jlong weightsAddress) { - glWeightivARBPROC glWeightivARB = (glWeightivARBPROC)tlsGetFunction(1395); - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightivARB(size, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightuivARB__IJ(JNIEnv *__env, jclass clazz, jint size, jlong weightsAddress) { - glWeightuivARBPROC glWeightuivARB = (glWeightuivARBPROC)tlsGetFunction(1396); - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightuivARB(size, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightdvARB__IJ(JNIEnv *__env, jclass clazz, jint size, jlong weightsAddress) { - glWeightdvARBPROC glWeightdvARB = (glWeightdvARBPROC)tlsGetFunction(1397); - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightdvARB(size, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_nglWeightPointerARB__IIIJ(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride, jlong pointerAddress) { - glWeightPointerARBPROC glWeightPointerARB = (glWeightPointerARBPROC)tlsGetFunction(1398); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glWeightPointerARB(size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBlend_glVertexBlendARB(JNIEnv *__env, jclass clazz, jint count) { - glVertexBlendARBPROC glVertexBlendARB = (glVertexBlendARBPROC)tlsGetFunction(1399); - UNUSED_PARAM(clazz) - glVertexBlendARB(count); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexBufferObject.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexBufferObject.c deleted file mode 100644 index 8562ffe2..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexBufferObject.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBindBufferARBPROC) (jint, jint); -typedef void (APIENTRY *glDeleteBuffersARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenBuffersARBPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsBufferARBPROC) (jint); -typedef void (APIENTRY *glBufferDataARBPROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glBufferSubDataARBPROC) (jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetBufferSubDataARBPROC) (jint, uintptr_t, uintptr_t, uintptr_t); -typedef uintptr_t (APIENTRY *glMapBufferARBPROC) (jint, jint); -typedef jboolean (APIENTRY *glUnmapBufferARBPROC) (jint); -typedef void (APIENTRY *glGetBufferParameterivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetBufferPointervARBPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_glBindBufferARB(JNIEnv *__env, jclass clazz, jint target, jint buffer) { - glBindBufferARBPROC glBindBufferARB = (glBindBufferARBPROC)tlsGetFunction(1400); - UNUSED_PARAM(clazz) - glBindBufferARB(target, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_nglDeleteBuffersARB__IJ(JNIEnv *__env, jclass clazz, jint n, jlong buffersAddress) { - glDeleteBuffersARBPROC glDeleteBuffersARB = (glDeleteBuffersARBPROC)tlsGetFunction(1401); - uintptr_t buffers = (uintptr_t)buffersAddress; - UNUSED_PARAM(clazz) - glDeleteBuffersARB(n, buffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_nglGenBuffersARB__IJ(JNIEnv *__env, jclass clazz, jint n, jlong buffersAddress) { - glGenBuffersARBPROC glGenBuffersARB = (glGenBuffersARBPROC)tlsGetFunction(1402); - uintptr_t buffers = (uintptr_t)buffersAddress; - UNUSED_PARAM(clazz) - glGenBuffersARB(n, buffers); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_glIsBufferARB(JNIEnv *__env, jclass clazz, jint buffer) { - glIsBufferARBPROC glIsBufferARB = (glIsBufferARBPROC)tlsGetFunction(1403); - UNUSED_PARAM(clazz) - return glIsBufferARB(buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_nglBufferDataARB__IJJI(JNIEnv *__env, jclass clazz, jint target, jlong size, jlong dataAddress, jint usage) { - glBufferDataARBPROC glBufferDataARB = (glBufferDataARBPROC)tlsGetFunction(1404); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glBufferDataARB(target, (uintptr_t)size, data, usage); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_nglBufferSubDataARB__IJJJ(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong size, jlong dataAddress) { - glBufferSubDataARBPROC glBufferSubDataARB = (glBufferSubDataARBPROC)tlsGetFunction(1405); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glBufferSubDataARB(target, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_nglGetBufferSubDataARB__IJJJ(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong size, jlong dataAddress) { - glGetBufferSubDataARBPROC glGetBufferSubDataARB = (glGetBufferSubDataARBPROC)tlsGetFunction(1406); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetBufferSubDataARB(target, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_nglMapBufferARB(JNIEnv *__env, jclass clazz, jint target, jint access) { - glMapBufferARBPROC glMapBufferARB = (glMapBufferARBPROC)tlsGetFunction(1407); - UNUSED_PARAM(clazz) - return (jlong)glMapBufferARB(target, access); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_glUnmapBufferARB(JNIEnv *__env, jclass clazz, jint target) { - glUnmapBufferARBPROC glUnmapBufferARB = (glUnmapBufferARBPROC)tlsGetFunction(1408); - UNUSED_PARAM(clazz) - return glUnmapBufferARB(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_nglGetBufferParameterivARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetBufferParameterivARBPROC glGetBufferParameterivARB = (glGetBufferParameterivARBPROC)tlsGetFunction(1409); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetBufferParameterivARB(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexBufferObject_nglGetBufferPointervARB(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetBufferPointervARBPROC glGetBufferPointervARB = (glGetBufferPointervARBPROC)tlsGetFunction(1410); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetBufferPointervARB(target, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexProgram.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexProgram.c deleted file mode 100644 index 805032e7..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexProgram.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glProgramStringARBPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glBindProgramARBPROC) (jint, jint); -typedef void (APIENTRY *glDeleteProgramsARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenProgramsARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glProgramEnvParameter4dARBPROC) (jint, jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glProgramEnvParameter4dvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramEnvParameter4fARBPROC) (jint, jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glProgramEnvParameter4fvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramLocalParameter4dARBPROC) (jint, jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glProgramLocalParameter4dvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramLocalParameter4fARBPROC) (jint, jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glProgramLocalParameter4fvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramEnvParameterfvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramEnvParameterdvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramLocalParameterfvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramLocalParameterdvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramStringARBPROC) (jint, jint, uintptr_t); -typedef jboolean (APIENTRY *glIsProgramARBPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglProgramStringARB(JNIEnv *__env, jclass clazz, jint target, jint format, jint len, jlong stringAddress) { - glProgramStringARBPROC glProgramStringARB = (glProgramStringARBPROC)tlsGetFunction(1450); - uintptr_t string = (uintptr_t)stringAddress; - UNUSED_PARAM(clazz) - glProgramStringARB(target, format, len, string); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glBindProgramARB(JNIEnv *__env, jclass clazz, jint target, jint program) { - glBindProgramARBPROC glBindProgramARB = (glBindProgramARBPROC)tlsGetFunction(1451); - UNUSED_PARAM(clazz) - glBindProgramARB(target, program); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglDeleteProgramsARB__IJ(JNIEnv *__env, jclass clazz, jint n, jlong programsAddress) { - glDeleteProgramsARBPROC glDeleteProgramsARB = (glDeleteProgramsARBPROC)tlsGetFunction(1452); - uintptr_t programs = (uintptr_t)programsAddress; - UNUSED_PARAM(clazz) - glDeleteProgramsARB(n, programs); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGenProgramsARB__IJ(JNIEnv *__env, jclass clazz, jint n, jlong programsAddress) { - glGenProgramsARBPROC glGenProgramsARB = (glGenProgramsARBPROC)tlsGetFunction(1453); - uintptr_t programs = (uintptr_t)programsAddress; - UNUSED_PARAM(clazz) - glGenProgramsARB(n, programs); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glProgramEnvParameter4dARB(JNIEnv *__env, jclass clazz, jint target, jint index, jdouble x, jdouble y, jdouble z, jdouble w) { - glProgramEnvParameter4dARBPROC glProgramEnvParameter4dARB = (glProgramEnvParameter4dARBPROC)tlsGetFunction(1454); - UNUSED_PARAM(clazz) - glProgramEnvParameter4dARB(target, index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglProgramEnvParameter4dvARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glProgramEnvParameter4dvARBPROC glProgramEnvParameter4dvARB = (glProgramEnvParameter4dvARBPROC)tlsGetFunction(1455); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glProgramEnvParameter4dvARB(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glProgramEnvParameter4fARB(JNIEnv *__env, jclass clazz, jint target, jint index, jfloat x, jfloat y, jfloat z, jfloat w) { - glProgramEnvParameter4fARBPROC glProgramEnvParameter4fARB = (glProgramEnvParameter4fARBPROC)tlsGetFunction(1456); - UNUSED_PARAM(clazz) - glProgramEnvParameter4fARB(target, index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglProgramEnvParameter4fvARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glProgramEnvParameter4fvARBPROC glProgramEnvParameter4fvARB = (glProgramEnvParameter4fvARBPROC)tlsGetFunction(1457); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glProgramEnvParameter4fvARB(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glProgramLocalParameter4dARB(JNIEnv *__env, jclass clazz, jint target, jint index, jdouble x, jdouble y, jdouble z, jdouble w) { - glProgramLocalParameter4dARBPROC glProgramLocalParameter4dARB = (glProgramLocalParameter4dARBPROC)tlsGetFunction(1458); - UNUSED_PARAM(clazz) - glProgramLocalParameter4dARB(target, index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglProgramLocalParameter4dvARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glProgramLocalParameter4dvARBPROC glProgramLocalParameter4dvARB = (glProgramLocalParameter4dvARBPROC)tlsGetFunction(1459); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glProgramLocalParameter4dvARB(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glProgramLocalParameter4fARB(JNIEnv *__env, jclass clazz, jint target, jint index, jfloat x, jfloat y, jfloat z, jfloat w) { - glProgramLocalParameter4fARBPROC glProgramLocalParameter4fARB = (glProgramLocalParameter4fARBPROC)tlsGetFunction(1460); - UNUSED_PARAM(clazz) - glProgramLocalParameter4fARB(target, index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglProgramLocalParameter4fvARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glProgramLocalParameter4fvARBPROC glProgramLocalParameter4fvARB = (glProgramLocalParameter4fvARBPROC)tlsGetFunction(1461); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glProgramLocalParameter4fvARB(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetProgramEnvParameterfvARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glGetProgramEnvParameterfvARBPROC glGetProgramEnvParameterfvARB = (glGetProgramEnvParameterfvARBPROC)tlsGetFunction(1462); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramEnvParameterfvARB(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetProgramEnvParameterdvARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glGetProgramEnvParameterdvARBPROC glGetProgramEnvParameterdvARB = (glGetProgramEnvParameterdvARBPROC)tlsGetFunction(1463); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramEnvParameterdvARB(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetProgramLocalParameterfvARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glGetProgramLocalParameterfvARBPROC glGetProgramLocalParameterfvARB = (glGetProgramLocalParameterfvARBPROC)tlsGetFunction(1464); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramLocalParameterfvARB(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetProgramLocalParameterdvARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glGetProgramLocalParameterdvARBPROC glGetProgramLocalParameterdvARB = (glGetProgramLocalParameterdvARBPROC)tlsGetFunction(1465); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramLocalParameterdvARB(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetProgramivARB__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetProgramivARBPROC glGetProgramivARB = (glGetProgramivARBPROC)tlsGetFunction(1466); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramivARB(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_nglGetProgramStringARB(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong stringAddress) { - glGetProgramStringARBPROC glGetProgramStringARB = (glGetProgramStringARBPROC)tlsGetFunction(1467); - uintptr_t string = (uintptr_t)stringAddress; - UNUSED_PARAM(clazz) - glGetProgramStringARB(target, pname, string); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_ARBVertexProgram_glIsProgramARB(JNIEnv *__env, jclass clazz, jint program) { - glIsProgramARBPROC glIsProgramARB = (glIsProgramARBPROC)tlsGetFunction(1472); - UNUSED_PARAM(clazz) - return glIsProgramARB(program); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexShader.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexShader.c deleted file mode 100644 index d6a8fe02..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBVertexShader.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexAttrib1fARBPROC) (jint, jfloat); -typedef void (APIENTRY *glVertexAttrib1sARBPROC) (jint, jshort); -typedef void (APIENTRY *glVertexAttrib1dARBPROC) (jint, jdouble); -typedef void (APIENTRY *glVertexAttrib2fARBPROC) (jint, jfloat, jfloat); -typedef void (APIENTRY *glVertexAttrib2sARBPROC) (jint, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib2dARBPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttrib3fARBPROC) (jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glVertexAttrib3sARBPROC) (jint, jshort, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib3dARBPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttrib4fARBPROC) (jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glVertexAttrib4sARBPROC) (jint, jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib4dARBPROC) (jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttrib4NubARBPROC) (jint, uint8_t, uint8_t, uint8_t, uint8_t); -typedef void (APIENTRY *glVertexAttrib1fvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib1svARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib1dvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib2fvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib2svARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib2dvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib3fvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib3svARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib3dvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4fvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4svARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4dvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4ivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4bvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4ubvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4usvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4uivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NbvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NsvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NubvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NusvARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NuivARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribPointerARBPROC) (jint, jint, jint, jboolean, jint, uintptr_t); -typedef void (APIENTRY *glEnableVertexAttribArrayARBPROC) (jint); -typedef void (APIENTRY *glDisableVertexAttribArrayARBPROC) (jint); -typedef void (APIENTRY *glBindAttribLocationARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetActiveAttribARBPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetAttribLocationARBPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribivARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribfvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribdvARBPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribPointervARBPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib1fARB(JNIEnv *__env, jclass clazz, jint index, jfloat v0) { - glVertexAttrib1fARBPROC glVertexAttrib1fARB = (glVertexAttrib1fARBPROC)tlsGetFunction(1412); - UNUSED_PARAM(clazz) - glVertexAttrib1fARB(index, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib1sARB(JNIEnv *__env, jclass clazz, jint index, jshort v0) { - glVertexAttrib1sARBPROC glVertexAttrib1sARB = (glVertexAttrib1sARBPROC)tlsGetFunction(1411); - UNUSED_PARAM(clazz) - glVertexAttrib1sARB(index, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib1dARB(JNIEnv *__env, jclass clazz, jint index, jdouble v0) { - glVertexAttrib1dARBPROC glVertexAttrib1dARB = (glVertexAttrib1dARBPROC)tlsGetFunction(1413); - UNUSED_PARAM(clazz) - glVertexAttrib1dARB(index, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib2fARB(JNIEnv *__env, jclass clazz, jint index, jfloat v0, jfloat v1) { - glVertexAttrib2fARBPROC glVertexAttrib2fARB = (glVertexAttrib2fARBPROC)tlsGetFunction(1415); - UNUSED_PARAM(clazz) - glVertexAttrib2fARB(index, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib2sARB(JNIEnv *__env, jclass clazz, jint index, jshort v0, jshort v1) { - glVertexAttrib2sARBPROC glVertexAttrib2sARB = (glVertexAttrib2sARBPROC)tlsGetFunction(1414); - UNUSED_PARAM(clazz) - glVertexAttrib2sARB(index, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib2dARB(JNIEnv *__env, jclass clazz, jint index, jdouble v0, jdouble v1) { - glVertexAttrib2dARBPROC glVertexAttrib2dARB = (glVertexAttrib2dARBPROC)tlsGetFunction(1416); - UNUSED_PARAM(clazz) - glVertexAttrib2dARB(index, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib3fARB(JNIEnv *__env, jclass clazz, jint index, jfloat v0, jfloat v1, jfloat v2) { - glVertexAttrib3fARBPROC glVertexAttrib3fARB = (glVertexAttrib3fARBPROC)tlsGetFunction(1418); - UNUSED_PARAM(clazz) - glVertexAttrib3fARB(index, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib3sARB(JNIEnv *__env, jclass clazz, jint index, jshort v0, jshort v1, jshort v2) { - glVertexAttrib3sARBPROC glVertexAttrib3sARB = (glVertexAttrib3sARBPROC)tlsGetFunction(1417); - UNUSED_PARAM(clazz) - glVertexAttrib3sARB(index, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib3dARB(JNIEnv *__env, jclass clazz, jint index, jdouble v0, jdouble v1, jdouble v2) { - glVertexAttrib3dARBPROC glVertexAttrib3dARB = (glVertexAttrib3dARBPROC)tlsGetFunction(1419); - UNUSED_PARAM(clazz) - glVertexAttrib3dARB(index, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib4fARB(JNIEnv *__env, jclass clazz, jint index, jfloat v0, jfloat v1, jfloat v2, jfloat v3) { - glVertexAttrib4fARBPROC glVertexAttrib4fARB = (glVertexAttrib4fARBPROC)tlsGetFunction(1421); - UNUSED_PARAM(clazz) - glVertexAttrib4fARB(index, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib4sARB(JNIEnv *__env, jclass clazz, jint index, jshort v0, jshort v1, jshort v2, jshort v3) { - glVertexAttrib4sARBPROC glVertexAttrib4sARB = (glVertexAttrib4sARBPROC)tlsGetFunction(1420); - UNUSED_PARAM(clazz) - glVertexAttrib4sARB(index, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib4dARB(JNIEnv *__env, jclass clazz, jint index, jdouble v0, jdouble v1, jdouble v2, jdouble v3) { - glVertexAttrib4dARBPROC glVertexAttrib4dARB = (glVertexAttrib4dARBPROC)tlsGetFunction(1422); - UNUSED_PARAM(clazz) - glVertexAttrib4dARB(index, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glVertexAttrib4NubARB(JNIEnv *__env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w) { - glVertexAttrib4NubARBPROC glVertexAttrib4NubARB = (glVertexAttrib4NubARBPROC)tlsGetFunction(1423); - UNUSED_PARAM(clazz) - glVertexAttrib4NubARB(index, (uint8_t)x, (uint8_t)y, (uint8_t)z, (uint8_t)w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib1fvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib1fvARBPROC glVertexAttrib1fvARB = (glVertexAttrib1fvARBPROC)tlsGetFunction(1425); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib1fvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib1svARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib1svARBPROC glVertexAttrib1svARB = (glVertexAttrib1svARBPROC)tlsGetFunction(1424); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib1svARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib1dvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib1dvARBPROC glVertexAttrib1dvARB = (glVertexAttrib1dvARBPROC)tlsGetFunction(1426); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib1dvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib2fvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib2fvARBPROC glVertexAttrib2fvARB = (glVertexAttrib2fvARBPROC)tlsGetFunction(1428); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib2fvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib2svARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib2svARBPROC glVertexAttrib2svARB = (glVertexAttrib2svARBPROC)tlsGetFunction(1427); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib2svARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib2dvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib2dvARBPROC glVertexAttrib2dvARB = (glVertexAttrib2dvARBPROC)tlsGetFunction(1429); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib2dvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib3fvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib3fvARBPROC glVertexAttrib3fvARB = (glVertexAttrib3fvARBPROC)tlsGetFunction(1431); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib3fvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib3svARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib3svARBPROC glVertexAttrib3svARB = (glVertexAttrib3svARBPROC)tlsGetFunction(1430); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib3svARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib3dvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib3dvARBPROC glVertexAttrib3dvARB = (glVertexAttrib3dvARBPROC)tlsGetFunction(1432); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib3dvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4fvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4fvARBPROC glVertexAttrib4fvARB = (glVertexAttrib4fvARBPROC)tlsGetFunction(1433); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4fvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4svARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4svARBPROC glVertexAttrib4svARB = (glVertexAttrib4svARBPROC)tlsGetFunction(1435); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4svARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4dvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4dvARBPROC glVertexAttrib4dvARB = (glVertexAttrib4dvARBPROC)tlsGetFunction(1440); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4dvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4ivARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4ivARBPROC glVertexAttrib4ivARB = (glVertexAttrib4ivARBPROC)tlsGetFunction(1436); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4ivARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4bvARB(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4bvARBPROC glVertexAttrib4bvARB = (glVertexAttrib4bvARBPROC)tlsGetFunction(1434); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4bvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4ubvARB(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4ubvARBPROC glVertexAttrib4ubvARB = (glVertexAttrib4ubvARBPROC)tlsGetFunction(1437); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4ubvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4usvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4usvARBPROC glVertexAttrib4usvARB = (glVertexAttrib4usvARBPROC)tlsGetFunction(1438); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4usvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4uivARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4uivARBPROC glVertexAttrib4uivARB = (glVertexAttrib4uivARBPROC)tlsGetFunction(1439); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4uivARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4NbvARB(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NbvARBPROC glVertexAttrib4NbvARB = (glVertexAttrib4NbvARBPROC)tlsGetFunction(1441); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4NbvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4NsvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NsvARBPROC glVertexAttrib4NsvARB = (glVertexAttrib4NsvARBPROC)tlsGetFunction(1442); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4NsvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4NivARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NivARBPROC glVertexAttrib4NivARB = (glVertexAttrib4NivARBPROC)tlsGetFunction(1443); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4NivARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4NubvARB(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NubvARBPROC glVertexAttrib4NubvARB = (glVertexAttrib4NubvARBPROC)tlsGetFunction(1444); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4NubvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4NusvARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NusvARBPROC glVertexAttrib4NusvARB = (glVertexAttrib4NusvARBPROC)tlsGetFunction(1445); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4NusvARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttrib4NuivARB__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NuivARBPROC glVertexAttrib4NuivARB = (glVertexAttrib4NuivARBPROC)tlsGetFunction(1446); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4NuivARB(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglVertexAttribPointerARB__IIIZIJ(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jlong pointerAddress) { - glVertexAttribPointerARBPROC glVertexAttribPointerARB = (glVertexAttribPointerARBPROC)tlsGetFunction(1447); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glEnableVertexAttribArrayARB(JNIEnv *__env, jclass clazz, jint index) { - glEnableVertexAttribArrayARBPROC glEnableVertexAttribArrayARB = (glEnableVertexAttribArrayARBPROC)tlsGetFunction(1448); - UNUSED_PARAM(clazz) - glEnableVertexAttribArrayARB(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_glDisableVertexAttribArrayARB(JNIEnv *__env, jclass clazz, jint index) { - glDisableVertexAttribArrayARBPROC glDisableVertexAttribArrayARB = (glDisableVertexAttribArrayARBPROC)tlsGetFunction(1449); - UNUSED_PARAM(clazz) - glDisableVertexAttribArrayARB(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglBindAttribLocationARB(JNIEnv *__env, jclass clazz, jint programObj, jint index, jlong nameAddress) { - glBindAttribLocationARBPROC glBindAttribLocationARB = (glBindAttribLocationARBPROC)tlsGetFunction(1473); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glBindAttribLocationARB(programObj, index, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetActiveAttribARB__IIIJJJJ(JNIEnv *__env, jclass clazz, jint programObj, jint index, jint maxLength, jlong lengthAddress, jlong sizeAddress, jlong typeAddress, jlong nameAddress) { - glGetActiveAttribARBPROC glGetActiveAttribARB = (glGetActiveAttribARBPROC)tlsGetFunction(1474); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t size = (uintptr_t)sizeAddress; - uintptr_t type = (uintptr_t)typeAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetActiveAttribARB(programObj, index, maxLength, length, size, type, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetAttribLocationARB(JNIEnv *__env, jclass clazz, jint programObj, jlong nameAddress) { - glGetAttribLocationARBPROC glGetAttribLocationARB = (glGetAttribLocationARBPROC)tlsGetFunction(1475); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetAttribLocationARB(programObj, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribivARB__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribivARBPROC glGetVertexAttribivARB = (glGetVertexAttribivARBPROC)tlsGetFunction(1470); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribivARB(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribfvARB__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribfvARBPROC glGetVertexAttribfvARB = (glGetVertexAttribfvARBPROC)tlsGetFunction(1468); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribfvARB(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribdvARB__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribdvARBPROC glGetVertexAttribdvARB = (glGetVertexAttribdvARBPROC)tlsGetFunction(1469); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribdvARB(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBVertexShader_nglGetVertexAttribPointervARB(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong pointerAddress) { - glGetVertexAttribPointervARBPROC glGetVertexAttribPointervARB = (glGetVertexAttribPointervARBPROC)tlsGetFunction(1471); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribPointervARB(index, pname, pointer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBWindowPos.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBWindowPos.c deleted file mode 100644 index 12f17607..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_ARBWindowPos.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glWindowPos2iARBPROC) (jint, jint); -typedef void (APIENTRY *glWindowPos2sARBPROC) (jshort, jshort); -typedef void (APIENTRY *glWindowPos2fARBPROC) (jfloat, jfloat); -typedef void (APIENTRY *glWindowPos2dARBPROC) (jdouble, jdouble); -typedef void (APIENTRY *glWindowPos2ivARBPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos2svARBPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos2fvARBPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos2dvARBPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos3iARBPROC) (jint, jint, jint); -typedef void (APIENTRY *glWindowPos3sARBPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glWindowPos3fARBPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glWindowPos3dARBPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glWindowPos3ivARBPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos3svARBPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos3fvARBPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos3dvARBPROC) (uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_glWindowPos2iARB(JNIEnv *__env, jclass clazz, jint x, jint y) { - glWindowPos2iARBPROC glWindowPos2iARB = (glWindowPos2iARBPROC)tlsGetFunction(1476); - UNUSED_PARAM(clazz) - glWindowPos2iARB(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_glWindowPos2sARB(JNIEnv *__env, jclass clazz, jshort x, jshort y) { - glWindowPos2sARBPROC glWindowPos2sARB = (glWindowPos2sARBPROC)tlsGetFunction(1477); - UNUSED_PARAM(clazz) - glWindowPos2sARB(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_glWindowPos2fARB(JNIEnv *__env, jclass clazz, jfloat x, jfloat y) { - glWindowPos2fARBPROC glWindowPos2fARB = (glWindowPos2fARBPROC)tlsGetFunction(1478); - UNUSED_PARAM(clazz) - glWindowPos2fARB(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_glWindowPos2dARB(JNIEnv *__env, jclass clazz, jdouble x, jdouble y) { - glWindowPos2dARBPROC glWindowPos2dARB = (glWindowPos2dARBPROC)tlsGetFunction(1479); - UNUSED_PARAM(clazz) - glWindowPos2dARB(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_nglWindowPos2ivARB__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos2ivARBPROC glWindowPos2ivARB = (glWindowPos2ivARBPROC)tlsGetFunction(1480); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos2ivARB(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_nglWindowPos2svARB__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos2svARBPROC glWindowPos2svARB = (glWindowPos2svARBPROC)tlsGetFunction(1481); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos2svARB(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_nglWindowPos2fvARB__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos2fvARBPROC glWindowPos2fvARB = (glWindowPos2fvARBPROC)tlsGetFunction(1482); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos2fvARB(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_nglWindowPos2dvARB__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos2dvARBPROC glWindowPos2dvARB = (glWindowPos2dvARBPROC)tlsGetFunction(1483); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos2dvARB(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_glWindowPos3iARB(JNIEnv *__env, jclass clazz, jint x, jint y, jint z) { - glWindowPos3iARBPROC glWindowPos3iARB = (glWindowPos3iARBPROC)tlsGetFunction(1484); - UNUSED_PARAM(clazz) - glWindowPos3iARB(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_glWindowPos3sARB(JNIEnv *__env, jclass clazz, jshort x, jshort y, jshort z) { - glWindowPos3sARBPROC glWindowPos3sARB = (glWindowPos3sARBPROC)tlsGetFunction(1485); - UNUSED_PARAM(clazz) - glWindowPos3sARB(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_glWindowPos3fARB(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z) { - glWindowPos3fARBPROC glWindowPos3fARB = (glWindowPos3fARBPROC)tlsGetFunction(1486); - UNUSED_PARAM(clazz) - glWindowPos3fARB(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_glWindowPos3dARB(JNIEnv *__env, jclass clazz, jdouble x, jdouble y, jdouble z) { - glWindowPos3dARBPROC glWindowPos3dARB = (glWindowPos3dARBPROC)tlsGetFunction(1487); - UNUSED_PARAM(clazz) - glWindowPos3dARB(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_nglWindowPos3ivARB__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos3ivARBPROC glWindowPos3ivARB = (glWindowPos3ivARBPROC)tlsGetFunction(1488); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos3ivARB(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_nglWindowPos3svARB__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos3svARBPROC glWindowPos3svARB = (glWindowPos3svARBPROC)tlsGetFunction(1489); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos3svARB(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_nglWindowPos3fvARB__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos3fvARBPROC glWindowPos3fvARB = (glWindowPos3fvARBPROC)tlsGetFunction(1490); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos3fvARB(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBWindowPos_nglWindowPos3dvARB__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos3dvARBPROC glWindowPos3dvARB = (glWindowPos3dvARBPROC)tlsGetFunction(1491); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos3dvARB(p); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBindableUniform.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBindableUniform.c deleted file mode 100644 index 1d2518d0..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBindableUniform.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glUniformBufferEXTPROC) (jint, jint, jint); -typedef jint (APIENTRY *glGetUniformBufferSizeEXTPROC) (jint, jint); -typedef uintptr_t (APIENTRY *glGetUniformOffsetEXTPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTBindableUniform_glUniformBufferEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint buffer) { - glUniformBufferEXTPROC glUniformBufferEXT = (glUniformBufferEXTPROC)tlsGetFunction(1492); - UNUSED_PARAM(clazz) - glUniformBufferEXT(program, location, buffer); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_EXTBindableUniform_glGetUniformBufferSizeEXT(JNIEnv *__env, jclass clazz, jint program, jint location) { - glGetUniformBufferSizeEXTPROC glGetUniformBufferSizeEXT = (glGetUniformBufferSizeEXTPROC)tlsGetFunction(1493); - UNUSED_PARAM(clazz) - return glGetUniformBufferSizeEXT(program, location); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_EXTBindableUniform_glGetUniformOffsetEXT(JNIEnv *__env, jclass clazz, jint program, jint location) { - glGetUniformOffsetEXTPROC glGetUniformOffsetEXT = (glGetUniformOffsetEXTPROC)tlsGetFunction(1494); - UNUSED_PARAM(clazz) - return (jlong)glGetUniformOffsetEXT(program, location); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendColor.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendColor.c deleted file mode 100644 index 46f0b051..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendColor.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendColorEXTPROC) (jfloat, jfloat, jfloat, jfloat); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTBlendColor_glBlendColorEXT(JNIEnv *__env, jclass clazz, jfloat red, jfloat green, jfloat blue, jfloat alpha) { - glBlendColorEXTPROC glBlendColorEXT = (glBlendColorEXTPROC)tlsGetFunction(1495); - UNUSED_PARAM(clazz) - glBlendColorEXT(red, green, blue, alpha); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendEquationSeparate.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendEquationSeparate.c deleted file mode 100644 index ab1ed174..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendEquationSeparate.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendEquationSeparateEXTPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTBlendEquationSeparate_glBlendEquationSeparateEXT(JNIEnv *__env, jclass clazz, jint modeRGB, jint modeAlpha) { - glBlendEquationSeparateEXTPROC glBlendEquationSeparateEXT = (glBlendEquationSeparateEXTPROC)tlsGetFunction(1496); - UNUSED_PARAM(clazz) - glBlendEquationSeparateEXT(modeRGB, modeAlpha); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendFuncSeparate.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendFuncSeparate.c deleted file mode 100644 index 45e845bb..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendFuncSeparate.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendFuncSeparateEXTPROC) (jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTBlendFuncSeparate_glBlendFuncSeparateEXT(JNIEnv *__env, jclass clazz, jint sfactorRGB, jint dfactorRGB, jint sfactorAlpha, jint dfactorAlpha) { - glBlendFuncSeparateEXTPROC glBlendFuncSeparateEXT = (glBlendFuncSeparateEXTPROC)tlsGetFunction(1497); - UNUSED_PARAM(clazz) - glBlendFuncSeparateEXT(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendMinmax.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendMinmax.c deleted file mode 100644 index dd2b5703..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTBlendMinmax.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendEquationEXTPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTBlendMinmax_glBlendEquationEXT(JNIEnv *__env, jclass clazz, jint mode) { - glBlendEquationEXTPROC glBlendEquationEXT = (glBlendEquationEXTPROC)tlsGetFunction(1498); - UNUSED_PARAM(clazz) - glBlendEquationEXT(mode); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTCompiledVertexArray.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTCompiledVertexArray.c deleted file mode 100644 index 2693e6f8..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTCompiledVertexArray.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glLockArraysEXTPROC) (jint, jint); -typedef void (APIENTRY *glUnlockArraysEXTPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTCompiledVertexArray_glLockArraysEXT(JNIEnv *__env, jclass clazz, jint first, jint count) { - glLockArraysEXTPROC glLockArraysEXT = (glLockArraysEXTPROC)tlsGetFunction(1499); - UNUSED_PARAM(clazz) - glLockArraysEXT(first, count); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTCompiledVertexArray_glUnlockArraysEXT(JNIEnv *__env, jclass clazz) { - glUnlockArraysEXTPROC glUnlockArraysEXT = (glUnlockArraysEXTPROC)tlsGetFunction(1500); - UNUSED_PARAM(clazz) - glUnlockArraysEXT(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDebugLabel.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDebugLabel.c deleted file mode 100644 index ed0f20e5..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDebugLabel.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glLabelObjectEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetObjectLabelEXTPROC) (jint, jint, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDebugLabel_nglLabelObjectEXT(JNIEnv *__env, jclass clazz, jint type, jint object, jint length, jlong labelAddress) { - glLabelObjectEXTPROC glLabelObjectEXT = (glLabelObjectEXTPROC)tlsGetFunction(1501); - uintptr_t label = (uintptr_t)labelAddress; - UNUSED_PARAM(clazz) - glLabelObjectEXT(type, object, length, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDebugLabel_nglGetObjectLabelEXT__IIIJJ(JNIEnv *__env, jclass clazz, jint type, jint object, jint bufSize, jlong lengthAddress, jlong labelAddress) { - glGetObjectLabelEXTPROC glGetObjectLabelEXT = (glGetObjectLabelEXTPROC)tlsGetFunction(1502); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t label = (uintptr_t)labelAddress; - UNUSED_PARAM(clazz) - glGetObjectLabelEXT(type, object, bufSize, length, label); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDebugMarker.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDebugMarker.c deleted file mode 100644 index f0012e3d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDebugMarker.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glInsertEventMarkerEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glPushGroupMarkerEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glPopGroupMarkerEXTPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDebugMarker_nglInsertEventMarkerEXT(JNIEnv *__env, jclass clazz, jint length, jlong markerAddress) { - glInsertEventMarkerEXTPROC glInsertEventMarkerEXT = (glInsertEventMarkerEXTPROC)tlsGetFunction(1503); - uintptr_t marker = (uintptr_t)markerAddress; - UNUSED_PARAM(clazz) - glInsertEventMarkerEXT(length, marker); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDebugMarker_nglPushGroupMarkerEXT(JNIEnv *__env, jclass clazz, jint length, jlong markerAddress) { - glPushGroupMarkerEXTPROC glPushGroupMarkerEXT = (glPushGroupMarkerEXTPROC)tlsGetFunction(1504); - uintptr_t marker = (uintptr_t)markerAddress; - UNUSED_PARAM(clazz) - glPushGroupMarkerEXT(length, marker); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDebugMarker_glPopGroupMarkerEXT(JNIEnv *__env, jclass clazz) { - glPopGroupMarkerEXTPROC glPopGroupMarkerEXT = (glPopGroupMarkerEXTPROC)tlsGetFunction(1505); - UNUSED_PARAM(clazz) - glPopGroupMarkerEXT(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDepthBoundsTest.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDepthBoundsTest.c deleted file mode 100644 index 19ab445e..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDepthBoundsTest.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDepthBoundsEXTPROC) (jdouble, jdouble); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDepthBoundsTest_glDepthBoundsEXT(JNIEnv *__env, jclass clazz, jdouble zmin, jdouble zmax) { - glDepthBoundsEXTPROC glDepthBoundsEXT = (glDepthBoundsEXTPROC)tlsGetFunction(1506); - UNUSED_PARAM(clazz) - glDepthBoundsEXT(zmin, zmax); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDirectStateAccess.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDirectStateAccess.c deleted file mode 100644 index 214fc37b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDirectStateAccess.c +++ /dev/null @@ -1,1616 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glClientAttribDefaultEXTPROC) (jint); -typedef void (APIENTRY *glPushClientAttribDefaultEXTPROC) (jint); -typedef void (APIENTRY *glMatrixLoadfEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixLoaddEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixMultfEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixMultdEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixLoadIdentityEXTPROC) (jint); -typedef void (APIENTRY *glMatrixRotatefEXTPROC) (jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glMatrixRotatedEXTPROC) (jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMatrixScalefEXTPROC) (jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glMatrixScaledEXTPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMatrixTranslatefEXTPROC) (jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glMatrixTranslatedEXTPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMatrixOrthoEXTPROC) (jint, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMatrixFrustumEXTPROC) (jint, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMatrixPushEXTPROC) (jint); -typedef void (APIENTRY *glMatrixPopEXTPROC) (jint); -typedef void (APIENTRY *glTextureParameteriEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glTextureParameterivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureParameterfEXTPROC) (jint, jint, jint, jfloat); -typedef void (APIENTRY *glTextureParameterfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureSubImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureSubImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyTextureImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyTextureImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyTextureSubImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyTextureSubImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glGetTextureImageEXTPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureParameterfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureParameterivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureLevelParameterfvEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureLevelParameterivEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureSubImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyTextureSubImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glBindMultiTextureEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoordPointerEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexEnvfEXTPROC) (jint, jint, jint, jfloat); -typedef void (APIENTRY *glMultiTexEnvfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexEnviEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glMultiTexEnvivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexGendEXTPROC) (jint, jint, jint, jdouble); -typedef void (APIENTRY *glMultiTexGendvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexGenfEXTPROC) (jint, jint, jint, jfloat); -typedef void (APIENTRY *glMultiTexGenfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexGeniEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glMultiTexGenivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexEnvfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexEnvivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexGendvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexGenfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexGenivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexParameteriEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glMultiTexParameterivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexParameterfEXTPROC) (jint, jint, jint, jfloat); -typedef void (APIENTRY *glMultiTexParameterfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexSubImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexSubImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyMultiTexImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyMultiTexImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyMultiTexSubImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyMultiTexSubImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glGetMultiTexImageEXTPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexParameterfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexParameterivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexLevelParameterfvEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexLevelParameterivEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexSubImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyMultiTexSubImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glEnableClientStateIndexedEXTPROC) (jint, jint); -typedef void (APIENTRY *glDisableClientStateIndexedEXTPROC) (jint, jint); -typedef void (APIENTRY *glEnableClientStateiEXTPROC) (jint, jint); -typedef void (APIENTRY *glDisableClientStateiEXTPROC) (jint, jint); -typedef void (APIENTRY *glGetFloatIndexedvEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetDoubleIndexedvEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPointerIndexedvEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetFloati_vEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetDoublei_vEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPointeri_vEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedProgramStringEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedProgramLocalParameter4dEXTPROC) (jint, jint, jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glNamedProgramLocalParameter4dvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedProgramLocalParameter4fEXTPROC) (jint, jint, jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glNamedProgramLocalParameter4fvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedProgramLocalParameterdvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedProgramLocalParameterfvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedProgramivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedProgramStringEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureSubImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureSubImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureSubImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetCompressedTextureImageEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedMultiTexImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedMultiTexImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedMultiTexImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedMultiTexSubImage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedMultiTexSubImage2DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedMultiTexSubImage1DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetCompressedMultiTexImageEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMatrixLoadTransposefEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixLoadTransposedEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixMultTransposefEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixMultTransposedEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glNamedBufferDataEXTPROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glNamedBufferSubDataEXTPROC) (jint, uintptr_t, uintptr_t, uintptr_t); -typedef uintptr_t (APIENTRY *glMapNamedBufferEXTPROC) (jint, jint); -typedef jboolean (APIENTRY *glUnmapNamedBufferEXTPROC) (jint); -typedef void (APIENTRY *glGetNamedBufferParameterivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedBufferSubDataEXTPROC) (jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glProgramUniform1fEXTPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glProgramUniform2fEXTPROC) (jint, jint, jfloat, jfloat); -typedef void (APIENTRY *glProgramUniform3fEXTPROC) (jint, jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glProgramUniform4fEXTPROC) (jint, jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glProgramUniform1iEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glProgramUniform2iEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform3iEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform4iEXTPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform1fvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2fvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3fvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4fvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1ivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2ivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3ivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4ivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2x3fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3x2fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2x4fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4x2fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3x4fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4x3fvEXTPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glTextureBufferEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glMultiTexBufferEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glTextureParameterIivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureParameterIuivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureParameterIivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureParameterIuivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexParameterIivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexParameterIuivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexParameterIivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMultiTexParameterIuivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1uiEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glProgramUniform2uiEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform3uiEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform4uiEXTPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform1uivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2uivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3uivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4uivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedProgramLocalParameters4fvEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedProgramLocalParameterI4iEXTPROC) (jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedProgramLocalParameterI4ivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedProgramLocalParametersI4ivEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedProgramLocalParameterI4uiEXTPROC) (jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedProgramLocalParameterI4uivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedProgramLocalParametersI4uivEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedProgramLocalParameterIivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedProgramLocalParameterIuivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedRenderbufferStorageEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glGetNamedRenderbufferParameterivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedRenderbufferStorageMultisampleEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedRenderbufferStorageMultisampleCoverageEXTPROC) (jint, jint, jint, jint, jint, jint); -typedef jint (APIENTRY *glCheckNamedFramebufferStatusEXTPROC) (jint, jint); -typedef void (APIENTRY *glNamedFramebufferTexture1DEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferTexture2DEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferTexture3DEXTPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferRenderbufferEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glGetNamedFramebufferAttachmentParameterivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGenerateTextureMipmapEXTPROC) (jint, jint); -typedef void (APIENTRY *glGenerateMultiTexMipmapEXTPROC) (jint, jint); -typedef void (APIENTRY *glFramebufferDrawBufferEXTPROC) (jint, jint); -typedef void (APIENTRY *glFramebufferDrawBuffersEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glFramebufferReadBufferEXTPROC) (jint, jint); -typedef void (APIENTRY *glGetFramebufferParameterivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedCopyBufferSubDataEXTPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glNamedFramebufferTextureEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferTextureLayerEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferTextureFaceEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureRenderbufferEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glMultiTexRenderbufferEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glVertexArrayVertexOffsetEXTPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayColorOffsetEXTPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayEdgeFlagOffsetEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayIndexOffsetEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayNormalOffsetEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayTexCoordOffsetEXTPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayMultiTexCoordOffsetEXTPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayFogCoordOffsetEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArraySecondaryColorOffsetEXTPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayVertexAttribOffsetEXTPROC) (jint, jint, jint, jint, jint, jboolean, jint, uintptr_t); -typedef void (APIENTRY *glVertexArrayVertexAttribIOffsetEXTPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glEnableVertexArrayEXTPROC) (jint, jint); -typedef void (APIENTRY *glDisableVertexArrayEXTPROC) (jint, jint); -typedef void (APIENTRY *glEnableVertexArrayAttribEXTPROC) (jint, jint); -typedef void (APIENTRY *glDisableVertexArrayAttribEXTPROC) (jint, jint); -typedef void (APIENTRY *glGetVertexArrayIntegervEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexArrayPointervEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexArrayIntegeri_vEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexArrayPointeri_vEXTPROC) (jint, jint, jint, uintptr_t); -typedef uintptr_t (APIENTRY *glMapNamedBufferRangeEXTPROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glFlushMappedNamedBufferRangeEXTPROC) (jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glClientAttribDefaultEXT(JNIEnv *__env, jclass clazz, jint mask) { - glClientAttribDefaultEXTPROC glClientAttribDefaultEXT = (glClientAttribDefaultEXTPROC)tlsGetFunction(1507); - UNUSED_PARAM(clazz) - glClientAttribDefaultEXT(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glPushClientAttribDefaultEXT(JNIEnv *__env, jclass clazz, jint mask) { - glPushClientAttribDefaultEXTPROC glPushClientAttribDefaultEXT = (glPushClientAttribDefaultEXTPROC)tlsGetFunction(1508); - UNUSED_PARAM(clazz) - glPushClientAttribDefaultEXT(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMatrixLoadfEXT__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixLoadfEXTPROC glMatrixLoadfEXT = (glMatrixLoadfEXTPROC)tlsGetFunction(1509); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixLoadfEXT(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMatrixLoaddEXT__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixLoaddEXTPROC glMatrixLoaddEXT = (glMatrixLoaddEXTPROC)tlsGetFunction(1510); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixLoaddEXT(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMatrixMultfEXT__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixMultfEXTPROC glMatrixMultfEXT = (glMatrixMultfEXTPROC)tlsGetFunction(1511); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixMultfEXT(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMatrixMultdEXT__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixMultdEXTPROC glMatrixMultdEXT = (glMatrixMultdEXTPROC)tlsGetFunction(1512); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixMultdEXT(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixLoadIdentityEXT(JNIEnv *__env, jclass clazz, jint matrixMode) { - glMatrixLoadIdentityEXTPROC glMatrixLoadIdentityEXT = (glMatrixLoadIdentityEXTPROC)tlsGetFunction(1513); - UNUSED_PARAM(clazz) - glMatrixLoadIdentityEXT(matrixMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixRotatefEXT(JNIEnv *__env, jclass clazz, jint matrixMode, jfloat angle, jfloat x, jfloat y, jfloat z) { - glMatrixRotatefEXTPROC glMatrixRotatefEXT = (glMatrixRotatefEXTPROC)tlsGetFunction(1514); - UNUSED_PARAM(clazz) - glMatrixRotatefEXT(matrixMode, angle, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixRotatedEXT(JNIEnv *__env, jclass clazz, jint matrixMode, jdouble angle, jdouble x, jdouble y, jdouble z) { - glMatrixRotatedEXTPROC glMatrixRotatedEXT = (glMatrixRotatedEXTPROC)tlsGetFunction(1515); - UNUSED_PARAM(clazz) - glMatrixRotatedEXT(matrixMode, angle, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixScalefEXT(JNIEnv *__env, jclass clazz, jint matrixMode, jfloat x, jfloat y, jfloat z) { - glMatrixScalefEXTPROC glMatrixScalefEXT = (glMatrixScalefEXTPROC)tlsGetFunction(1516); - UNUSED_PARAM(clazz) - glMatrixScalefEXT(matrixMode, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixScaledEXT(JNIEnv *__env, jclass clazz, jint matrixMode, jdouble x, jdouble y, jdouble z) { - glMatrixScaledEXTPROC glMatrixScaledEXT = (glMatrixScaledEXTPROC)tlsGetFunction(1517); - UNUSED_PARAM(clazz) - glMatrixScaledEXT(matrixMode, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixTranslatefEXT(JNIEnv *__env, jclass clazz, jint matrixMode, jfloat x, jfloat y, jfloat z) { - glMatrixTranslatefEXTPROC glMatrixTranslatefEXT = (glMatrixTranslatefEXTPROC)tlsGetFunction(1518); - UNUSED_PARAM(clazz) - glMatrixTranslatefEXT(matrixMode, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixTranslatedEXT(JNIEnv *__env, jclass clazz, jint matrixMode, jdouble x, jdouble y, jdouble z) { - glMatrixTranslatedEXTPROC glMatrixTranslatedEXT = (glMatrixTranslatedEXTPROC)tlsGetFunction(1519); - UNUSED_PARAM(clazz) - glMatrixTranslatedEXT(matrixMode, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixOrthoEXT(JNIEnv *__env, jclass clazz, jint matrixMode, jdouble l, jdouble r, jdouble b, jdouble t, jdouble n, jdouble f) { - glMatrixOrthoEXTPROC glMatrixOrthoEXT = (glMatrixOrthoEXTPROC)tlsGetFunction(1520); - UNUSED_PARAM(clazz) - glMatrixOrthoEXT(matrixMode, l, r, b, t, n, f); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixFrustumEXT(JNIEnv *__env, jclass clazz, jint matrixMode, jdouble l, jdouble r, jdouble b, jdouble t, jdouble n, jdouble f) { - glMatrixFrustumEXTPROC glMatrixFrustumEXT = (glMatrixFrustumEXTPROC)tlsGetFunction(1521); - UNUSED_PARAM(clazz) - glMatrixFrustumEXT(matrixMode, l, r, b, t, n, f); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixPushEXT(JNIEnv *__env, jclass clazz, jint matrixMode) { - glMatrixPushEXTPROC glMatrixPushEXT = (glMatrixPushEXTPROC)tlsGetFunction(1522); - UNUSED_PARAM(clazz) - glMatrixPushEXT(matrixMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMatrixPopEXT(JNIEnv *__env, jclass clazz, jint matrixMode) { - glMatrixPopEXTPROC glMatrixPopEXT = (glMatrixPopEXTPROC)tlsGetFunction(1523); - UNUSED_PARAM(clazz) - glMatrixPopEXT(matrixMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glTextureParameteriEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jint param) { - glTextureParameteriEXTPROC glTextureParameteriEXT = (glTextureParameteriEXTPROC)tlsGetFunction(1524); - UNUSED_PARAM(clazz) - glTextureParameteriEXT(texture, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureParameterivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jlong paramAddress) { - glTextureParameterivEXTPROC glTextureParameterivEXT = (glTextureParameterivEXTPROC)tlsGetFunction(1525); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glTextureParameterivEXT(texture, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glTextureParameterfEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jfloat param) { - glTextureParameterfEXTPROC glTextureParameterfEXT = (glTextureParameterfEXTPROC)tlsGetFunction(1526); - UNUSED_PARAM(clazz) - glTextureParameterfEXT(texture, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureParameterfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jlong paramAddress) { - glTextureParameterfvEXTPROC glTextureParameterfvEXT = (glTextureParameterfvEXTPROC)tlsGetFunction(1527); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glTextureParameterfvEXT(texture, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureImage1DEXT__IIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint internalformat, jint width, jint border, jint format, jint type, jlong pixelsAddress) { - glTextureImage1DEXTPROC glTextureImage1DEXT = (glTextureImage1DEXTPROC)tlsGetFunction(1528); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureImage2DEXT__IIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jlong pixelsAddress) { - glTextureImage2DEXTPROC glTextureImage2DEXT = (glTextureImage2DEXTPROC)tlsGetFunction(1529); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureSubImage1DEXT__IIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint width, jint format, jint type, jlong pixelsAddress) { - glTextureSubImage1DEXTPROC glTextureSubImage1DEXT = (glTextureSubImage1DEXTPROC)tlsGetFunction(1530); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureSubImage2DEXT__IIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jlong pixelsAddress) { - glTextureSubImage2DEXTPROC glTextureSubImage2DEXT = (glTextureSubImage2DEXTPROC)tlsGetFunction(1531); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyTextureImage1DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint border) { - glCopyTextureImage1DEXTPROC glCopyTextureImage1DEXT = (glCopyTextureImage1DEXTPROC)tlsGetFunction(1532); - UNUSED_PARAM(clazz) - glCopyTextureImage1DEXT(texture, target, level, internalformat, x, y, width, border); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyTextureImage2DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { - glCopyTextureImage2DEXTPROC glCopyTextureImage2DEXT = (glCopyTextureImage2DEXTPROC)tlsGetFunction(1533); - UNUSED_PARAM(clazz) - glCopyTextureImage2DEXT(texture, target, level, internalformat, x, y, width, height, border); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyTextureSubImage1DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint x, jint y, jint width) { - glCopyTextureSubImage1DEXTPROC glCopyTextureSubImage1DEXT = (glCopyTextureSubImage1DEXTPROC)tlsGetFunction(1534); - UNUSED_PARAM(clazz) - glCopyTextureSubImage1DEXT(texture, target, level, xoffset, x, y, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyTextureSubImage2DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { - glCopyTextureSubImage2DEXTPROC glCopyTextureSubImage2DEXT = (glCopyTextureSubImage2DEXTPROC)tlsGetFunction(1535); - UNUSED_PARAM(clazz) - glCopyTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetTextureImageEXT__IIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint format, jint type, jlong pixelsAddress) { - glGetTextureImageEXTPROC glGetTextureImageEXT = (glGetTextureImageEXTPROC)tlsGetFunction(1536); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetTextureImageEXT(texture, target, level, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetTextureParameterfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jlong paramsAddress) { - glGetTextureParameterfvEXTPROC glGetTextureParameterfvEXT = (glGetTextureParameterfvEXTPROC)tlsGetFunction(1537); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureParameterfvEXT(texture, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetTextureParameterivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jlong paramsAddress) { - glGetTextureParameterivEXTPROC glGetTextureParameterivEXT = (glGetTextureParameterivEXTPROC)tlsGetFunction(1538); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureParameterivEXT(texture, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetTextureLevelParameterfvEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint pname, jlong paramsAddress) { - glGetTextureLevelParameterfvEXTPROC glGetTextureLevelParameterfvEXT = (glGetTextureLevelParameterfvEXTPROC)tlsGetFunction(1539); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureLevelParameterfvEXT(texture, target, level, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetTextureLevelParameterivEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint pname, jlong paramsAddress) { - glGetTextureLevelParameterivEXTPROC glGetTextureLevelParameterivEXT = (glGetTextureLevelParameterivEXTPROC)tlsGetFunction(1540); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureLevelParameterivEXT(texture, target, level, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureImage3DEXT__IIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jlong pixelsAddress) { - glTextureImage3DEXTPROC glTextureImage3DEXT = (glTextureImage3DEXTPROC)tlsGetFunction(1541); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureSubImage3DEXT__IIIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jlong pixelsAddress) { - glTextureSubImage3DEXTPROC glTextureSubImage3DEXT = (glTextureSubImage3DEXTPROC)tlsGetFunction(1542); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyTextureSubImage3DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) { - glCopyTextureSubImage3DEXTPROC glCopyTextureSubImage3DEXT = (glCopyTextureSubImage3DEXTPROC)tlsGetFunction(1543); - UNUSED_PARAM(clazz) - glCopyTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glBindMultiTextureEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint texture) { - glBindMultiTextureEXTPROC glBindMultiTextureEXT = (glBindMultiTextureEXTPROC)tlsGetFunction(1544); - UNUSED_PARAM(clazz) - glBindMultiTextureEXT(texunit, target, texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexCoordPointerEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint size, jint type, jint stride, jlong pointerAddress) { - glMultiTexCoordPointerEXTPROC glMultiTexCoordPointerEXT = (glMultiTexCoordPointerEXTPROC)tlsGetFunction(1545); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glMultiTexCoordPointerEXT(texunit, size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexEnvfEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jfloat param) { - glMultiTexEnvfEXTPROC glMultiTexEnvfEXT = (glMultiTexEnvfEXTPROC)tlsGetFunction(1546); - UNUSED_PARAM(clazz) - glMultiTexEnvfEXT(texunit, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexEnvfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glMultiTexEnvfvEXTPROC glMultiTexEnvfvEXT = (glMultiTexEnvfvEXTPROC)tlsGetFunction(1547); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMultiTexEnvfvEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexEnviEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jint param) { - glMultiTexEnviEXTPROC glMultiTexEnviEXT = (glMultiTexEnviEXTPROC)tlsGetFunction(1548); - UNUSED_PARAM(clazz) - glMultiTexEnviEXT(texunit, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexEnvivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glMultiTexEnvivEXTPROC glMultiTexEnvivEXT = (glMultiTexEnvivEXTPROC)tlsGetFunction(1549); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMultiTexEnvivEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexGendEXT(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jdouble param) { - glMultiTexGendEXTPROC glMultiTexGendEXT = (glMultiTexGendEXTPROC)tlsGetFunction(1550); - UNUSED_PARAM(clazz) - glMultiTexGendEXT(texunit, coord, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexGendvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jlong paramsAddress) { - glMultiTexGendvEXTPROC glMultiTexGendvEXT = (glMultiTexGendvEXTPROC)tlsGetFunction(1551); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMultiTexGendvEXT(texunit, coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexGenfEXT(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jfloat param) { - glMultiTexGenfEXTPROC glMultiTexGenfEXT = (glMultiTexGenfEXTPROC)tlsGetFunction(1552); - UNUSED_PARAM(clazz) - glMultiTexGenfEXT(texunit, coord, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexGenfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jlong paramsAddress) { - glMultiTexGenfvEXTPROC glMultiTexGenfvEXT = (glMultiTexGenfvEXTPROC)tlsGetFunction(1553); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMultiTexGenfvEXT(texunit, coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexGeniEXT(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jint param) { - glMultiTexGeniEXTPROC glMultiTexGeniEXT = (glMultiTexGeniEXTPROC)tlsGetFunction(1554); - UNUSED_PARAM(clazz) - glMultiTexGeniEXT(texunit, coord, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexGenivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jlong paramsAddress) { - glMultiTexGenivEXTPROC glMultiTexGenivEXT = (glMultiTexGenivEXTPROC)tlsGetFunction(1555); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMultiTexGenivEXT(texunit, coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexEnvfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glGetMultiTexEnvfvEXTPROC glGetMultiTexEnvfvEXT = (glGetMultiTexEnvfvEXTPROC)tlsGetFunction(1556); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexEnvfvEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexEnvivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glGetMultiTexEnvivEXTPROC glGetMultiTexEnvivEXT = (glGetMultiTexEnvivEXTPROC)tlsGetFunction(1557); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexEnvivEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexGendvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jlong paramsAddress) { - glGetMultiTexGendvEXTPROC glGetMultiTexGendvEXT = (glGetMultiTexGendvEXTPROC)tlsGetFunction(1558); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexGendvEXT(texunit, coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexGenfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jlong paramsAddress) { - glGetMultiTexGenfvEXTPROC glGetMultiTexGenfvEXT = (glGetMultiTexGenfvEXTPROC)tlsGetFunction(1559); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexGenfvEXT(texunit, coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexGenivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint coord, jint pname, jlong paramsAddress) { - glGetMultiTexGenivEXTPROC glGetMultiTexGenivEXT = (glGetMultiTexGenivEXTPROC)tlsGetFunction(1560); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexGenivEXT(texunit, coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexParameteriEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jint param) { - glMultiTexParameteriEXTPROC glMultiTexParameteriEXT = (glMultiTexParameteriEXTPROC)tlsGetFunction(1561); - UNUSED_PARAM(clazz) - glMultiTexParameteriEXT(texunit, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexParameterivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramAddress) { - glMultiTexParameterivEXTPROC glMultiTexParameterivEXT = (glMultiTexParameterivEXTPROC)tlsGetFunction(1562); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glMultiTexParameterivEXT(texunit, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexParameterfEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jfloat param) { - glMultiTexParameterfEXTPROC glMultiTexParameterfEXT = (glMultiTexParameterfEXTPROC)tlsGetFunction(1563); - UNUSED_PARAM(clazz) - glMultiTexParameterfEXT(texunit, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexParameterfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramAddress) { - glMultiTexParameterfvEXTPROC glMultiTexParameterfvEXT = (glMultiTexParameterfvEXTPROC)tlsGetFunction(1564); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glMultiTexParameterfvEXT(texunit, target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexImage1DEXT__IIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint internalformat, jint width, jint border, jint format, jint type, jlong pixelsAddress) { - glMultiTexImage1DEXTPROC glMultiTexImage1DEXT = (glMultiTexImage1DEXTPROC)tlsGetFunction(1565); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexImage2DEXT__IIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jlong pixelsAddress) { - glMultiTexImage2DEXTPROC glMultiTexImage2DEXT = (glMultiTexImage2DEXTPROC)tlsGetFunction(1566); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexSubImage1DEXT__IIIIIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint width, jint format, jint type, jlong pixelsAddress) { - glMultiTexSubImage1DEXTPROC glMultiTexSubImage1DEXT = (glMultiTexSubImage1DEXTPROC)tlsGetFunction(1567); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexSubImage2DEXT__IIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jlong pixelsAddress) { - glMultiTexSubImage2DEXTPROC glMultiTexSubImage2DEXT = (glMultiTexSubImage2DEXTPROC)tlsGetFunction(1568); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyMultiTexImage1DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint border) { - glCopyMultiTexImage1DEXTPROC glCopyMultiTexImage1DEXT = (glCopyMultiTexImage1DEXTPROC)tlsGetFunction(1569); - UNUSED_PARAM(clazz) - glCopyMultiTexImage1DEXT(texunit, target, level, internalformat, x, y, width, border); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyMultiTexImage2DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { - glCopyMultiTexImage2DEXTPROC glCopyMultiTexImage2DEXT = (glCopyMultiTexImage2DEXTPROC)tlsGetFunction(1570); - UNUSED_PARAM(clazz) - glCopyMultiTexImage2DEXT(texunit, target, level, internalformat, x, y, width, height, border); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyMultiTexSubImage1DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint x, jint y, jint width) { - glCopyMultiTexSubImage1DEXTPROC glCopyMultiTexSubImage1DEXT = (glCopyMultiTexSubImage1DEXTPROC)tlsGetFunction(1571); - UNUSED_PARAM(clazz) - glCopyMultiTexSubImage1DEXT(texunit, target, level, xoffset, x, y, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyMultiTexSubImage2DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { - glCopyMultiTexSubImage2DEXTPROC glCopyMultiTexSubImage2DEXT = (glCopyMultiTexSubImage2DEXTPROC)tlsGetFunction(1572); - UNUSED_PARAM(clazz) - glCopyMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexImageEXT__IIIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint format, jint type, jlong pixelsAddress) { - glGetMultiTexImageEXTPROC glGetMultiTexImageEXT = (glGetMultiTexImageEXTPROC)tlsGetFunction(1573); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexImageEXT(texunit, target, level, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexParameterfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glGetMultiTexParameterfvEXTPROC glGetMultiTexParameterfvEXT = (glGetMultiTexParameterfvEXTPROC)tlsGetFunction(1574); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexParameterfvEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexParameterivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glGetMultiTexParameterivEXTPROC glGetMultiTexParameterivEXT = (glGetMultiTexParameterivEXTPROC)tlsGetFunction(1575); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexParameterivEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexLevelParameterfvEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint pname, jlong paramsAddress) { - glGetMultiTexLevelParameterfvEXTPROC glGetMultiTexLevelParameterfvEXT = (glGetMultiTexLevelParameterfvEXTPROC)tlsGetFunction(1576); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexLevelParameterfvEXT(texunit, target, level, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexLevelParameterivEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint pname, jlong paramsAddress) { - glGetMultiTexLevelParameterivEXTPROC glGetMultiTexLevelParameterivEXT = (glGetMultiTexLevelParameterivEXTPROC)tlsGetFunction(1577); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexLevelParameterivEXT(texunit, target, level, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexImage3DEXT__IIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jlong pixelsAddress) { - glMultiTexImage3DEXTPROC glMultiTexImage3DEXT = (glMultiTexImage3DEXTPROC)tlsGetFunction(1578); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexSubImage3DEXT__IIIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jlong pixelsAddress) { - glMultiTexSubImage3DEXTPROC glMultiTexSubImage3DEXT = (glMultiTexSubImage3DEXTPROC)tlsGetFunction(1579); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCopyMultiTexSubImage3DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) { - glCopyMultiTexSubImage3DEXTPROC glCopyMultiTexSubImage3DEXT = (glCopyMultiTexSubImage3DEXTPROC)tlsGetFunction(1580); - UNUSED_PARAM(clazz) - glCopyMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glEnableClientStateIndexedEXT(JNIEnv *__env, jclass clazz, jint array, jint index) { - glEnableClientStateIndexedEXTPROC glEnableClientStateIndexedEXT = (glEnableClientStateIndexedEXTPROC)tlsGetFunction(1581); - UNUSED_PARAM(clazz) - glEnableClientStateIndexedEXT(array, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glDisableClientStateIndexedEXT(JNIEnv *__env, jclass clazz, jint array, jint index) { - glDisableClientStateIndexedEXTPROC glDisableClientStateIndexedEXT = (glDisableClientStateIndexedEXTPROC)tlsGetFunction(1582); - UNUSED_PARAM(clazz) - glDisableClientStateIndexedEXT(array, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glEnableClientStateiEXT(JNIEnv *__env, jclass clazz, jint array, jint index) { - glEnableClientStateiEXTPROC glEnableClientStateiEXT = (glEnableClientStateiEXTPROC)tlsGetFunction(1583); - UNUSED_PARAM(clazz) - glEnableClientStateiEXT(array, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glDisableClientStateiEXT(JNIEnv *__env, jclass clazz, jint array, jint index) { - glDisableClientStateiEXTPROC glDisableClientStateiEXT = (glDisableClientStateiEXTPROC)tlsGetFunction(1584); - UNUSED_PARAM(clazz) - glDisableClientStateiEXT(array, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetFloatIndexedvEXT__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glGetFloatIndexedvEXTPROC glGetFloatIndexedvEXT = (glGetFloatIndexedvEXTPROC)tlsGetFunction(1585); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetFloatIndexedvEXT(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetDoubleIndexedvEXT__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glGetDoubleIndexedvEXTPROC glGetDoubleIndexedvEXT = (glGetDoubleIndexedvEXTPROC)tlsGetFunction(1586); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetDoubleIndexedvEXT(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetPointerIndexedvEXT(JNIEnv *__env, jclass clazz, jint target, jint index, jlong paramsAddress) { - glGetPointerIndexedvEXTPROC glGetPointerIndexedvEXT = (glGetPointerIndexedvEXTPROC)tlsGetFunction(1587); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetPointerIndexedvEXT(target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetFloati_1vEXT__IIJ(JNIEnv *__env, jclass clazz, jint pname, jint index, jlong paramsAddress) { - glGetFloati_vEXTPROC glGetFloati_vEXT = (glGetFloati_vEXTPROC)tlsGetFunction(1588); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetFloati_vEXT(pname, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetDoublei_1vEXT__IIJ(JNIEnv *__env, jclass clazz, jint pname, jint index, jlong paramsAddress) { - glGetDoublei_vEXTPROC glGetDoublei_vEXT = (glGetDoublei_vEXTPROC)tlsGetFunction(1589); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetDoublei_vEXT(pname, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetPointeri_1vEXT(JNIEnv *__env, jclass clazz, jint pname, jint index, jlong paramsAddress) { - glGetPointeri_vEXTPROC glGetPointeri_vEXT = (glGetPointeri_vEXTPROC)tlsGetFunction(1590); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetPointeri_vEXT(pname, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedProgramStringEXT(JNIEnv *__env, jclass clazz, jint program, jint target, jint format, jint len, jlong stringAddress) { - glNamedProgramStringEXTPROC glNamedProgramStringEXT = (glNamedProgramStringEXTPROC)tlsGetFunction(1596); - uintptr_t string = (uintptr_t)stringAddress; - UNUSED_PARAM(clazz) - glNamedProgramStringEXT(program, target, format, len, string); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedProgramLocalParameter4dEXT(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jdouble x, jdouble y, jdouble z, jdouble w) { - glNamedProgramLocalParameter4dEXTPROC glNamedProgramLocalParameter4dEXT = (glNamedProgramLocalParameter4dEXTPROC)tlsGetFunction(1597); - UNUSED_PARAM(clazz) - glNamedProgramLocalParameter4dEXT(program, target, index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedProgramLocalParameter4dvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jlong paramsAddress) { - glNamedProgramLocalParameter4dvEXTPROC glNamedProgramLocalParameter4dvEXT = (glNamedProgramLocalParameter4dvEXTPROC)tlsGetFunction(1598); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glNamedProgramLocalParameter4dvEXT(program, target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedProgramLocalParameter4fEXT(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jfloat x, jfloat y, jfloat z, jfloat w) { - glNamedProgramLocalParameter4fEXTPROC glNamedProgramLocalParameter4fEXT = (glNamedProgramLocalParameter4fEXTPROC)tlsGetFunction(1599); - UNUSED_PARAM(clazz) - glNamedProgramLocalParameter4fEXT(program, target, index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedProgramLocalParameter4fvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jlong paramsAddress) { - glNamedProgramLocalParameter4fvEXTPROC glNamedProgramLocalParameter4fvEXT = (glNamedProgramLocalParameter4fvEXTPROC)tlsGetFunction(1600); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glNamedProgramLocalParameter4fvEXT(program, target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedProgramLocalParameterdvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jlong paramsAddress) { - glGetNamedProgramLocalParameterdvEXTPROC glGetNamedProgramLocalParameterdvEXT = (glGetNamedProgramLocalParameterdvEXTPROC)tlsGetFunction(1601); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedProgramLocalParameterdvEXT(program, target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedProgramLocalParameterfvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jlong paramsAddress) { - glGetNamedProgramLocalParameterfvEXTPROC glGetNamedProgramLocalParameterfvEXT = (glGetNamedProgramLocalParameterfvEXTPROC)tlsGetFunction(1602); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedProgramLocalParameterfvEXT(program, target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedProgramivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint pname, jlong paramsAddress) { - glGetNamedProgramivEXTPROC glGetNamedProgramivEXT = (glGetNamedProgramivEXTPROC)tlsGetFunction(1603); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedProgramivEXT(program, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedProgramStringEXT(JNIEnv *__env, jclass clazz, jint program, jint target, jint pname, jlong stringAddress) { - glGetNamedProgramStringEXTPROC glGetNamedProgramStringEXT = (glGetNamedProgramStringEXTPROC)tlsGetFunction(1604); - uintptr_t string = (uintptr_t)stringAddress; - UNUSED_PARAM(clazz) - glGetNamedProgramStringEXT(program, target, pname, string); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedTextureImage3DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jlong dataAddress) { - glCompressedTextureImage3DEXTPROC glCompressedTextureImage3DEXT = (glCompressedTextureImage3DEXTPROC)tlsGetFunction(1605); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedTextureImage2DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jlong dataAddress) { - glCompressedTextureImage2DEXTPROC glCompressedTextureImage2DEXT = (glCompressedTextureImage2DEXTPROC)tlsGetFunction(1606); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureImage2DEXT(texture, target, level, internalformat, width, height, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedTextureImage1DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint internalformat, jint width, jint border, jint imageSize, jlong dataAddress) { - glCompressedTextureImage1DEXTPROC glCompressedTextureImage1DEXT = (glCompressedTextureImage1DEXTPROC)tlsGetFunction(1607); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureImage1DEXT(texture, target, level, internalformat, width, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedTextureSubImage3DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jlong dataAddress) { - glCompressedTextureSubImage3DEXTPROC glCompressedTextureSubImage3DEXT = (glCompressedTextureSubImage3DEXTPROC)tlsGetFunction(1608); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedTextureSubImage2DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jlong dataAddress) { - glCompressedTextureSubImage2DEXTPROC glCompressedTextureSubImage2DEXT = (glCompressedTextureSubImage2DEXTPROC)tlsGetFunction(1609); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedTextureSubImage1DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jint xoffset, jint width, jint format, jint imageSize, jlong dataAddress) { - glCompressedTextureSubImage1DEXTPROC glCompressedTextureSubImage1DEXT = (glCompressedTextureSubImage1DEXTPROC)tlsGetFunction(1610); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureSubImage1DEXT(texture, target, level, xoffset, width, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetCompressedTextureImageEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint level, jlong imgAddress) { - glGetCompressedTextureImageEXTPROC glGetCompressedTextureImageEXT = (glGetCompressedTextureImageEXTPROC)tlsGetFunction(1611); - uintptr_t img = (uintptr_t)imgAddress; - UNUSED_PARAM(clazz) - glGetCompressedTextureImageEXT(texture, target, level, img); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedMultiTexImage3DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jlong dataAddress) { - glCompressedMultiTexImage3DEXTPROC glCompressedMultiTexImage3DEXT = (glCompressedMultiTexImage3DEXTPROC)tlsGetFunction(1612); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedMultiTexImage2DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jlong dataAddress) { - glCompressedMultiTexImage2DEXTPROC glCompressedMultiTexImage2DEXT = (glCompressedMultiTexImage2DEXTPROC)tlsGetFunction(1613); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedMultiTexImage1DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint internalformat, jint width, jint border, jint imageSize, jlong dataAddress) { - glCompressedMultiTexImage1DEXTPROC glCompressedMultiTexImage1DEXT = (glCompressedMultiTexImage1DEXTPROC)tlsGetFunction(1614); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedMultiTexSubImage3DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jlong dataAddress) { - glCompressedMultiTexSubImage3DEXTPROC glCompressedMultiTexSubImage3DEXT = (glCompressedMultiTexSubImage3DEXTPROC)tlsGetFunction(1615); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedMultiTexSubImage2DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jlong dataAddress) { - glCompressedMultiTexSubImage2DEXTPROC glCompressedMultiTexSubImage2DEXT = (glCompressedMultiTexSubImage2DEXTPROC)tlsGetFunction(1616); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglCompressedMultiTexSubImage1DEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jint xoffset, jint width, jint format, jint imageSize, jlong dataAddress) { - glCompressedMultiTexSubImage1DEXTPROC glCompressedMultiTexSubImage1DEXT = (glCompressedMultiTexSubImage1DEXTPROC)tlsGetFunction(1617); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetCompressedMultiTexImageEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint level, jlong imgAddress) { - glGetCompressedMultiTexImageEXTPROC glGetCompressedMultiTexImageEXT = (glGetCompressedMultiTexImageEXTPROC)tlsGetFunction(1618); - uintptr_t img = (uintptr_t)imgAddress; - UNUSED_PARAM(clazz) - glGetCompressedMultiTexImageEXT(texunit, target, level, img); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMatrixLoadTransposefEXT__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixLoadTransposefEXTPROC glMatrixLoadTransposefEXT = (glMatrixLoadTransposefEXTPROC)tlsGetFunction(1619); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixLoadTransposefEXT(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMatrixLoadTransposedEXT__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixLoadTransposedEXTPROC glMatrixLoadTransposedEXT = (glMatrixLoadTransposedEXTPROC)tlsGetFunction(1620); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixLoadTransposedEXT(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMatrixMultTransposefEXT__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixMultTransposefEXTPROC glMatrixMultTransposefEXT = (glMatrixMultTransposefEXTPROC)tlsGetFunction(1621); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixMultTransposefEXT(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMatrixMultTransposedEXT__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixMultTransposedEXTPROC glMatrixMultTransposedEXT = (glMatrixMultTransposedEXTPROC)tlsGetFunction(1622); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixMultTransposedEXT(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedBufferDataEXT__IJJI(JNIEnv *__env, jclass clazz, jint buffer, jlong size, jlong dataAddress, jint usage) { - glNamedBufferDataEXTPROC glNamedBufferDataEXT = (glNamedBufferDataEXTPROC)tlsGetFunction(1623); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glNamedBufferDataEXT(buffer, (uintptr_t)size, data, usage); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedBufferSubDataEXT__IJJJ(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong size, jlong dataAddress) { - glNamedBufferSubDataEXTPROC glNamedBufferSubDataEXT = (glNamedBufferSubDataEXTPROC)tlsGetFunction(1624); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glNamedBufferSubDataEXT(buffer, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMapNamedBufferEXT(JNIEnv *__env, jclass clazz, jint buffer, jint access) { - glMapNamedBufferEXTPROC glMapNamedBufferEXT = (glMapNamedBufferEXTPROC)tlsGetFunction(1625); - UNUSED_PARAM(clazz) - return (jlong)glMapNamedBufferEXT(buffer, access); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glUnmapNamedBufferEXT(JNIEnv *__env, jclass clazz, jint buffer) { - glUnmapNamedBufferEXTPROC glUnmapNamedBufferEXT = (glUnmapNamedBufferEXTPROC)tlsGetFunction(1626); - UNUSED_PARAM(clazz) - return glUnmapNamedBufferEXT(buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedBufferParameterivEXT__IIJ(JNIEnv *__env, jclass clazz, jint buffer, jint pname, jlong paramsAddress) { - glGetNamedBufferParameterivEXTPROC glGetNamedBufferParameterivEXT = (glGetNamedBufferParameterivEXTPROC)tlsGetFunction(1627); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedBufferParameterivEXT(buffer, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedBufferSubDataEXT__IJJJ(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong size, jlong dataAddress) { - glGetNamedBufferSubDataEXTPROC glGetNamedBufferSubDataEXT = (glGetNamedBufferSubDataEXTPROC)tlsGetFunction(1628); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetNamedBufferSubDataEXT(buffer, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform1fEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jfloat v0) { - glProgramUniform1fEXTPROC glProgramUniform1fEXT = (glProgramUniform1fEXTPROC)tlsGetFunction(1629); - UNUSED_PARAM(clazz) - glProgramUniform1fEXT(program, location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform2fEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jfloat v0, jfloat v1) { - glProgramUniform2fEXTPROC glProgramUniform2fEXT = (glProgramUniform2fEXTPROC)tlsGetFunction(1630); - UNUSED_PARAM(clazz) - glProgramUniform2fEXT(program, location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform3fEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jfloat v0, jfloat v1, jfloat v2) { - glProgramUniform3fEXTPROC glProgramUniform3fEXT = (glProgramUniform3fEXTPROC)tlsGetFunction(1631); - UNUSED_PARAM(clazz) - glProgramUniform3fEXT(program, location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform4fEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jfloat v0, jfloat v1, jfloat v2, jfloat v3) { - glProgramUniform4fEXTPROC glProgramUniform4fEXT = (glProgramUniform4fEXTPROC)tlsGetFunction(1632); - UNUSED_PARAM(clazz) - glProgramUniform4fEXT(program, location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform1iEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint v0) { - glProgramUniform1iEXTPROC glProgramUniform1iEXT = (glProgramUniform1iEXTPROC)tlsGetFunction(1633); - UNUSED_PARAM(clazz) - glProgramUniform1iEXT(program, location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform2iEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint v0, jint v1) { - glProgramUniform2iEXTPROC glProgramUniform2iEXT = (glProgramUniform2iEXTPROC)tlsGetFunction(1634); - UNUSED_PARAM(clazz) - glProgramUniform2iEXT(program, location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform3iEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint v0, jint v1, jint v2) { - glProgramUniform3iEXTPROC glProgramUniform3iEXT = (glProgramUniform3iEXTPROC)tlsGetFunction(1635); - UNUSED_PARAM(clazz) - glProgramUniform3iEXT(program, location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform4iEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint v0, jint v1, jint v2, jint v3) { - glProgramUniform4iEXTPROC glProgramUniform4iEXT = (glProgramUniform4iEXTPROC)tlsGetFunction(1636); - UNUSED_PARAM(clazz) - glProgramUniform4iEXT(program, location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform1fvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1fvEXTPROC glProgramUniform1fvEXT = (glProgramUniform1fvEXTPROC)tlsGetFunction(1637); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1fvEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform2fvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2fvEXTPROC glProgramUniform2fvEXT = (glProgramUniform2fvEXTPROC)tlsGetFunction(1638); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2fvEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform3fvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3fvEXTPROC glProgramUniform3fvEXT = (glProgramUniform3fvEXTPROC)tlsGetFunction(1639); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3fvEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform4fvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4fvEXTPROC glProgramUniform4fvEXT = (glProgramUniform4fvEXTPROC)tlsGetFunction(1640); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4fvEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform1ivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1ivEXTPROC glProgramUniform1ivEXT = (glProgramUniform1ivEXTPROC)tlsGetFunction(1641); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1ivEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform2ivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2ivEXTPROC glProgramUniform2ivEXT = (glProgramUniform2ivEXTPROC)tlsGetFunction(1642); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2ivEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform3ivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3ivEXTPROC glProgramUniform3ivEXT = (glProgramUniform3ivEXTPROC)tlsGetFunction(1643); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3ivEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform4ivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4ivEXTPROC glProgramUniform4ivEXT = (glProgramUniform4ivEXTPROC)tlsGetFunction(1644); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4ivEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix2fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2fvEXTPROC glProgramUniformMatrix2fvEXT = (glProgramUniformMatrix2fvEXTPROC)tlsGetFunction(1645); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix3fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3fvEXTPROC glProgramUniformMatrix3fvEXT = (glProgramUniformMatrix3fvEXTPROC)tlsGetFunction(1646); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix4fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4fvEXTPROC glProgramUniformMatrix4fvEXT = (glProgramUniformMatrix4fvEXTPROC)tlsGetFunction(1647); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix2x3fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2x3fvEXTPROC glProgramUniformMatrix2x3fvEXT = (glProgramUniformMatrix2x3fvEXTPROC)tlsGetFunction(1648); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2x3fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix3x2fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3x2fvEXTPROC glProgramUniformMatrix3x2fvEXT = (glProgramUniformMatrix3x2fvEXTPROC)tlsGetFunction(1649); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3x2fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix2x4fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2x4fvEXTPROC glProgramUniformMatrix2x4fvEXT = (glProgramUniformMatrix2x4fvEXTPROC)tlsGetFunction(1650); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2x4fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix4x2fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4x2fvEXTPROC glProgramUniformMatrix4x2fvEXT = (glProgramUniformMatrix4x2fvEXTPROC)tlsGetFunction(1651); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4x2fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix3x4fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3x4fvEXTPROC glProgramUniformMatrix3x4fvEXT = (glProgramUniformMatrix3x4fvEXTPROC)tlsGetFunction(1652); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3x4fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniformMatrix4x3fvEXT__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4x3fvEXTPROC glProgramUniformMatrix4x3fvEXT = (glProgramUniformMatrix4x3fvEXTPROC)tlsGetFunction(1653); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4x3fvEXT(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glTextureBufferEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint internalformat, jint buffer) { - glTextureBufferEXTPROC glTextureBufferEXT = (glTextureBufferEXTPROC)tlsGetFunction(1654); - UNUSED_PARAM(clazz) - glTextureBufferEXT(texture, target, internalformat, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexBufferEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint internalformat, jint buffer) { - glMultiTexBufferEXTPROC glMultiTexBufferEXT = (glMultiTexBufferEXTPROC)tlsGetFunction(1655); - UNUSED_PARAM(clazz) - glMultiTexBufferEXT(texunit, target, internalformat, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureParameterIivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jlong paramsAddress) { - glTextureParameterIivEXTPROC glTextureParameterIivEXT = (glTextureParameterIivEXTPROC)tlsGetFunction(1656); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTextureParameterIivEXT(texture, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglTextureParameterIuivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jlong paramsAddress) { - glTextureParameterIuivEXTPROC glTextureParameterIuivEXT = (glTextureParameterIuivEXTPROC)tlsGetFunction(1657); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTextureParameterIuivEXT(texture, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetTextureParameterIivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jlong paramsAddress) { - glGetTextureParameterIivEXTPROC glGetTextureParameterIivEXT = (glGetTextureParameterIivEXTPROC)tlsGetFunction(1658); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureParameterIivEXT(texture, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetTextureParameterIuivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint target, jint pname, jlong paramsAddress) { - glGetTextureParameterIuivEXTPROC glGetTextureParameterIuivEXT = (glGetTextureParameterIuivEXTPROC)tlsGetFunction(1659); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureParameterIuivEXT(texture, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexParameterIivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glMultiTexParameterIivEXTPROC glMultiTexParameterIivEXT = (glMultiTexParameterIivEXTPROC)tlsGetFunction(1660); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMultiTexParameterIivEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMultiTexParameterIuivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glMultiTexParameterIuivEXTPROC glMultiTexParameterIuivEXT = (glMultiTexParameterIuivEXTPROC)tlsGetFunction(1661); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMultiTexParameterIuivEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexParameterIivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glGetMultiTexParameterIivEXTPROC glGetMultiTexParameterIivEXT = (glGetMultiTexParameterIivEXTPROC)tlsGetFunction(1662); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexParameterIivEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetMultiTexParameterIuivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint pname, jlong paramsAddress) { - glGetMultiTexParameterIuivEXTPROC glGetMultiTexParameterIuivEXT = (glGetMultiTexParameterIuivEXTPROC)tlsGetFunction(1663); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMultiTexParameterIuivEXT(texunit, target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform1uiEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint v0) { - glProgramUniform1uiEXTPROC glProgramUniform1uiEXT = (glProgramUniform1uiEXTPROC)tlsGetFunction(1664); - UNUSED_PARAM(clazz) - glProgramUniform1uiEXT(program, location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform2uiEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint v0, jint v1) { - glProgramUniform2uiEXTPROC glProgramUniform2uiEXT = (glProgramUniform2uiEXTPROC)tlsGetFunction(1665); - UNUSED_PARAM(clazz) - glProgramUniform2uiEXT(program, location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform3uiEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint v0, jint v1, jint v2) { - glProgramUniform3uiEXTPROC glProgramUniform3uiEXT = (glProgramUniform3uiEXTPROC)tlsGetFunction(1666); - UNUSED_PARAM(clazz) - glProgramUniform3uiEXT(program, location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glProgramUniform4uiEXT(JNIEnv *__env, jclass clazz, jint program, jint location, jint v0, jint v1, jint v2, jint v3) { - glProgramUniform4uiEXTPROC glProgramUniform4uiEXT = (glProgramUniform4uiEXTPROC)tlsGetFunction(1667); - UNUSED_PARAM(clazz) - glProgramUniform4uiEXT(program, location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform1uivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1uivEXTPROC glProgramUniform1uivEXT = (glProgramUniform1uivEXTPROC)tlsGetFunction(1668); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1uivEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform2uivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2uivEXTPROC glProgramUniform2uivEXT = (glProgramUniform2uivEXTPROC)tlsGetFunction(1669); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2uivEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform3uivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3uivEXTPROC glProgramUniform3uivEXT = (glProgramUniform3uivEXTPROC)tlsGetFunction(1670); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3uivEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglProgramUniform4uivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4uivEXTPROC glProgramUniform4uivEXT = (glProgramUniform4uivEXTPROC)tlsGetFunction(1671); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4uivEXT(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedProgramLocalParameters4fvEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jint count, jlong paramsAddress) { - glNamedProgramLocalParameters4fvEXTPROC glNamedProgramLocalParameters4fvEXT = (glNamedProgramLocalParameters4fvEXTPROC)tlsGetFunction(1672); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glNamedProgramLocalParameters4fvEXT(program, target, index, count, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedProgramLocalParameterI4iEXT(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jint x, jint y, jint z, jint w) { - glNamedProgramLocalParameterI4iEXTPROC glNamedProgramLocalParameterI4iEXT = (glNamedProgramLocalParameterI4iEXTPROC)tlsGetFunction(1673); - UNUSED_PARAM(clazz) - glNamedProgramLocalParameterI4iEXT(program, target, index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedProgramLocalParameterI4ivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jlong paramsAddress) { - glNamedProgramLocalParameterI4ivEXTPROC glNamedProgramLocalParameterI4ivEXT = (glNamedProgramLocalParameterI4ivEXTPROC)tlsGetFunction(1674); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glNamedProgramLocalParameterI4ivEXT(program, target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedProgramLocalParametersI4ivEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jint count, jlong paramsAddress) { - glNamedProgramLocalParametersI4ivEXTPROC glNamedProgramLocalParametersI4ivEXT = (glNamedProgramLocalParametersI4ivEXTPROC)tlsGetFunction(1675); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glNamedProgramLocalParametersI4ivEXT(program, target, index, count, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedProgramLocalParameterI4uiEXT(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jint x, jint y, jint z, jint w) { - glNamedProgramLocalParameterI4uiEXTPROC glNamedProgramLocalParameterI4uiEXT = (glNamedProgramLocalParameterI4uiEXTPROC)tlsGetFunction(1676); - UNUSED_PARAM(clazz) - glNamedProgramLocalParameterI4uiEXT(program, target, index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedProgramLocalParameterI4uivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jlong paramsAddress) { - glNamedProgramLocalParameterI4uivEXTPROC glNamedProgramLocalParameterI4uivEXT = (glNamedProgramLocalParameterI4uivEXTPROC)tlsGetFunction(1677); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glNamedProgramLocalParameterI4uivEXT(program, target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglNamedProgramLocalParametersI4uivEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jint count, jlong paramsAddress) { - glNamedProgramLocalParametersI4uivEXTPROC glNamedProgramLocalParametersI4uivEXT = (glNamedProgramLocalParametersI4uivEXTPROC)tlsGetFunction(1678); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glNamedProgramLocalParametersI4uivEXT(program, target, index, count, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedProgramLocalParameterIivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jlong paramsAddress) { - glGetNamedProgramLocalParameterIivEXTPROC glGetNamedProgramLocalParameterIivEXT = (glGetNamedProgramLocalParameterIivEXTPROC)tlsGetFunction(1679); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedProgramLocalParameterIivEXT(program, target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedProgramLocalParameterIuivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint target, jint index, jlong paramsAddress) { - glGetNamedProgramLocalParameterIuivEXTPROC glGetNamedProgramLocalParameterIuivEXT = (glGetNamedProgramLocalParameterIuivEXTPROC)tlsGetFunction(1680); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedProgramLocalParameterIuivEXT(program, target, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedRenderbufferStorageEXT(JNIEnv *__env, jclass clazz, jint renderbuffer, jint internalformat, jint width, jint height) { - glNamedRenderbufferStorageEXTPROC glNamedRenderbufferStorageEXT = (glNamedRenderbufferStorageEXTPROC)tlsGetFunction(1681); - UNUSED_PARAM(clazz) - glNamedRenderbufferStorageEXT(renderbuffer, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedRenderbufferParameterivEXT__IIJ(JNIEnv *__env, jclass clazz, jint renderbuffer, jint pname, jlong paramsAddress) { - glGetNamedRenderbufferParameterivEXTPROC glGetNamedRenderbufferParameterivEXT = (glGetNamedRenderbufferParameterivEXTPROC)tlsGetFunction(1682); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedRenderbufferParameterivEXT(renderbuffer, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedRenderbufferStorageMultisampleEXT(JNIEnv *__env, jclass clazz, jint renderbuffer, jint samples, jint internalformat, jint width, jint height) { - glNamedRenderbufferStorageMultisampleEXTPROC glNamedRenderbufferStorageMultisampleEXT = (glNamedRenderbufferStorageMultisampleEXTPROC)tlsGetFunction(1683); - UNUSED_PARAM(clazz) - glNamedRenderbufferStorageMultisampleEXT(renderbuffer, samples, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedRenderbufferStorageMultisampleCoverageEXT(JNIEnv *__env, jclass clazz, jint renderbuffer, jint coverageSamples, jint colorSamples, jint internalformat, jint width, jint height) { - glNamedRenderbufferStorageMultisampleCoverageEXTPROC glNamedRenderbufferStorageMultisampleCoverageEXT = (glNamedRenderbufferStorageMultisampleCoverageEXTPROC)tlsGetFunction(1684); - UNUSED_PARAM(clazz) - glNamedRenderbufferStorageMultisampleCoverageEXT(renderbuffer, coverageSamples, colorSamples, internalformat, width, height); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glCheckNamedFramebufferStatusEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint target) { - glCheckNamedFramebufferStatusEXTPROC glCheckNamedFramebufferStatusEXT = (glCheckNamedFramebufferStatusEXTPROC)tlsGetFunction(1685); - UNUSED_PARAM(clazz) - return glCheckNamedFramebufferStatusEXT(framebuffer, target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedFramebufferTexture1DEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint textarget, jint texture, jint level) { - glNamedFramebufferTexture1DEXTPROC glNamedFramebufferTexture1DEXT = (glNamedFramebufferTexture1DEXTPROC)tlsGetFunction(1686); - UNUSED_PARAM(clazz) - glNamedFramebufferTexture1DEXT(framebuffer, attachment, textarget, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedFramebufferTexture2DEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint textarget, jint texture, jint level) { - glNamedFramebufferTexture2DEXTPROC glNamedFramebufferTexture2DEXT = (glNamedFramebufferTexture2DEXTPROC)tlsGetFunction(1687); - UNUSED_PARAM(clazz) - glNamedFramebufferTexture2DEXT(framebuffer, attachment, textarget, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedFramebufferTexture3DEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint textarget, jint texture, jint level, jint zoffset) { - glNamedFramebufferTexture3DEXTPROC glNamedFramebufferTexture3DEXT = (glNamedFramebufferTexture3DEXTPROC)tlsGetFunction(1688); - UNUSED_PARAM(clazz) - glNamedFramebufferTexture3DEXT(framebuffer, attachment, textarget, texture, level, zoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedFramebufferRenderbufferEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint renderbuffertarget, jint renderbuffer) { - glNamedFramebufferRenderbufferEXTPROC glNamedFramebufferRenderbufferEXT = (glNamedFramebufferRenderbufferEXTPROC)tlsGetFunction(1689); - UNUSED_PARAM(clazz) - glNamedFramebufferRenderbufferEXT(framebuffer, attachment, renderbuffertarget, renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetNamedFramebufferAttachmentParameterivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint pname, jlong paramsAddress) { - glGetNamedFramebufferAttachmentParameterivEXTPROC glGetNamedFramebufferAttachmentParameterivEXT = (glGetNamedFramebufferAttachmentParameterivEXTPROC)tlsGetFunction(1690); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedFramebufferAttachmentParameterivEXT(framebuffer, attachment, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glGenerateTextureMipmapEXT(JNIEnv *__env, jclass clazz, jint texture, jint target) { - glGenerateTextureMipmapEXTPROC glGenerateTextureMipmapEXT = (glGenerateTextureMipmapEXTPROC)tlsGetFunction(1691); - UNUSED_PARAM(clazz) - glGenerateTextureMipmapEXT(texture, target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glGenerateMultiTexMipmapEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target) { - glGenerateMultiTexMipmapEXTPROC glGenerateMultiTexMipmapEXT = (glGenerateMultiTexMipmapEXTPROC)tlsGetFunction(1692); - UNUSED_PARAM(clazz) - glGenerateMultiTexMipmapEXT(texunit, target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glFramebufferDrawBufferEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint mode) { - glFramebufferDrawBufferEXTPROC glFramebufferDrawBufferEXT = (glFramebufferDrawBufferEXTPROC)tlsGetFunction(1693); - UNUSED_PARAM(clazz) - glFramebufferDrawBufferEXT(framebuffer, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglFramebufferDrawBuffersEXT__IIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint n, jlong bufsAddress) { - glFramebufferDrawBuffersEXTPROC glFramebufferDrawBuffersEXT = (glFramebufferDrawBuffersEXTPROC)tlsGetFunction(1694); - uintptr_t bufs = (uintptr_t)bufsAddress; - UNUSED_PARAM(clazz) - glFramebufferDrawBuffersEXT(framebuffer, n, bufs); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glFramebufferReadBufferEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint mode) { - glFramebufferReadBufferEXTPROC glFramebufferReadBufferEXT = (glFramebufferReadBufferEXTPROC)tlsGetFunction(1695); - UNUSED_PARAM(clazz) - glFramebufferReadBufferEXT(framebuffer, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetFramebufferParameterivEXT__IIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint pname, jlong paramAddress) { - glGetFramebufferParameterivEXTPROC glGetFramebufferParameterivEXT = (glGetFramebufferParameterivEXTPROC)tlsGetFunction(1696); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetFramebufferParameterivEXT(framebuffer, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedCopyBufferSubDataEXT(JNIEnv *__env, jclass clazz, jint readBuffer, jint writeBuffer, jlong readOffset, jlong writeOffset, jlong size) { - glNamedCopyBufferSubDataEXTPROC glNamedCopyBufferSubDataEXT = (glNamedCopyBufferSubDataEXTPROC)tlsGetFunction(1697); - UNUSED_PARAM(clazz) - glNamedCopyBufferSubDataEXT(readBuffer, writeBuffer, (uintptr_t)readOffset, (uintptr_t)writeOffset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedFramebufferTextureEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint texture, jint level) { - glNamedFramebufferTextureEXTPROC glNamedFramebufferTextureEXT = (glNamedFramebufferTextureEXTPROC)tlsGetFunction(1698); - UNUSED_PARAM(clazz) - glNamedFramebufferTextureEXT(framebuffer, attachment, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedFramebufferTextureLayerEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint texture, jint level, jint layer) { - glNamedFramebufferTextureLayerEXTPROC glNamedFramebufferTextureLayerEXT = (glNamedFramebufferTextureLayerEXTPROC)tlsGetFunction(1699); - UNUSED_PARAM(clazz) - glNamedFramebufferTextureLayerEXT(framebuffer, attachment, texture, level, layer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glNamedFramebufferTextureFaceEXT(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint texture, jint level, jint face) { - glNamedFramebufferTextureFaceEXTPROC glNamedFramebufferTextureFaceEXT = (glNamedFramebufferTextureFaceEXTPROC)tlsGetFunction(1700); - UNUSED_PARAM(clazz) - glNamedFramebufferTextureFaceEXT(framebuffer, attachment, texture, level, face); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glTextureRenderbufferEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint renderbuffer) { - glTextureRenderbufferEXTPROC glTextureRenderbufferEXT = (glTextureRenderbufferEXTPROC)tlsGetFunction(1701); - UNUSED_PARAM(clazz) - glTextureRenderbufferEXT(texture, target, renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glMultiTexRenderbufferEXT(JNIEnv *__env, jclass clazz, jint texunit, jint target, jint renderbuffer) { - glMultiTexRenderbufferEXTPROC glMultiTexRenderbufferEXT = (glMultiTexRenderbufferEXTPROC)tlsGetFunction(1702); - UNUSED_PARAM(clazz) - glMultiTexRenderbufferEXT(texunit, target, renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayVertexOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint size, jint type, jint stride, jlong offset) { - glVertexArrayVertexOffsetEXTPROC glVertexArrayVertexOffsetEXT = (glVertexArrayVertexOffsetEXTPROC)tlsGetFunction(1703); - UNUSED_PARAM(clazz) - glVertexArrayVertexOffsetEXT(vaobj, buffer, size, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayColorOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint size, jint type, jint stride, jlong offset) { - glVertexArrayColorOffsetEXTPROC glVertexArrayColorOffsetEXT = (glVertexArrayColorOffsetEXTPROC)tlsGetFunction(1704); - UNUSED_PARAM(clazz) - glVertexArrayColorOffsetEXT(vaobj, buffer, size, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayEdgeFlagOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint stride, jlong offset) { - glVertexArrayEdgeFlagOffsetEXTPROC glVertexArrayEdgeFlagOffsetEXT = (glVertexArrayEdgeFlagOffsetEXTPROC)tlsGetFunction(1705); - UNUSED_PARAM(clazz) - glVertexArrayEdgeFlagOffsetEXT(vaobj, buffer, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayIndexOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint type, jint stride, jlong offset) { - glVertexArrayIndexOffsetEXTPROC glVertexArrayIndexOffsetEXT = (glVertexArrayIndexOffsetEXTPROC)tlsGetFunction(1706); - UNUSED_PARAM(clazz) - glVertexArrayIndexOffsetEXT(vaobj, buffer, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayNormalOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint type, jint stride, jlong offset) { - glVertexArrayNormalOffsetEXTPROC glVertexArrayNormalOffsetEXT = (glVertexArrayNormalOffsetEXTPROC)tlsGetFunction(1707); - UNUSED_PARAM(clazz) - glVertexArrayNormalOffsetEXT(vaobj, buffer, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayTexCoordOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint size, jint type, jint stride, jlong offset) { - glVertexArrayTexCoordOffsetEXTPROC glVertexArrayTexCoordOffsetEXT = (glVertexArrayTexCoordOffsetEXTPROC)tlsGetFunction(1708); - UNUSED_PARAM(clazz) - glVertexArrayTexCoordOffsetEXT(vaobj, buffer, size, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayMultiTexCoordOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint texunit, jint size, jint type, jint stride, jlong offset) { - glVertexArrayMultiTexCoordOffsetEXTPROC glVertexArrayMultiTexCoordOffsetEXT = (glVertexArrayMultiTexCoordOffsetEXTPROC)tlsGetFunction(1709); - UNUSED_PARAM(clazz) - glVertexArrayMultiTexCoordOffsetEXT(vaobj, buffer, texunit, size, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayFogCoordOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint type, jint stride, jlong offset) { - glVertexArrayFogCoordOffsetEXTPROC glVertexArrayFogCoordOffsetEXT = (glVertexArrayFogCoordOffsetEXTPROC)tlsGetFunction(1710); - UNUSED_PARAM(clazz) - glVertexArrayFogCoordOffsetEXT(vaobj, buffer, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArraySecondaryColorOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint size, jint type, jint stride, jlong offset) { - glVertexArraySecondaryColorOffsetEXTPROC glVertexArraySecondaryColorOffsetEXT = (glVertexArraySecondaryColorOffsetEXTPROC)tlsGetFunction(1711); - UNUSED_PARAM(clazz) - glVertexArraySecondaryColorOffsetEXT(vaobj, buffer, size, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayVertexAttribOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint index, jint size, jint type, jboolean normalized, jint stride, jlong offset) { - glVertexArrayVertexAttribOffsetEXTPROC glVertexArrayVertexAttribOffsetEXT = (glVertexArrayVertexAttribOffsetEXTPROC)tlsGetFunction(1712); - UNUSED_PARAM(clazz) - glVertexArrayVertexAttribOffsetEXT(vaobj, buffer, index, size, type, normalized, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glVertexArrayVertexAttribIOffsetEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer, jint index, jint size, jint type, jint stride, jlong offset) { - glVertexArrayVertexAttribIOffsetEXTPROC glVertexArrayVertexAttribIOffsetEXT = (glVertexArrayVertexAttribIOffsetEXTPROC)tlsGetFunction(1713); - UNUSED_PARAM(clazz) - glVertexArrayVertexAttribIOffsetEXT(vaobj, buffer, index, size, type, stride, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glEnableVertexArrayEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint array) { - glEnableVertexArrayEXTPROC glEnableVertexArrayEXT = (glEnableVertexArrayEXTPROC)tlsGetFunction(1714); - UNUSED_PARAM(clazz) - glEnableVertexArrayEXT(vaobj, array); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glDisableVertexArrayEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint array) { - glDisableVertexArrayEXTPROC glDisableVertexArrayEXT = (glDisableVertexArrayEXTPROC)tlsGetFunction(1715); - UNUSED_PARAM(clazz) - glDisableVertexArrayEXT(vaobj, array); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glEnableVertexArrayAttribEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint index) { - glEnableVertexArrayAttribEXTPROC glEnableVertexArrayAttribEXT = (glEnableVertexArrayAttribEXTPROC)tlsGetFunction(1716); - UNUSED_PARAM(clazz) - glEnableVertexArrayAttribEXT(vaobj, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glDisableVertexArrayAttribEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint index) { - glDisableVertexArrayAttribEXTPROC glDisableVertexArrayAttribEXT = (glDisableVertexArrayAttribEXTPROC)tlsGetFunction(1717); - UNUSED_PARAM(clazz) - glDisableVertexArrayAttribEXT(vaobj, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetVertexArrayIntegervEXT__IIJ(JNIEnv *__env, jclass clazz, jint vaobj, jint pname, jlong paramAddress) { - glGetVertexArrayIntegervEXTPROC glGetVertexArrayIntegervEXT = (glGetVertexArrayIntegervEXTPROC)tlsGetFunction(1718); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetVertexArrayIntegervEXT(vaobj, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetVertexArrayPointervEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint pname, jlong paramAddress) { - glGetVertexArrayPointervEXTPROC glGetVertexArrayPointervEXT = (glGetVertexArrayPointervEXTPROC)tlsGetFunction(1719); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetVertexArrayPointervEXT(vaobj, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetVertexArrayIntegeri_1vEXT__IIIJ(JNIEnv *__env, jclass clazz, jint vaobj, jint index, jint pname, jlong paramAddress) { - glGetVertexArrayIntegeri_vEXTPROC glGetVertexArrayIntegeri_vEXT = (glGetVertexArrayIntegeri_vEXTPROC)tlsGetFunction(1720); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetVertexArrayIntegeri_vEXT(vaobj, index, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglGetVertexArrayPointeri_1vEXT(JNIEnv *__env, jclass clazz, jint vaobj, jint index, jint pname, jlong paramAddress) { - glGetVertexArrayPointeri_vEXTPROC glGetVertexArrayPointeri_vEXT = (glGetVertexArrayPointeri_vEXTPROC)tlsGetFunction(1721); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetVertexArrayPointeri_vEXT(vaobj, index, pname, param); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_nglMapNamedBufferRangeEXT(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong length, jint access) { - glMapNamedBufferRangeEXTPROC glMapNamedBufferRangeEXT = (glMapNamedBufferRangeEXTPROC)tlsGetFunction(1722); - UNUSED_PARAM(clazz) - return (jlong)glMapNamedBufferRangeEXT(buffer, (uintptr_t)offset, (uintptr_t)length, access); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDirectStateAccess_glFlushMappedNamedBufferRangeEXT(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong length) { - glFlushMappedNamedBufferRangeEXTPROC glFlushMappedNamedBufferRangeEXT = (glFlushMappedNamedBufferRangeEXTPROC)tlsGetFunction(1723); - UNUSED_PARAM(clazz) - glFlushMappedNamedBufferRangeEXT(buffer, (uintptr_t)offset, (uintptr_t)length); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDrawBuffers2.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDrawBuffers2.c deleted file mode 100644 index 77c6c158..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDrawBuffers2.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glColorMaskIndexedEXTPROC) (jint, jboolean, jboolean, jboolean, jboolean); -typedef void (APIENTRY *glGetBooleanIndexedvEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetIntegerIndexedvEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glEnableIndexedEXTPROC) (jint, jint); -typedef void (APIENTRY *glDisableIndexedEXTPROC) (jint, jint); -typedef jboolean (APIENTRY *glIsEnabledIndexedEXTPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDrawBuffers2_glColorMaskIndexedEXT(JNIEnv *__env, jclass clazz, jint index, jboolean r, jboolean g, jboolean b, jboolean a) { - glColorMaskIndexedEXTPROC glColorMaskIndexedEXT = (glColorMaskIndexedEXTPROC)tlsGetFunction(1724); - UNUSED_PARAM(clazz) - glColorMaskIndexedEXT(index, r, g, b, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDrawBuffers2_nglGetBooleanIndexedvEXT(JNIEnv *__env, jclass clazz, jint target, jint index, jlong dataAddress) { - glGetBooleanIndexedvEXTPROC glGetBooleanIndexedvEXT = (glGetBooleanIndexedvEXTPROC)tlsGetFunction(1595); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetBooleanIndexedvEXT(target, index, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDrawBuffers2_nglGetIntegerIndexedvEXT__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong dataAddress) { - glGetIntegerIndexedvEXTPROC glGetIntegerIndexedvEXT = (glGetIntegerIndexedvEXTPROC)tlsGetFunction(1594); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetIntegerIndexedvEXT(target, index, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDrawBuffers2_glEnableIndexedEXT(JNIEnv *__env, jclass clazz, jint target, jint index) { - glEnableIndexedEXTPROC glEnableIndexedEXT = (glEnableIndexedEXTPROC)tlsGetFunction(1591); - UNUSED_PARAM(clazz) - glEnableIndexedEXT(target, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDrawBuffers2_glDisableIndexedEXT(JNIEnv *__env, jclass clazz, jint target, jint index) { - glDisableIndexedEXTPROC glDisableIndexedEXT = (glDisableIndexedEXTPROC)tlsGetFunction(1592); - UNUSED_PARAM(clazz) - glDisableIndexedEXT(target, index); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_EXTDrawBuffers2_glIsEnabledIndexedEXT(JNIEnv *__env, jclass clazz, jint target, jint index) { - glIsEnabledIndexedEXTPROC glIsEnabledIndexedEXT = (glIsEnabledIndexedEXTPROC)tlsGetFunction(1593); - UNUSED_PARAM(clazz) - return glIsEnabledIndexedEXT(target, index); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDrawInstanced.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDrawInstanced.c deleted file mode 100644 index 6451f1f2..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTDrawInstanced.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDrawArraysInstancedEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glDrawElementsInstancedEXTPROC) (jint, jint, jint, uintptr_t, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDrawInstanced_glDrawArraysInstancedEXT(JNIEnv *__env, jclass clazz, jint mode, jint start, jint count, jint primcount) { - glDrawArraysInstancedEXTPROC glDrawArraysInstancedEXT = (glDrawArraysInstancedEXTPROC)tlsGetFunction(1725); - UNUSED_PARAM(clazz) - glDrawArraysInstancedEXT(mode, start, count, primcount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTDrawInstanced_nglDrawElementsInstancedEXT(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress, jint primcount) { - glDrawElementsInstancedEXTPROC glDrawElementsInstancedEXT = (glDrawElementsInstancedEXTPROC)tlsGetFunction(1726); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawElementsInstancedEXT(mode, count, type, indices, primcount); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTEGLImageStorage.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTEGLImageStorage.c deleted file mode 100644 index 417b0b7d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTEGLImageStorage.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glEGLImageTargetTexStorageEXTPROC) (jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glEGLImageTargetTextureStorageEXTPROC) (jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTEGLImageStorage_nglEGLImageTargetTexStorageEXT__IJJ(JNIEnv *__env, jclass clazz, jint target, jlong imageAddress, jlong attrib_listAddress) { - glEGLImageTargetTexStorageEXTPROC glEGLImageTargetTexStorageEXT = (glEGLImageTargetTexStorageEXTPROC)tlsGetFunction(1727); - uintptr_t image = (uintptr_t)imageAddress; - uintptr_t attrib_list = (uintptr_t)attrib_listAddress; - UNUSED_PARAM(clazz) - glEGLImageTargetTexStorageEXT(target, image, attrib_list); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTEGLImageStorage_nglEGLImageTargetTextureStorageEXT__IJJ(JNIEnv *__env, jclass clazz, jint texture, jlong imageAddress, jlong attrib_listAddress) { - glEGLImageTargetTextureStorageEXTPROC glEGLImageTargetTextureStorageEXT = (glEGLImageTargetTextureStorageEXTPROC)tlsGetFunction(1728); - uintptr_t image = (uintptr_t)imageAddress; - uintptr_t attrib_list = (uintptr_t)attrib_listAddress; - UNUSED_PARAM(clazz) - glEGLImageTargetTextureStorageEXT(texture, image, attrib_list); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTExternalBuffer.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTExternalBuffer.c deleted file mode 100644 index b975b53a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTExternalBuffer.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBufferStorageExternalEXTPROC) (jint, uintptr_t, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glNamedBufferStorageExternalEXTPROC) (jint, uintptr_t, uintptr_t, uintptr_t, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTExternalBuffer_nglBufferStorageExternalEXT(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong size, jlong clientBufferAddress, jint flags) { - glBufferStorageExternalEXTPROC glBufferStorageExternalEXT = (glBufferStorageExternalEXTPROC)tlsGetFunction(1729); - uintptr_t clientBuffer = (uintptr_t)clientBufferAddress; - UNUSED_PARAM(clazz) - glBufferStorageExternalEXT(target, (uintptr_t)offset, (uintptr_t)size, clientBuffer, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTExternalBuffer_nglNamedBufferStorageExternalEXT(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong size, jlong clientBufferAddress, jint flags) { - glNamedBufferStorageExternalEXTPROC glNamedBufferStorageExternalEXT = (glNamedBufferStorageExternalEXTPROC)tlsGetFunction(1730); - uintptr_t clientBuffer = (uintptr_t)clientBufferAddress; - UNUSED_PARAM(clazz) - glNamedBufferStorageExternalEXT(buffer, (uintptr_t)offset, (uintptr_t)size, clientBuffer, flags); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferBlit.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferBlit.c deleted file mode 100644 index 0daeb987..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferBlit.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlitFramebufferEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferBlit_glBlitFramebufferEXT(JNIEnv *__env, jclass clazz, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) { - glBlitFramebufferEXTPROC glBlitFramebufferEXT = (glBlitFramebufferEXTPROC)tlsGetFunction(1731); - UNUSED_PARAM(clazz) - glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferBlitLayers.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferBlitLayers.c deleted file mode 100644 index 99eca8e8..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferBlitLayers.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlitFramebufferLayersEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glBlitFramebufferLayerEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferBlitLayers_glBlitFramebufferLayersEXT(JNIEnv *__env, jclass clazz, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) { - glBlitFramebufferLayersEXTPROC glBlitFramebufferLayersEXT = (glBlitFramebufferLayersEXTPROC)tlsGetFunction(1732); - UNUSED_PARAM(clazz) - glBlitFramebufferLayersEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferBlitLayers_glBlitFramebufferLayerEXT(JNIEnv *__env, jclass clazz, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint srcLayer, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint dstLayer, jint mask, jint filter) { - glBlitFramebufferLayerEXTPROC glBlitFramebufferLayerEXT = (glBlitFramebufferLayerEXTPROC)tlsGetFunction(1733); - UNUSED_PARAM(clazz) - glBlitFramebufferLayerEXT(srcX0, srcY0, srcX1, srcY1, srcLayer, dstX0, dstY0, dstX1, dstY1, dstLayer, mask, filter); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferMultisample.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferMultisample.c deleted file mode 100644 index 2d272c9e..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferMultisample.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glRenderbufferStorageMultisampleEXTPROC) (jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferMultisample_glRenderbufferStorageMultisampleEXT(JNIEnv *__env, jclass clazz, jint target, jint samples, jint internalformat, jint width, jint height) { - glRenderbufferStorageMultisampleEXTPROC glRenderbufferStorageMultisampleEXT = (glRenderbufferStorageMultisampleEXTPROC)tlsGetFunction(1734); - UNUSED_PARAM(clazz) - glRenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferObject.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferObject.c deleted file mode 100644 index 44ff13eb..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTFramebufferObject.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jboolean (APIENTRY *glIsRenderbufferEXTPROC) (jint); -typedef void (APIENTRY *glBindRenderbufferEXTPROC) (jint, jint); -typedef void (APIENTRY *glDeleteRenderbuffersEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenRenderbuffersEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glRenderbufferStorageEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glGetRenderbufferParameterivEXTPROC) (jint, jint, uintptr_t); -typedef jboolean (APIENTRY *glIsFramebufferEXTPROC) (jint); -typedef void (APIENTRY *glBindFramebufferEXTPROC) (jint, jint); -typedef void (APIENTRY *glDeleteFramebuffersEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenFramebuffersEXTPROC) (jint, uintptr_t); -typedef jint (APIENTRY *glCheckFramebufferStatusEXTPROC) (jint); -typedef void (APIENTRY *glFramebufferTexture1DEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferTexture2DEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferTexture3DEXTPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferRenderbufferEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glGetFramebufferAttachmentParameterivEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGenerateMipmapEXTPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glIsRenderbufferEXT(JNIEnv *__env, jclass clazz, jint renderbuffer) { - glIsRenderbufferEXTPROC glIsRenderbufferEXT = (glIsRenderbufferEXTPROC)tlsGetFunction(1735); - UNUSED_PARAM(clazz) - return glIsRenderbufferEXT(renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glBindRenderbufferEXT(JNIEnv *__env, jclass clazz, jint target, jint renderbuffer) { - glBindRenderbufferEXTPROC glBindRenderbufferEXT = (glBindRenderbufferEXTPROC)tlsGetFunction(1736); - UNUSED_PARAM(clazz) - glBindRenderbufferEXT(target, renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_nglDeleteRenderbuffersEXT__IJ(JNIEnv *__env, jclass clazz, jint n, jlong renderbuffersAddress) { - glDeleteRenderbuffersEXTPROC glDeleteRenderbuffersEXT = (glDeleteRenderbuffersEXTPROC)tlsGetFunction(1737); - uintptr_t renderbuffers = (uintptr_t)renderbuffersAddress; - UNUSED_PARAM(clazz) - glDeleteRenderbuffersEXT(n, renderbuffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_nglGenRenderbuffersEXT__IJ(JNIEnv *__env, jclass clazz, jint n, jlong renderbuffersAddress) { - glGenRenderbuffersEXTPROC glGenRenderbuffersEXT = (glGenRenderbuffersEXTPROC)tlsGetFunction(1738); - uintptr_t renderbuffers = (uintptr_t)renderbuffersAddress; - UNUSED_PARAM(clazz) - glGenRenderbuffersEXT(n, renderbuffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glRenderbufferStorageEXT(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint width, jint height) { - glRenderbufferStorageEXTPROC glRenderbufferStorageEXT = (glRenderbufferStorageEXTPROC)tlsGetFunction(1739); - UNUSED_PARAM(clazz) - glRenderbufferStorageEXT(target, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_nglGetRenderbufferParameterivEXT__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetRenderbufferParameterivEXTPROC glGetRenderbufferParameterivEXT = (glGetRenderbufferParameterivEXTPROC)tlsGetFunction(1740); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetRenderbufferParameterivEXT(target, pname, params); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glIsFramebufferEXT(JNIEnv *__env, jclass clazz, jint framebuffer) { - glIsFramebufferEXTPROC glIsFramebufferEXT = (glIsFramebufferEXTPROC)tlsGetFunction(1741); - UNUSED_PARAM(clazz) - return glIsFramebufferEXT(framebuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glBindFramebufferEXT(JNIEnv *__env, jclass clazz, jint target, jint framebuffer) { - glBindFramebufferEXTPROC glBindFramebufferEXT = (glBindFramebufferEXTPROC)tlsGetFunction(1742); - UNUSED_PARAM(clazz) - glBindFramebufferEXT(target, framebuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_nglDeleteFramebuffersEXT__IJ(JNIEnv *__env, jclass clazz, jint n, jlong framebuffersAddress) { - glDeleteFramebuffersEXTPROC glDeleteFramebuffersEXT = (glDeleteFramebuffersEXTPROC)tlsGetFunction(1743); - uintptr_t framebuffers = (uintptr_t)framebuffersAddress; - UNUSED_PARAM(clazz) - glDeleteFramebuffersEXT(n, framebuffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_nglGenFramebuffersEXT__IJ(JNIEnv *__env, jclass clazz, jint n, jlong framebuffersAddress) { - glGenFramebuffersEXTPROC glGenFramebuffersEXT = (glGenFramebuffersEXTPROC)tlsGetFunction(1744); - uintptr_t framebuffers = (uintptr_t)framebuffersAddress; - UNUSED_PARAM(clazz) - glGenFramebuffersEXT(n, framebuffers); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glCheckFramebufferStatusEXT(JNIEnv *__env, jclass clazz, jint target) { - glCheckFramebufferStatusEXTPROC glCheckFramebufferStatusEXT = (glCheckFramebufferStatusEXTPROC)tlsGetFunction(1745); - UNUSED_PARAM(clazz) - return glCheckFramebufferStatusEXT(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glFramebufferTexture1DEXT(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint textarget, jint texture, jint level) { - glFramebufferTexture1DEXTPROC glFramebufferTexture1DEXT = (glFramebufferTexture1DEXTPROC)tlsGetFunction(1746); - UNUSED_PARAM(clazz) - glFramebufferTexture1DEXT(target, attachment, textarget, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glFramebufferTexture2DEXT(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint textarget, jint texture, jint level) { - glFramebufferTexture2DEXTPROC glFramebufferTexture2DEXT = (glFramebufferTexture2DEXTPROC)tlsGetFunction(1747); - UNUSED_PARAM(clazz) - glFramebufferTexture2DEXT(target, attachment, textarget, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glFramebufferTexture3DEXT(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint textarget, jint texture, jint level, jint zoffset) { - glFramebufferTexture3DEXTPROC glFramebufferTexture3DEXT = (glFramebufferTexture3DEXTPROC)tlsGetFunction(1748); - UNUSED_PARAM(clazz) - glFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glFramebufferRenderbufferEXT(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { - glFramebufferRenderbufferEXTPROC glFramebufferRenderbufferEXT = (glFramebufferRenderbufferEXTPROC)tlsGetFunction(1749); - UNUSED_PARAM(clazz) - glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_nglGetFramebufferAttachmentParameterivEXT__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint pname, jlong paramsAddress) { - glGetFramebufferAttachmentParameterivEXTPROC glGetFramebufferAttachmentParameterivEXT = (glGetFramebufferAttachmentParameterivEXTPROC)tlsGetFunction(1750); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetFramebufferAttachmentParameterivEXT(target, attachment, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTFramebufferObject_glGenerateMipmapEXT(JNIEnv *__env, jclass clazz, jint target) { - glGenerateMipmapEXTPROC glGenerateMipmapEXT = (glGenerateMipmapEXTPROC)tlsGetFunction(1751); - UNUSED_PARAM(clazz) - glGenerateMipmapEXT(target); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGPUProgramParameters.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGPUProgramParameters.c deleted file mode 100644 index 84826d0e..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGPUProgramParameters.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glProgramEnvParameters4fvEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramLocalParameters4fvEXTPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUProgramParameters_nglProgramEnvParameters4fvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jint count, jlong paramsAddress) { - glProgramEnvParameters4fvEXTPROC glProgramEnvParameters4fvEXT = (glProgramEnvParameters4fvEXTPROC)tlsGetFunction(1756); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glProgramEnvParameters4fvEXT(target, index, count, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUProgramParameters_nglProgramLocalParameters4fvEXT__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jint count, jlong paramsAddress) { - glProgramLocalParameters4fvEXTPROC glProgramLocalParameters4fvEXT = (glProgramLocalParameters4fvEXTPROC)tlsGetFunction(1757); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glProgramLocalParameters4fvEXT(target, index, count, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGPUShader4.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGPUShader4.c deleted file mode 100644 index 42869799..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGPUShader4.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexAttribI1iEXTPROC) (jint, jint); -typedef void (APIENTRY *glVertexAttribI2iEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI3iEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI4iEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI1uiEXTPROC) (jint, jint); -typedef void (APIENTRY *glVertexAttribI2uiEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI3uiEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI4uiEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI1ivEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI2ivEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI3ivEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4ivEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI1uivEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI2uivEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI3uivEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4uivEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4bvEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4svEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4ubvEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4usvEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribIPointerEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribIivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribIuivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformuivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glBindFragDataLocationEXTPROC) (jint, jint, uintptr_t); -typedef jint (APIENTRY *glGetFragDataLocationEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glUniform1uiEXTPROC) (jint, jint); -typedef void (APIENTRY *glUniform2uiEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glUniform3uiEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glUniform4uiEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glUniform1uivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2uivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3uivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4uivEXTPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glVertexAttribI1iEXT(JNIEnv *__env, jclass clazz, jint index, jint x) { - glVertexAttribI1iEXTPROC glVertexAttribI1iEXT = (glVertexAttribI1iEXTPROC)tlsGetFunction(1758); - UNUSED_PARAM(clazz) - glVertexAttribI1iEXT(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glVertexAttribI2iEXT(JNIEnv *__env, jclass clazz, jint index, jint x, jint y) { - glVertexAttribI2iEXTPROC glVertexAttribI2iEXT = (glVertexAttribI2iEXTPROC)tlsGetFunction(1759); - UNUSED_PARAM(clazz) - glVertexAttribI2iEXT(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glVertexAttribI3iEXT(JNIEnv *__env, jclass clazz, jint index, jint x, jint y, jint z) { - glVertexAttribI3iEXTPROC glVertexAttribI3iEXT = (glVertexAttribI3iEXTPROC)tlsGetFunction(1760); - UNUSED_PARAM(clazz) - glVertexAttribI3iEXT(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glVertexAttribI4iEXT(JNIEnv *__env, jclass clazz, jint index, jint x, jint y, jint z, jint w) { - glVertexAttribI4iEXTPROC glVertexAttribI4iEXT = (glVertexAttribI4iEXTPROC)tlsGetFunction(1761); - UNUSED_PARAM(clazz) - glVertexAttribI4iEXT(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glVertexAttribI1uiEXT(JNIEnv *__env, jclass clazz, jint index, jint x) { - glVertexAttribI1uiEXTPROC glVertexAttribI1uiEXT = (glVertexAttribI1uiEXTPROC)tlsGetFunction(1762); - UNUSED_PARAM(clazz) - glVertexAttribI1uiEXT(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glVertexAttribI2uiEXT(JNIEnv *__env, jclass clazz, jint index, jint x, jint y) { - glVertexAttribI2uiEXTPROC glVertexAttribI2uiEXT = (glVertexAttribI2uiEXTPROC)tlsGetFunction(1763); - UNUSED_PARAM(clazz) - glVertexAttribI2uiEXT(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glVertexAttribI3uiEXT(JNIEnv *__env, jclass clazz, jint index, jint x, jint y, jint z) { - glVertexAttribI3uiEXTPROC glVertexAttribI3uiEXT = (glVertexAttribI3uiEXTPROC)tlsGetFunction(1764); - UNUSED_PARAM(clazz) - glVertexAttribI3uiEXT(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glVertexAttribI4uiEXT(JNIEnv *__env, jclass clazz, jint index, jint x, jint y, jint z, jint w) { - glVertexAttribI4uiEXTPROC glVertexAttribI4uiEXT = (glVertexAttribI4uiEXTPROC)tlsGetFunction(1765); - UNUSED_PARAM(clazz) - glVertexAttribI4uiEXT(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI1ivEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI1ivEXTPROC glVertexAttribI1ivEXT = (glVertexAttribI1ivEXTPROC)tlsGetFunction(1766); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI1ivEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI2ivEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI2ivEXTPROC glVertexAttribI2ivEXT = (glVertexAttribI2ivEXTPROC)tlsGetFunction(1767); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI2ivEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI3ivEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI3ivEXTPROC glVertexAttribI3ivEXT = (glVertexAttribI3ivEXTPROC)tlsGetFunction(1768); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI3ivEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI4ivEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4ivEXTPROC glVertexAttribI4ivEXT = (glVertexAttribI4ivEXTPROC)tlsGetFunction(1769); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4ivEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI1uivEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI1uivEXTPROC glVertexAttribI1uivEXT = (glVertexAttribI1uivEXTPROC)tlsGetFunction(1770); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI1uivEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI2uivEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI2uivEXTPROC glVertexAttribI2uivEXT = (glVertexAttribI2uivEXTPROC)tlsGetFunction(1771); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI2uivEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI3uivEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI3uivEXTPROC glVertexAttribI3uivEXT = (glVertexAttribI3uivEXTPROC)tlsGetFunction(1772); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI3uivEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI4uivEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4uivEXTPROC glVertexAttribI4uivEXT = (glVertexAttribI4uivEXTPROC)tlsGetFunction(1773); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4uivEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI4bvEXT(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4bvEXTPROC glVertexAttribI4bvEXT = (glVertexAttribI4bvEXTPROC)tlsGetFunction(1774); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4bvEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI4svEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4svEXTPROC glVertexAttribI4svEXT = (glVertexAttribI4svEXTPROC)tlsGetFunction(1775); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4svEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI4ubvEXT(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4ubvEXTPROC glVertexAttribI4ubvEXT = (glVertexAttribI4ubvEXTPROC)tlsGetFunction(1776); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4ubvEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribI4usvEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4usvEXTPROC glVertexAttribI4usvEXT = (glVertexAttribI4usvEXTPROC)tlsGetFunction(1777); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4usvEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglVertexAttribIPointerEXT__IIIIJ(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jint stride, jlong pointerAddress) { - glVertexAttribIPointerEXTPROC glVertexAttribIPointerEXT = (glVertexAttribIPointerEXTPROC)tlsGetFunction(1778); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glVertexAttribIPointerEXT(index, size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglGetVertexAttribIivEXT__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribIivEXTPROC glGetVertexAttribIivEXT = (glGetVertexAttribIivEXTPROC)tlsGetFunction(1779); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribIivEXT(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglGetVertexAttribIuivEXT__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribIuivEXTPROC glGetVertexAttribIuivEXT = (glGetVertexAttribIuivEXTPROC)tlsGetFunction(1780); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribIuivEXT(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglGetUniformuivEXT__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformuivEXTPROC glGetUniformuivEXT = (glGetUniformuivEXTPROC)tlsGetFunction(1781); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformuivEXT(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglBindFragDataLocationEXT(JNIEnv *__env, jclass clazz, jint program, jint color, jlong nameAddress) { - glBindFragDataLocationEXTPROC glBindFragDataLocationEXT = (glBindFragDataLocationEXTPROC)tlsGetFunction(1782); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glBindFragDataLocationEXT(program, color, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglGetFragDataLocationEXT(JNIEnv *__env, jclass clazz, jint program, jlong nameAddress) { - glGetFragDataLocationEXTPROC glGetFragDataLocationEXT = (glGetFragDataLocationEXTPROC)tlsGetFunction(1783); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetFragDataLocationEXT(program, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glUniform1uiEXT(JNIEnv *__env, jclass clazz, jint location, jint v0) { - glUniform1uiEXTPROC glUniform1uiEXT = (glUniform1uiEXTPROC)tlsGetFunction(1784); - UNUSED_PARAM(clazz) - glUniform1uiEXT(location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glUniform2uiEXT(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1) { - glUniform2uiEXTPROC glUniform2uiEXT = (glUniform2uiEXTPROC)tlsGetFunction(1785); - UNUSED_PARAM(clazz) - glUniform2uiEXT(location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glUniform3uiEXT(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1, jint v2) { - glUniform3uiEXTPROC glUniform3uiEXT = (glUniform3uiEXTPROC)tlsGetFunction(1786); - UNUSED_PARAM(clazz) - glUniform3uiEXT(location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_glUniform4uiEXT(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1, jint v2, jint v3) { - glUniform4uiEXTPROC glUniform4uiEXT = (glUniform4uiEXTPROC)tlsGetFunction(1787); - UNUSED_PARAM(clazz) - glUniform4uiEXT(location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglUniform1uivEXT__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1uivEXTPROC glUniform1uivEXT = (glUniform1uivEXTPROC)tlsGetFunction(1788); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1uivEXT(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglUniform2uivEXT__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2uivEXTPROC glUniform2uivEXT = (glUniform2uivEXTPROC)tlsGetFunction(1789); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2uivEXT(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglUniform3uivEXT__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3uivEXTPROC glUniform3uivEXT = (glUniform3uivEXTPROC)tlsGetFunction(1790); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3uivEXT(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGPUShader4_nglUniform4uivEXT__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4uivEXTPROC glUniform4uivEXT = (glUniform4uivEXTPROC)tlsGetFunction(1791); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4uivEXT(location, count, value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGeometryShader4.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGeometryShader4.c deleted file mode 100644 index 062916e7..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTGeometryShader4.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glProgramParameteriEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glFramebufferTextureEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferTextureFaceEXTPROC) (jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGeometryShader4_glProgramParameteriEXT(JNIEnv *__env, jclass clazz, jint program, jint pname, jint value) { - glProgramParameteriEXTPROC glProgramParameteriEXT = (glProgramParameteriEXTPROC)tlsGetFunction(1752); - UNUSED_PARAM(clazz) - glProgramParameteriEXT(program, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGeometryShader4_glFramebufferTextureEXT(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level) { - glFramebufferTextureEXTPROC glFramebufferTextureEXT = (glFramebufferTextureEXTPROC)tlsGetFunction(1753); - UNUSED_PARAM(clazz) - glFramebufferTextureEXT(target, attachment, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTGeometryShader4_glFramebufferTextureFaceEXT(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level, jint face) { - glFramebufferTextureFaceEXTPROC glFramebufferTextureFaceEXT = (glFramebufferTextureFaceEXTPROC)tlsGetFunction(1755); - UNUSED_PARAM(clazz) - glFramebufferTextureFaceEXT(target, attachment, texture, level, face); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObject.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObject.c deleted file mode 100644 index 0f71840f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObject.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetUnsignedBytevEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetUnsignedBytei_vEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glDeleteMemoryObjectsEXTPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsMemoryObjectEXTPROC) (jint); -typedef void (APIENTRY *glCreateMemoryObjectsEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMemoryObjectParameterivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMemoryObjectParameterivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexStorageMem2DEXTPROC) (jint, jint, jint, jint, jint, jint, jlong); -typedef void (APIENTRY *glTexStorageMem2DMultisampleEXTPROC) (jint, jint, jint, jint, jint, jboolean, jint, jlong); -typedef void (APIENTRY *glTexStorageMem3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jlong); -typedef void (APIENTRY *glTexStorageMem3DMultisampleEXTPROC) (jint, jint, jint, jint, jint, jint, jboolean, jint, jlong); -typedef void (APIENTRY *glBufferStorageMemEXTPROC) (jint, uintptr_t, jint, jlong); -typedef void (APIENTRY *glTextureStorageMem2DEXTPROC) (jint, jint, jint, jint, jint, jint, jlong); -typedef void (APIENTRY *glTextureStorageMem2DMultisampleEXTPROC) (jint, jint, jint, jint, jint, jboolean, jint, jlong); -typedef void (APIENTRY *glTextureStorageMem3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint, jlong); -typedef void (APIENTRY *glTextureStorageMem3DMultisampleEXTPROC) (jint, jint, jint, jint, jint, jint, jboolean, jint, jlong); -typedef void (APIENTRY *glNamedBufferStorageMemEXTPROC) (jint, uintptr_t, jint, jlong); -typedef void (APIENTRY *glTexStorageMem1DEXTPROC) (jint, jint, jint, jint, jint, jlong); -typedef void (APIENTRY *glTextureStorageMem1DEXTPROC) (jint, jint, jint, jint, jint, jlong); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_nglGetUnsignedBytevEXT(JNIEnv *__env, jclass clazz, jint pname, jlong dataAddress) { - glGetUnsignedBytevEXTPROC glGetUnsignedBytevEXT = (glGetUnsignedBytevEXTPROC)tlsGetFunction(1792); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetUnsignedBytevEXT(pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_nglGetUnsignedBytei_1vEXT(JNIEnv *__env, jclass clazz, jint target, jint index, jlong dataAddress) { - glGetUnsignedBytei_vEXTPROC glGetUnsignedBytei_vEXT = (glGetUnsignedBytei_vEXTPROC)tlsGetFunction(1793); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetUnsignedBytei_vEXT(target, index, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_nglDeleteMemoryObjectsEXT__IJ(JNIEnv *__env, jclass clazz, jint n, jlong memoryObjectsAddress) { - glDeleteMemoryObjectsEXTPROC glDeleteMemoryObjectsEXT = (glDeleteMemoryObjectsEXTPROC)tlsGetFunction(1794); - uintptr_t memoryObjects = (uintptr_t)memoryObjectsAddress; - UNUSED_PARAM(clazz) - glDeleteMemoryObjectsEXT(n, memoryObjects); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glIsMemoryObjectEXT(JNIEnv *__env, jclass clazz, jint memoryObject) { - glIsMemoryObjectEXTPROC glIsMemoryObjectEXT = (glIsMemoryObjectEXTPROC)tlsGetFunction(1795); - UNUSED_PARAM(clazz) - return glIsMemoryObjectEXT(memoryObject); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_nglCreateMemoryObjectsEXT__IJ(JNIEnv *__env, jclass clazz, jint n, jlong memoryObjectsAddress) { - glCreateMemoryObjectsEXTPROC glCreateMemoryObjectsEXT = (glCreateMemoryObjectsEXTPROC)tlsGetFunction(1796); - uintptr_t memoryObjects = (uintptr_t)memoryObjectsAddress; - UNUSED_PARAM(clazz) - glCreateMemoryObjectsEXT(n, memoryObjects); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_nglMemoryObjectParameterivEXT__IIJ(JNIEnv *__env, jclass clazz, jint memoryObject, jint pname, jlong paramsAddress) { - glMemoryObjectParameterivEXTPROC glMemoryObjectParameterivEXT = (glMemoryObjectParameterivEXTPROC)tlsGetFunction(1797); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMemoryObjectParameterivEXT(memoryObject, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_nglGetMemoryObjectParameterivEXT__IIJ(JNIEnv *__env, jclass clazz, jint memoryObject, jint pname, jlong paramsAddress) { - glGetMemoryObjectParameterivEXTPROC glGetMemoryObjectParameterivEXT = (glGetMemoryObjectParameterivEXTPROC)tlsGetFunction(1798); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMemoryObjectParameterivEXT(memoryObject, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTexStorageMem2DEXT(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalFormat, jint width, jint height, jint memory, jlong offset) { - glTexStorageMem2DEXTPROC glTexStorageMem2DEXT = (glTexStorageMem2DEXTPROC)tlsGetFunction(1799); - UNUSED_PARAM(clazz) - glTexStorageMem2DEXT(target, levels, internalFormat, width, height, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTexStorageMem2DMultisampleEXT(JNIEnv *__env, jclass clazz, jint target, jint samples, jint internalFormat, jint width, jint height, jboolean fixedSampleLocations, jint memory, jlong offset) { - glTexStorageMem2DMultisampleEXTPROC glTexStorageMem2DMultisampleEXT = (glTexStorageMem2DMultisampleEXTPROC)tlsGetFunction(1800); - UNUSED_PARAM(clazz) - glTexStorageMem2DMultisampleEXT(target, samples, internalFormat, width, height, fixedSampleLocations, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTexStorageMem3DEXT(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalFormat, jint width, jint height, jint depth, jint memory, jlong offset) { - glTexStorageMem3DEXTPROC glTexStorageMem3DEXT = (glTexStorageMem3DEXTPROC)tlsGetFunction(1801); - UNUSED_PARAM(clazz) - glTexStorageMem3DEXT(target, levels, internalFormat, width, height, depth, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTexStorageMem3DMultisampleEXT(JNIEnv *__env, jclass clazz, jint target, jint samples, jint internalFormat, jint width, jint height, jint depth, jboolean fixedSampleLocations, jint memory, jlong offset) { - glTexStorageMem3DMultisampleEXTPROC glTexStorageMem3DMultisampleEXT = (glTexStorageMem3DMultisampleEXTPROC)tlsGetFunction(1802); - UNUSED_PARAM(clazz) - glTexStorageMem3DMultisampleEXT(target, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glBufferStorageMemEXT(JNIEnv *__env, jclass clazz, jint target, jlong size, jint memory, jlong offset) { - glBufferStorageMemEXTPROC glBufferStorageMemEXT = (glBufferStorageMemEXTPROC)tlsGetFunction(1803); - UNUSED_PARAM(clazz) - glBufferStorageMemEXT(target, (uintptr_t)size, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTextureStorageMem2DEXT(JNIEnv *__env, jclass clazz, jint texture, jint levels, jint internalFormat, jint width, jint height, jint memory, jlong offset) { - glTextureStorageMem2DEXTPROC glTextureStorageMem2DEXT = (glTextureStorageMem2DEXTPROC)tlsGetFunction(1804); - UNUSED_PARAM(clazz) - glTextureStorageMem2DEXT(texture, levels, internalFormat, width, height, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTextureStorageMem2DMultisampleEXT(JNIEnv *__env, jclass clazz, jint texture, jint samples, jint internalFormat, jint width, jint height, jboolean fixedSampleLocations, jint memory, jlong offset) { - glTextureStorageMem2DMultisampleEXTPROC glTextureStorageMem2DMultisampleEXT = (glTextureStorageMem2DMultisampleEXTPROC)tlsGetFunction(1805); - UNUSED_PARAM(clazz) - glTextureStorageMem2DMultisampleEXT(texture, samples, internalFormat, width, height, fixedSampleLocations, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTextureStorageMem3DEXT(JNIEnv *__env, jclass clazz, jint texture, jint levels, jint internalFormat, jint width, jint height, jint depth, jint memory, jlong offset) { - glTextureStorageMem3DEXTPROC glTextureStorageMem3DEXT = (glTextureStorageMem3DEXTPROC)tlsGetFunction(1806); - UNUSED_PARAM(clazz) - glTextureStorageMem3DEXT(texture, levels, internalFormat, width, height, depth, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTextureStorageMem3DMultisampleEXT(JNIEnv *__env, jclass clazz, jint texture, jint samples, jint internalFormat, jint width, jint height, jint depth, jboolean fixedSampleLocations, jint memory, jlong offset) { - glTextureStorageMem3DMultisampleEXTPROC glTextureStorageMem3DMultisampleEXT = (glTextureStorageMem3DMultisampleEXTPROC)tlsGetFunction(1807); - UNUSED_PARAM(clazz) - glTextureStorageMem3DMultisampleEXT(texture, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glNamedBufferStorageMemEXT(JNIEnv *__env, jclass clazz, jint buffer, jlong size, jint memory, jlong offset) { - glNamedBufferStorageMemEXTPROC glNamedBufferStorageMemEXT = (glNamedBufferStorageMemEXTPROC)tlsGetFunction(1808); - UNUSED_PARAM(clazz) - glNamedBufferStorageMemEXT(buffer, (uintptr_t)size, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTexStorageMem1DEXT(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalFormat, jint width, jint memory, jlong offset) { - glTexStorageMem1DEXTPROC glTexStorageMem1DEXT = (glTexStorageMem1DEXTPROC)tlsGetFunction(1809); - UNUSED_PARAM(clazz) - glTexStorageMem1DEXT(target, levels, internalFormat, width, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObject_glTextureStorageMem1DEXT(JNIEnv *__env, jclass clazz, jint texture, jint levels, jint internalFormat, jint width, jint memory, jlong offset) { - glTextureStorageMem1DEXTPROC glTextureStorageMem1DEXT = (glTextureStorageMem1DEXTPROC)tlsGetFunction(1810); - UNUSED_PARAM(clazz) - glTextureStorageMem1DEXT(texture, levels, internalFormat, width, memory, offset); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObjectFD.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObjectFD.c deleted file mode 100644 index f5eeb1b8..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObjectFD.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glImportMemoryFdEXTPROC) (jint, jlong, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObjectFD_glImportMemoryFdEXT(JNIEnv *__env, jclass clazz, jint memory, jlong size, jint handleType, jint fd) { - glImportMemoryFdEXTPROC glImportMemoryFdEXT = (glImportMemoryFdEXTPROC)tlsGetFunction(1811); - UNUSED_PARAM(clazz) - glImportMemoryFdEXT(memory, size, handleType, fd); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObjectWin32.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObjectWin32.c deleted file mode 100644 index d9e84be3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTMemoryObjectWin32.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glImportMemoryWin32HandleEXTPROC) (jint, jlong, jint, uintptr_t); -typedef void (APIENTRY *glImportMemoryWin32NameEXTPROC) (jint, jlong, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObjectWin32_nglImportMemoryWin32HandleEXT(JNIEnv *__env, jclass clazz, jint memory, jlong size, jint handleType, jlong handleAddress) { - glImportMemoryWin32HandleEXTPROC glImportMemoryWin32HandleEXT = (glImportMemoryWin32HandleEXTPROC)tlsGetFunction(1812); - uintptr_t handle = (uintptr_t)handleAddress; - UNUSED_PARAM(clazz) - glImportMemoryWin32HandleEXT(memory, size, handleType, handle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTMemoryObjectWin32_nglImportMemoryWin32NameEXT(JNIEnv *__env, jclass clazz, jint memory, jlong size, jint handleType, jlong nameAddress) { - glImportMemoryWin32NameEXTPROC glImportMemoryWin32NameEXT = (glImportMemoryWin32NameEXTPROC)tlsGetFunction(1813); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glImportMemoryWin32NameEXT(memory, size, handleType, name); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTPointParameters.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTPointParameters.c deleted file mode 100644 index 20dcf35a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTPointParameters.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glPointParameterfEXTPROC) (jint, jfloat); -typedef void (APIENTRY *glPointParameterfvEXTPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTPointParameters_glPointParameterfEXT(JNIEnv *__env, jclass clazz, jint pname, jfloat param) { - glPointParameterfEXTPROC glPointParameterfEXT = (glPointParameterfEXTPROC)tlsGetFunction(1814); - UNUSED_PARAM(clazz) - glPointParameterfEXT(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTPointParameters_nglPointParameterfvEXT__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glPointParameterfvEXTPROC glPointParameterfvEXT = (glPointParameterfvEXTPROC)tlsGetFunction(1815); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glPointParameterfvEXT(pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTPolygonOffsetClamp.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTPolygonOffsetClamp.c deleted file mode 100644 index d6299e31..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTPolygonOffsetClamp.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glPolygonOffsetClampEXTPROC) (jfloat, jfloat, jfloat); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTPolygonOffsetClamp_glPolygonOffsetClampEXT(JNIEnv *__env, jclass clazz, jfloat factor, jfloat units, jfloat clamp) { - glPolygonOffsetClampEXTPROC glPolygonOffsetClampEXT = (glPolygonOffsetClampEXTPROC)tlsGetFunction(1816); - UNUSED_PARAM(clazz) - glPolygonOffsetClampEXT(factor, units, clamp); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTProvokingVertex.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTProvokingVertex.c deleted file mode 100644 index 1519702b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTProvokingVertex.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glProvokingVertexEXTPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTProvokingVertex_glProvokingVertexEXT(JNIEnv *__env, jclass clazz, jint mode) { - glProvokingVertexEXTPROC glProvokingVertexEXT = (glProvokingVertexEXTPROC)tlsGetFunction(1817); - UNUSED_PARAM(clazz) - glProvokingVertexEXT(mode); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTRasterMultisample.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTRasterMultisample.c deleted file mode 100644 index 1121c025..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTRasterMultisample.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glRasterSamplesEXTPROC) (jint, jboolean); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTRasterMultisample_glRasterSamplesEXT(JNIEnv *__env, jclass clazz, jint samples, jboolean fixedsamplelocations) { - glRasterSamplesEXTPROC glRasterSamplesEXT = (glRasterSamplesEXTPROC)tlsGetFunction(1818); - UNUSED_PARAM(clazz) - glRasterSamplesEXT(samples, fixedsamplelocations); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSecondaryColor.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSecondaryColor.c deleted file mode 100644 index c195d9f6..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSecondaryColor.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glSecondaryColor3bEXTPROC) (jbyte, jbyte, jbyte); -typedef void (APIENTRY *glSecondaryColor3sEXTPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glSecondaryColor3iEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glSecondaryColor3fEXTPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glSecondaryColor3dEXTPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glSecondaryColor3ubEXTPROC) (uint8_t, uint8_t, uint8_t); -typedef void (APIENTRY *glSecondaryColor3usEXTPROC) (uint16_t, uint16_t, uint16_t); -typedef void (APIENTRY *glSecondaryColor3uiEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glSecondaryColor3bvEXTPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3svEXTPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3ivEXTPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3fvEXTPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3dvEXTPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3ubvEXTPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3usvEXTPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3uivEXTPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColorPointerEXTPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_glSecondaryColor3bEXT(JNIEnv *__env, jclass clazz, jbyte red, jbyte green, jbyte blue) { - glSecondaryColor3bEXTPROC glSecondaryColor3bEXT = (glSecondaryColor3bEXTPROC)tlsGetFunction(1819); - UNUSED_PARAM(clazz) - glSecondaryColor3bEXT(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_glSecondaryColor3sEXT(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue) { - glSecondaryColor3sEXTPROC glSecondaryColor3sEXT = (glSecondaryColor3sEXTPROC)tlsGetFunction(1820); - UNUSED_PARAM(clazz) - glSecondaryColor3sEXT(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_glSecondaryColor3iEXT(JNIEnv *__env, jclass clazz, jint red, jint green, jint blue) { - glSecondaryColor3iEXTPROC glSecondaryColor3iEXT = (glSecondaryColor3iEXTPROC)tlsGetFunction(1821); - UNUSED_PARAM(clazz) - glSecondaryColor3iEXT(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_glSecondaryColor3fEXT(JNIEnv *__env, jclass clazz, jfloat red, jfloat green, jfloat blue) { - glSecondaryColor3fEXTPROC glSecondaryColor3fEXT = (glSecondaryColor3fEXTPROC)tlsGetFunction(1822); - UNUSED_PARAM(clazz) - glSecondaryColor3fEXT(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_glSecondaryColor3dEXT(JNIEnv *__env, jclass clazz, jdouble red, jdouble green, jdouble blue) { - glSecondaryColor3dEXTPROC glSecondaryColor3dEXT = (glSecondaryColor3dEXTPROC)tlsGetFunction(1823); - UNUSED_PARAM(clazz) - glSecondaryColor3dEXT(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_glSecondaryColor3ubEXT(JNIEnv *__env, jclass clazz, jbyte red, jbyte green, jbyte blue) { - glSecondaryColor3ubEXTPROC glSecondaryColor3ubEXT = (glSecondaryColor3ubEXTPROC)tlsGetFunction(1824); - UNUSED_PARAM(clazz) - glSecondaryColor3ubEXT((uint8_t)red, (uint8_t)green, (uint8_t)blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_glSecondaryColor3usEXT(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue) { - glSecondaryColor3usEXTPROC glSecondaryColor3usEXT = (glSecondaryColor3usEXTPROC)tlsGetFunction(1825); - UNUSED_PARAM(clazz) - glSecondaryColor3usEXT((uint16_t)red, (uint16_t)green, (uint16_t)blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_glSecondaryColor3uiEXT(JNIEnv *__env, jclass clazz, jint red, jint green, jint blue) { - glSecondaryColor3uiEXTPROC glSecondaryColor3uiEXT = (glSecondaryColor3uiEXTPROC)tlsGetFunction(1826); - UNUSED_PARAM(clazz) - glSecondaryColor3uiEXT(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColor3bvEXT(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3bvEXTPROC glSecondaryColor3bvEXT = (glSecondaryColor3bvEXTPROC)tlsGetFunction(1827); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3bvEXT(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColor3svEXT__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3svEXTPROC glSecondaryColor3svEXT = (glSecondaryColor3svEXTPROC)tlsGetFunction(1828); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3svEXT(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColor3ivEXT__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3ivEXTPROC glSecondaryColor3ivEXT = (glSecondaryColor3ivEXTPROC)tlsGetFunction(1829); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3ivEXT(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColor3fvEXT__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3fvEXTPROC glSecondaryColor3fvEXT = (glSecondaryColor3fvEXTPROC)tlsGetFunction(1830); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3fvEXT(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColor3dvEXT__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3dvEXTPROC glSecondaryColor3dvEXT = (glSecondaryColor3dvEXTPROC)tlsGetFunction(1831); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3dvEXT(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColor3ubvEXT(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3ubvEXTPROC glSecondaryColor3ubvEXT = (glSecondaryColor3ubvEXTPROC)tlsGetFunction(1832); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3ubvEXT(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColor3usvEXT__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3usvEXTPROC glSecondaryColor3usvEXT = (glSecondaryColor3usvEXTPROC)tlsGetFunction(1833); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3usvEXT(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColor3uivEXT__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3uivEXTPROC glSecondaryColor3uivEXT = (glSecondaryColor3uivEXTPROC)tlsGetFunction(1834); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3uivEXT(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSecondaryColor_nglSecondaryColorPointerEXT__IIIJ(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride, jlong pointerAddress) { - glSecondaryColorPointerEXTPROC glSecondaryColorPointerEXT = (glSecondaryColorPointerEXTPROC)tlsGetFunction(1835); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glSecondaryColorPointerEXT(size, type, stride, pointer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphore.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphore.c deleted file mode 100644 index ae60e914..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphore.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGenSemaphoresEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeleteSemaphoresEXTPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsSemaphoreEXTPROC) (jint); -typedef void (APIENTRY *glSemaphoreParameterui64vEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetSemaphoreParameterui64vEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glWaitSemaphoreEXTPROC) (jint, jint, uintptr_t, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glSignalSemaphoreEXTPROC) (jint, jint, uintptr_t, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphore_nglGenSemaphoresEXT__IJ(JNIEnv *__env, jclass clazz, jint n, jlong semaphoresAddress) { - glGenSemaphoresEXTPROC glGenSemaphoresEXT = (glGenSemaphoresEXTPROC)tlsGetFunction(1836); - uintptr_t semaphores = (uintptr_t)semaphoresAddress; - UNUSED_PARAM(clazz) - glGenSemaphoresEXT(n, semaphores); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphore_nglDeleteSemaphoresEXT__IJ(JNIEnv *__env, jclass clazz, jint n, jlong semaphoresAddress) { - glDeleteSemaphoresEXTPROC glDeleteSemaphoresEXT = (glDeleteSemaphoresEXTPROC)tlsGetFunction(1837); - uintptr_t semaphores = (uintptr_t)semaphoresAddress; - UNUSED_PARAM(clazz) - glDeleteSemaphoresEXT(n, semaphores); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_EXTSemaphore_glIsSemaphoreEXT(JNIEnv *__env, jclass clazz, jint semaphore) { - glIsSemaphoreEXTPROC glIsSemaphoreEXT = (glIsSemaphoreEXTPROC)tlsGetFunction(1838); - UNUSED_PARAM(clazz) - return glIsSemaphoreEXT(semaphore); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphore_nglSemaphoreParameterui64vEXT__IIJ(JNIEnv *__env, jclass clazz, jint semaphore, jint pname, jlong paramsAddress) { - glSemaphoreParameterui64vEXTPROC glSemaphoreParameterui64vEXT = (glSemaphoreParameterui64vEXTPROC)tlsGetFunction(1839); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glSemaphoreParameterui64vEXT(semaphore, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphore_nglGetSemaphoreParameterui64vEXT__IIJ(JNIEnv *__env, jclass clazz, jint semaphore, jint pname, jlong paramsAddress) { - glGetSemaphoreParameterui64vEXTPROC glGetSemaphoreParameterui64vEXT = (glGetSemaphoreParameterui64vEXTPROC)tlsGetFunction(1840); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetSemaphoreParameterui64vEXT(semaphore, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphore_nglWaitSemaphoreEXT__IIJIJJ(JNIEnv *__env, jclass clazz, jint semaphore, jint numBufferBarriers, jlong buffersAddress, jint numTextureBarriers, jlong texturesAddress, jlong srcLayoutsAddress) { - glWaitSemaphoreEXTPROC glWaitSemaphoreEXT = (glWaitSemaphoreEXTPROC)tlsGetFunction(1841); - uintptr_t buffers = (uintptr_t)buffersAddress; - uintptr_t textures = (uintptr_t)texturesAddress; - uintptr_t srcLayouts = (uintptr_t)srcLayoutsAddress; - UNUSED_PARAM(clazz) - glWaitSemaphoreEXT(semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, srcLayouts); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphore_nglSignalSemaphoreEXT__IIJIJJ(JNIEnv *__env, jclass clazz, jint semaphore, jint numBufferBarriers, jlong buffersAddress, jint numTextureBarriers, jlong texturesAddress, jlong dstLayoutsAddress) { - glSignalSemaphoreEXTPROC glSignalSemaphoreEXT = (glSignalSemaphoreEXTPROC)tlsGetFunction(1842); - uintptr_t buffers = (uintptr_t)buffersAddress; - uintptr_t textures = (uintptr_t)texturesAddress; - uintptr_t dstLayouts = (uintptr_t)dstLayoutsAddress; - UNUSED_PARAM(clazz) - glSignalSemaphoreEXT(semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, dstLayouts); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphoreFD.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphoreFD.c deleted file mode 100644 index 43dc20ae..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphoreFD.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glImportSemaphoreFdEXTPROC) (jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphoreFD_glImportSemaphoreFdEXT(JNIEnv *__env, jclass clazz, jint semaphore, jint handleType, jint fd) { - glImportSemaphoreFdEXTPROC glImportSemaphoreFdEXT = (glImportSemaphoreFdEXTPROC)tlsGetFunction(1843); - UNUSED_PARAM(clazz) - glImportSemaphoreFdEXT(semaphore, handleType, fd); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphoreWin32.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphoreWin32.c deleted file mode 100644 index f4582013..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSemaphoreWin32.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glImportSemaphoreWin32HandleEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glImportSemaphoreWin32NameEXTPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphoreWin32_nglImportSemaphoreWin32HandleEXT(JNIEnv *__env, jclass clazz, jint semaphore, jint handleType, jlong handleAddress) { - glImportSemaphoreWin32HandleEXTPROC glImportSemaphoreWin32HandleEXT = (glImportSemaphoreWin32HandleEXTPROC)tlsGetFunction(1844); - uintptr_t handle = (uintptr_t)handleAddress; - UNUSED_PARAM(clazz) - glImportSemaphoreWin32HandleEXT(semaphore, handleType, handle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSemaphoreWin32_nglImportSemaphoreWin32NameEXT(JNIEnv *__env, jclass clazz, jint semaphore, jint handleType, jlong nameAddress) { - glImportSemaphoreWin32NameEXTPROC glImportSemaphoreWin32NameEXT = (glImportSemaphoreWin32NameEXTPROC)tlsGetFunction(1845); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glImportSemaphoreWin32NameEXT(semaphore, handleType, name); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSeparateShaderObjects.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSeparateShaderObjects.c deleted file mode 100644 index 4cbd0949..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTSeparateShaderObjects.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glUseShaderProgramEXTPROC) (jint, jint); -typedef void (APIENTRY *glActiveProgramEXTPROC) (jint); -typedef jint (APIENTRY *glCreateShaderProgramEXTPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSeparateShaderObjects_glUseShaderProgramEXT(JNIEnv *__env, jclass clazz, jint type, jint program) { - glUseShaderProgramEXTPROC glUseShaderProgramEXT = (glUseShaderProgramEXTPROC)tlsGetFunction(1846); - UNUSED_PARAM(clazz) - glUseShaderProgramEXT(type, program); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTSeparateShaderObjects_glActiveProgramEXT(JNIEnv *__env, jclass clazz, jint program) { - glActiveProgramEXTPROC glActiveProgramEXT = (glActiveProgramEXTPROC)tlsGetFunction(1847); - UNUSED_PARAM(clazz) - glActiveProgramEXT(program); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_EXTSeparateShaderObjects_nglCreateShaderProgramEXT(JNIEnv *__env, jclass clazz, jint type, jlong stringAddress) { - glCreateShaderProgramEXTPROC glCreateShaderProgramEXT = (glCreateShaderProgramEXTPROC)tlsGetFunction(1848); - uintptr_t string = (uintptr_t)stringAddress; - UNUSED_PARAM(clazz) - return glCreateShaderProgramEXT(type, string); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTShaderFramebufferFetchNonCoherent.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTShaderFramebufferFetchNonCoherent.c deleted file mode 100644 index 1ed2f66f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTShaderFramebufferFetchNonCoherent.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFramebufferFetchBarrierEXTPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTShaderFramebufferFetchNonCoherent_glFramebufferFetchBarrierEXT(JNIEnv *__env, jclass clazz) { - glFramebufferFetchBarrierEXTPROC glFramebufferFetchBarrierEXT = (glFramebufferFetchBarrierEXTPROC)tlsGetFunction(1849); - UNUSED_PARAM(clazz) - glFramebufferFetchBarrierEXT(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTShaderImageLoadStore.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTShaderImageLoadStore.c deleted file mode 100644 index f978863a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTShaderImageLoadStore.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBindImageTextureEXTPROC) (jint, jint, jint, jboolean, jint, jint, jint); -typedef void (APIENTRY *glMemoryBarrierEXTPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTShaderImageLoadStore_glBindImageTextureEXT(JNIEnv *__env, jclass clazz, jint index, jint texture, jint level, jboolean layered, jint layer, jint access, jint format) { - glBindImageTextureEXTPROC glBindImageTextureEXT = (glBindImageTextureEXTPROC)tlsGetFunction(1850); - UNUSED_PARAM(clazz) - glBindImageTextureEXT(index, texture, level, layered, layer, access, format); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTShaderImageLoadStore_glMemoryBarrierEXT(JNIEnv *__env, jclass clazz, jint barriers) { - glMemoryBarrierEXTPROC glMemoryBarrierEXT = (glMemoryBarrierEXTPROC)tlsGetFunction(1851); - UNUSED_PARAM(clazz) - glMemoryBarrierEXT(barriers); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTStencilClearTag.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTStencilClearTag.c deleted file mode 100644 index 69cba70a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTStencilClearTag.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glStencilClearTagEXTPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTStencilClearTag_glStencilClearTagEXT(JNIEnv *__env, jclass clazz, jint stencilTagBits, jint stencilClearTag) { - glStencilClearTagEXTPROC glStencilClearTagEXT = (glStencilClearTagEXTPROC)tlsGetFunction(1852); - UNUSED_PARAM(clazz) - glStencilClearTagEXT(stencilTagBits, stencilClearTag); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTStencilTwoSide.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTStencilTwoSide.c deleted file mode 100644 index bace43a9..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTStencilTwoSide.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glActiveStencilFaceEXTPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTStencilTwoSide_glActiveStencilFaceEXT(JNIEnv *__env, jclass clazz, jint face) { - glActiveStencilFaceEXTPROC glActiveStencilFaceEXT = (glActiveStencilFaceEXTPROC)tlsGetFunction(1853); - UNUSED_PARAM(clazz) - glActiveStencilFaceEXT(face); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureArray.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureArray.c deleted file mode 100644 index fd56528c..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureArray.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFramebufferTextureLayerEXTPROC) (jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureArray_glFramebufferTextureLayerEXT(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level, jint layer) { - glFramebufferTextureLayerEXTPROC glFramebufferTextureLayerEXT = (glFramebufferTextureLayerEXTPROC)tlsGetFunction(1754); - UNUSED_PARAM(clazz) - glFramebufferTextureLayerEXT(target, attachment, texture, level, layer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureBufferObject.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureBufferObject.c deleted file mode 100644 index f968f591..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureBufferObject.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTexBufferEXTPROC) (jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureBufferObject_glTexBufferEXT(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint buffer) { - glTexBufferEXTPROC glTexBufferEXT = (glTexBufferEXTPROC)tlsGetFunction(1854); - UNUSED_PARAM(clazz) - glTexBufferEXT(target, internalformat, buffer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureInteger.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureInteger.c deleted file mode 100644 index 3bc70281..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureInteger.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glClearColorIiEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glClearColorIuiEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glTexParameterIivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexParameterIuivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexParameterIivEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexParameterIuivEXTPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureInteger_glClearColorIiEXT(JNIEnv *__env, jclass clazz, jint r, jint g, jint b, jint a) { - glClearColorIiEXTPROC glClearColorIiEXT = (glClearColorIiEXTPROC)tlsGetFunction(1855); - UNUSED_PARAM(clazz) - glClearColorIiEXT(r, g, b, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureInteger_glClearColorIuiEXT(JNIEnv *__env, jclass clazz, jint r, jint g, jint b, jint a) { - glClearColorIuiEXTPROC glClearColorIuiEXT = (glClearColorIuiEXTPROC)tlsGetFunction(1856); - UNUSED_PARAM(clazz) - glClearColorIuiEXT(r, g, b, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureInteger_nglTexParameterIivEXT__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glTexParameterIivEXTPROC glTexParameterIivEXT = (glTexParameterIivEXTPROC)tlsGetFunction(1857); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexParameterIivEXT(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureInteger_nglTexParameterIuivEXT__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glTexParameterIuivEXTPROC glTexParameterIuivEXT = (glTexParameterIuivEXTPROC)tlsGetFunction(1858); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexParameterIuivEXT(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureInteger_nglGetTexParameterIivEXT__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetTexParameterIivEXTPROC glGetTexParameterIivEXT = (glGetTexParameterIivEXTPROC)tlsGetFunction(1859); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTexParameterIivEXT(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureInteger_nglGetTexParameterIuivEXT__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetTexParameterIuivEXTPROC glGetTexParameterIuivEXT = (glGetTexParameterIuivEXTPROC)tlsGetFunction(1860); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTexParameterIuivEXT(target, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureStorage.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureStorage.c deleted file mode 100644 index b5ee8d61..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTextureStorage.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTexStorage1DEXTPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glTexStorage2DEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTexStorage3DEXTPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorage1DEXTPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorage2DEXTPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorage3DEXTPROC) (jint, jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureStorage_glTexStorage1DEXT(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalformat, jint width) { - glTexStorage1DEXTPROC glTexStorage1DEXT = (glTexStorage1DEXTPROC)tlsGetFunction(1861); - UNUSED_PARAM(clazz) - glTexStorage1DEXT(target, levels, internalformat, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureStorage_glTexStorage2DEXT(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalformat, jint width, jint height) { - glTexStorage2DEXTPROC glTexStorage2DEXT = (glTexStorage2DEXTPROC)tlsGetFunction(1862); - UNUSED_PARAM(clazz) - glTexStorage2DEXT(target, levels, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureStorage_glTexStorage3DEXT(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) { - glTexStorage3DEXTPROC glTexStorage3DEXT = (glTexStorage3DEXTPROC)tlsGetFunction(1863); - UNUSED_PARAM(clazz) - glTexStorage3DEXT(target, levels, internalformat, width, height, depth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureStorage_glTextureStorage1DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width) { - glTextureStorage1DEXTPROC glTextureStorage1DEXT = (glTextureStorage1DEXTPROC)tlsGetFunction(1374); - UNUSED_PARAM(clazz) - glTextureStorage1DEXT(texture, target, levels, internalformat, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureStorage_glTextureStorage2DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width, jint height) { - glTextureStorage2DEXTPROC glTextureStorage2DEXT = (glTextureStorage2DEXTPROC)tlsGetFunction(1375); - UNUSED_PARAM(clazz) - glTextureStorage2DEXT(texture, target, levels, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTextureStorage_glTextureStorage3DEXT(JNIEnv *__env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) { - glTextureStorage3DEXTPROC glTextureStorage3DEXT = (glTextureStorage3DEXTPROC)tlsGetFunction(1376); - UNUSED_PARAM(clazz) - glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTimerQuery.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTimerQuery.c deleted file mode 100644 index 5744adb5..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTimerQuery.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetQueryObjecti64vEXTPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryObjectui64vEXTPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTimerQuery_nglGetQueryObjecti64vEXT__IIJ(JNIEnv *__env, jclass clazz, jint id, jint pname, jlong paramsAddress) { - glGetQueryObjecti64vEXTPROC glGetQueryObjecti64vEXT = (glGetQueryObjecti64vEXTPROC)tlsGetFunction(1864); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryObjecti64vEXT(id, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTimerQuery_nglGetQueryObjectui64vEXT__IIJ(JNIEnv *__env, jclass clazz, jint id, jint pname, jlong paramsAddress) { - glGetQueryObjectui64vEXTPROC glGetQueryObjectui64vEXT = (glGetQueryObjectui64vEXTPROC)tlsGetFunction(1865); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryObjectui64vEXT(id, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTransformFeedback.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTransformFeedback.c deleted file mode 100644 index 02b2441e..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTTransformFeedback.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBindBufferRangeEXTPROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glBindBufferOffsetEXTPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glBindBufferBaseEXTPROC) (jint, jint, jint); -typedef void (APIENTRY *glBeginTransformFeedbackEXTPROC) (jint); -typedef void (APIENTRY *glEndTransformFeedbackEXTPROC) (void); -typedef void (APIENTRY *glTransformFeedbackVaryingsEXTPROC) (jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glGetTransformFeedbackVaryingEXTPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTransformFeedback_glBindBufferRangeEXT(JNIEnv *__env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong size) { - glBindBufferRangeEXTPROC glBindBufferRangeEXT = (glBindBufferRangeEXTPROC)tlsGetFunction(1866); - UNUSED_PARAM(clazz) - glBindBufferRangeEXT(target, index, buffer, (uintptr_t)offset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTransformFeedback_glBindBufferOffsetEXT(JNIEnv *__env, jclass clazz, jint target, jint index, jint buffer, jlong offset) { - glBindBufferOffsetEXTPROC glBindBufferOffsetEXT = (glBindBufferOffsetEXTPROC)tlsGetFunction(1867); - UNUSED_PARAM(clazz) - glBindBufferOffsetEXT(target, index, buffer, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTransformFeedback_glBindBufferBaseEXT(JNIEnv *__env, jclass clazz, jint target, jint index, jint buffer) { - glBindBufferBaseEXTPROC glBindBufferBaseEXT = (glBindBufferBaseEXTPROC)tlsGetFunction(1868); - UNUSED_PARAM(clazz) - glBindBufferBaseEXT(target, index, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTransformFeedback_glBeginTransformFeedbackEXT(JNIEnv *__env, jclass clazz, jint primitiveMode) { - glBeginTransformFeedbackEXTPROC glBeginTransformFeedbackEXT = (glBeginTransformFeedbackEXTPROC)tlsGetFunction(1869); - UNUSED_PARAM(clazz) - glBeginTransformFeedbackEXT(primitiveMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTransformFeedback_glEndTransformFeedbackEXT(JNIEnv *__env, jclass clazz) { - glEndTransformFeedbackEXTPROC glEndTransformFeedbackEXT = (glEndTransformFeedbackEXTPROC)tlsGetFunction(1870); - UNUSED_PARAM(clazz) - glEndTransformFeedbackEXT(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTransformFeedback_nglTransformFeedbackVaryingsEXT(JNIEnv *__env, jclass clazz, jint program, jint count, jlong varyingsAddress, jint bufferMode) { - glTransformFeedbackVaryingsEXTPROC glTransformFeedbackVaryingsEXT = (glTransformFeedbackVaryingsEXTPROC)tlsGetFunction(1871); - uintptr_t varyings = (uintptr_t)varyingsAddress; - UNUSED_PARAM(clazz) - glTransformFeedbackVaryingsEXT(program, count, varyings, bufferMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTTransformFeedback_nglGetTransformFeedbackVaryingEXT__IIIJJJJ(JNIEnv *__env, jclass clazz, jint program, jint index, jint bufSize, jlong lengthAddress, jlong sizeAddress, jlong typeAddress, jlong nameAddress) { - glGetTransformFeedbackVaryingEXTPROC glGetTransformFeedbackVaryingEXT = (glGetTransformFeedbackVaryingEXTPROC)tlsGetFunction(1872); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t size = (uintptr_t)sizeAddress; - uintptr_t type = (uintptr_t)typeAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetTransformFeedbackVaryingEXT(program, index, bufSize, length, size, type, name); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTVertexAttrib64bit.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTVertexAttrib64bit.c deleted file mode 100644 index 547ac55a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTVertexAttrib64bit.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexAttribL1dEXTPROC) (jint, jdouble); -typedef void (APIENTRY *glVertexAttribL2dEXTPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttribL3dEXTPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttribL4dEXTPROC) (jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttribL1dvEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL2dvEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL3dvEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL4dvEXTPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribLPointerEXTPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribLdvEXTPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_glVertexAttribL1dEXT(JNIEnv *__env, jclass clazz, jint index, jdouble x) { - glVertexAttribL1dEXTPROC glVertexAttribL1dEXT = (glVertexAttribL1dEXTPROC)tlsGetFunction(1873); - UNUSED_PARAM(clazz) - glVertexAttribL1dEXT(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_glVertexAttribL2dEXT(JNIEnv *__env, jclass clazz, jint index, jdouble x, jdouble y) { - glVertexAttribL2dEXTPROC glVertexAttribL2dEXT = (glVertexAttribL2dEXTPROC)tlsGetFunction(1874); - UNUSED_PARAM(clazz) - glVertexAttribL2dEXT(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_glVertexAttribL3dEXT(JNIEnv *__env, jclass clazz, jint index, jdouble x, jdouble y, jdouble z) { - glVertexAttribL3dEXTPROC glVertexAttribL3dEXT = (glVertexAttribL3dEXTPROC)tlsGetFunction(1875); - UNUSED_PARAM(clazz) - glVertexAttribL3dEXT(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_glVertexAttribL4dEXT(JNIEnv *__env, jclass clazz, jint index, jdouble x, jdouble y, jdouble z, jdouble w) { - glVertexAttribL4dEXTPROC glVertexAttribL4dEXT = (glVertexAttribL4dEXTPROC)tlsGetFunction(1876); - UNUSED_PARAM(clazz) - glVertexAttribL4dEXT(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_nglVertexAttribL1dvEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL1dvEXTPROC glVertexAttribL1dvEXT = (glVertexAttribL1dvEXTPROC)tlsGetFunction(1877); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL1dvEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_nglVertexAttribL2dvEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL2dvEXTPROC glVertexAttribL2dvEXT = (glVertexAttribL2dvEXTPROC)tlsGetFunction(1878); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL2dvEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_nglVertexAttribL3dvEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL3dvEXTPROC glVertexAttribL3dvEXT = (glVertexAttribL3dvEXTPROC)tlsGetFunction(1879); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL3dvEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_nglVertexAttribL4dvEXT__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL4dvEXTPROC glVertexAttribL4dvEXT = (glVertexAttribL4dvEXTPROC)tlsGetFunction(1880); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL4dvEXT(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_nglVertexAttribLPointerEXT(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jint stride, jlong pointerAddress) { - glVertexAttribLPointerEXTPROC glVertexAttribLPointerEXT = (glVertexAttribLPointerEXTPROC)tlsGetFunction(1881); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glVertexAttribLPointerEXT(index, size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTVertexAttrib64bit_nglGetVertexAttribLdvEXT__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribLdvEXTPROC glGetVertexAttribLdvEXT = (glGetVertexAttribLdvEXTPROC)tlsGetFunction(1882); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribLdvEXT(index, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTWin32KeyedMutex.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTWin32KeyedMutex.c deleted file mode 100644 index b3ebf785..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTWin32KeyedMutex.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jboolean (APIENTRY *glAcquireKeyedMutexWin32EXTPROC) (jint, jlong, jint); -typedef jboolean (APIENTRY *glReleaseKeyedMutexWin32EXTPROC) (jint, jlong); - -EXTERN_C_ENTER - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_EXTWin32KeyedMutex_glAcquireKeyedMutexWin32EXT(JNIEnv *__env, jclass clazz, jint memory, jlong key, jint timeout) { - glAcquireKeyedMutexWin32EXTPROC glAcquireKeyedMutexWin32EXT = (glAcquireKeyedMutexWin32EXTPROC)tlsGetFunction(1883); - UNUSED_PARAM(clazz) - return glAcquireKeyedMutexWin32EXT(memory, key, timeout); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_EXTWin32KeyedMutex_glReleaseKeyedMutexWin32EXT(JNIEnv *__env, jclass clazz, jint memory, jlong key) { - glReleaseKeyedMutexWin32EXTPROC glReleaseKeyedMutexWin32EXT = (glReleaseKeyedMutexWin32EXTPROC)tlsGetFunction(1884); - UNUSED_PARAM(clazz) - return glReleaseKeyedMutexWin32EXT(memory, key); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTWindowRectangles.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTWindowRectangles.c deleted file mode 100644 index 78c8a011..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTWindowRectangles.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glWindowRectanglesEXTPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_EXTWindowRectangles_nglWindowRectanglesEXT__IIJ(JNIEnv *__env, jclass clazz, jint mode, jint count, jlong boxAddress) { - glWindowRectanglesEXTPROC glWindowRectanglesEXT = (glWindowRectanglesEXTPROC)tlsGetFunction(1885); - uintptr_t box = (uintptr_t)boxAddress; - UNUSED_PARAM(clazz) - glWindowRectanglesEXT(mode, count, box); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTX11SyncObject.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTX11SyncObject.c deleted file mode 100644 index 3853fbb1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_EXTX11SyncObject.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef uintptr_t (APIENTRY *glImportSyncEXTPROC) (jint, uintptr_t, jint); - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_EXTX11SyncObject_glImportSyncEXT(JNIEnv *__env, jclass clazz, jint external_sync_type, jlong external_sync, jint flags) { - glImportSyncEXTPROC glImportSyncEXT = (glImportSyncEXTPROC)tlsGetFunction(1886); - UNUSED_PARAM(clazz) - return (jlong)glImportSyncEXT(external_sync_type, (uintptr_t)external_sync, flags); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL11.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL11.c deleted file mode 100644 index 9aea130f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL11.c +++ /dev/null @@ -1,2068 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glAccumPROC) (jint, jfloat); -typedef void (APIENTRY *glAlphaFuncPROC) (jint, jfloat); -typedef jboolean (APIENTRY *glAreTexturesResidentPROC) (jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glArrayElementPROC) (jint); -typedef void (APIENTRY *glBeginPROC) (jint); -typedef void (APIENTRY *glBitmapPROC) (jint, jint, jfloat, jfloat, jfloat, jfloat, uintptr_t); -typedef void (APIENTRY *glCallListPROC) (jint); -typedef void (APIENTRY *glCallListsPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glClearAccumPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glClearIndexPROC) (jfloat); -typedef void (APIENTRY *glClipPlanePROC) (jint, uintptr_t); -typedef void (APIENTRY *glColor3bPROC) (jbyte, jbyte, jbyte); -typedef void (APIENTRY *glColor3sPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glColor3iPROC) (jint, jint, jint); -typedef void (APIENTRY *glColor3fPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glColor3dPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glColor3ubPROC) (uint8_t, uint8_t, uint8_t); -typedef void (APIENTRY *glColor3usPROC) (uint16_t, uint16_t, uint16_t); -typedef void (APIENTRY *glColor3uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glColor3bvPROC) (uintptr_t); -typedef void (APIENTRY *glColor3svPROC) (uintptr_t); -typedef void (APIENTRY *glColor3ivPROC) (uintptr_t); -typedef void (APIENTRY *glColor3fvPROC) (uintptr_t); -typedef void (APIENTRY *glColor3dvPROC) (uintptr_t); -typedef void (APIENTRY *glColor3ubvPROC) (uintptr_t); -typedef void (APIENTRY *glColor3usvPROC) (uintptr_t); -typedef void (APIENTRY *glColor3uivPROC) (uintptr_t); -typedef void (APIENTRY *glColor4bPROC) (jbyte, jbyte, jbyte, jbyte); -typedef void (APIENTRY *glColor4sPROC) (jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glColor4iPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glColor4fPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glColor4dPROC) (jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glColor4ubPROC) (uint8_t, uint8_t, uint8_t, uint8_t); -typedef void (APIENTRY *glColor4usPROC) (uint16_t, uint16_t, uint16_t, uint16_t); -typedef void (APIENTRY *glColor4uiPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glColor4bvPROC) (uintptr_t); -typedef void (APIENTRY *glColor4svPROC) (uintptr_t); -typedef void (APIENTRY *glColor4ivPROC) (uintptr_t); -typedef void (APIENTRY *glColor4fvPROC) (uintptr_t); -typedef void (APIENTRY *glColor4dvPROC) (uintptr_t); -typedef void (APIENTRY *glColor4ubvPROC) (uintptr_t); -typedef void (APIENTRY *glColor4usvPROC) (uintptr_t); -typedef void (APIENTRY *glColor4uivPROC) (uintptr_t); -typedef void (APIENTRY *glColorMaterialPROC) (jint, jint); -typedef void (APIENTRY *glColorPointerPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyPixelsPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glDeleteListsPROC) (jint, jint); -typedef void (APIENTRY *glDisableClientStatePROC) (jint); -typedef void (APIENTRY *glDrawPixelsPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glEdgeFlagPROC) (jboolean); -typedef void (APIENTRY *glEdgeFlagvPROC) (uintptr_t); -typedef void (APIENTRY *glEdgeFlagPointerPROC) (jint, uintptr_t); -typedef void (APIENTRY *glEnableClientStatePROC) (jint); -typedef void (APIENTRY *glEndPROC) (void); -typedef void (APIENTRY *glEvalCoord1fPROC) (jfloat); -typedef void (APIENTRY *glEvalCoord1fvPROC) (uintptr_t); -typedef void (APIENTRY *glEvalCoord1dPROC) (jdouble); -typedef void (APIENTRY *glEvalCoord1dvPROC) (uintptr_t); -typedef void (APIENTRY *glEvalCoord2fPROC) (jfloat, jfloat); -typedef void (APIENTRY *glEvalCoord2fvPROC) (uintptr_t); -typedef void (APIENTRY *glEvalCoord2dPROC) (jdouble, jdouble); -typedef void (APIENTRY *glEvalCoord2dvPROC) (uintptr_t); -typedef void (APIENTRY *glEvalMesh1PROC) (jint, jint, jint); -typedef void (APIENTRY *glEvalMesh2PROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glEvalPoint1PROC) (jint); -typedef void (APIENTRY *glEvalPoint2PROC) (jint, jint); -typedef void (APIENTRY *glFeedbackBufferPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glFogiPROC) (jint, jint); -typedef void (APIENTRY *glFogivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glFogfPROC) (jint, jfloat); -typedef void (APIENTRY *glFogfvPROC) (jint, uintptr_t); -typedef jint (APIENTRY *glGenListsPROC) (jint); -typedef void (APIENTRY *glGetClipPlanePROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetLightivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetLightfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMapivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMapfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMapdvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMaterialivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetMaterialfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPixelMapfvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetPixelMapusvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetPixelMapuivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetPolygonStipplePROC) (uintptr_t); -typedef void (APIENTRY *glGetTexEnvivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexEnvfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexGenivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexGenfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexGendvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glIndexiPROC) (jint); -typedef void (APIENTRY *glIndexubPROC) (uint8_t); -typedef void (APIENTRY *glIndexsPROC) (jshort); -typedef void (APIENTRY *glIndexfPROC) (jfloat); -typedef void (APIENTRY *glIndexdPROC) (jdouble); -typedef void (APIENTRY *glIndexivPROC) (uintptr_t); -typedef void (APIENTRY *glIndexubvPROC) (uintptr_t); -typedef void (APIENTRY *glIndexsvPROC) (uintptr_t); -typedef void (APIENTRY *glIndexfvPROC) (uintptr_t); -typedef void (APIENTRY *glIndexdvPROC) (uintptr_t); -typedef void (APIENTRY *glIndexMaskPROC) (jint); -typedef void (APIENTRY *glIndexPointerPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glInitNamesPROC) (void); -typedef void (APIENTRY *glInterleavedArraysPROC) (jint, jint, uintptr_t); -typedef jboolean (APIENTRY *glIsListPROC) (jint); -typedef void (APIENTRY *glLightModeliPROC) (jint, jint); -typedef void (APIENTRY *glLightModelfPROC) (jint, jfloat); -typedef void (APIENTRY *glLightModelivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glLightModelfvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glLightiPROC) (jint, jint, jint); -typedef void (APIENTRY *glLightfPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glLightivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glLightfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glLineStipplePROC) (jint, uint16_t); -typedef void (APIENTRY *glListBasePROC) (jint); -typedef void (APIENTRY *glLoadMatrixfPROC) (uintptr_t); -typedef void (APIENTRY *glLoadMatrixdPROC) (uintptr_t); -typedef void (APIENTRY *glLoadIdentityPROC) (void); -typedef void (APIENTRY *glLoadNamePROC) (jint); -typedef void (APIENTRY *glMap1fPROC) (jint, jfloat, jfloat, jint, jint, uintptr_t); -typedef void (APIENTRY *glMap1dPROC) (jint, jdouble, jdouble, jint, jint, uintptr_t); -typedef void (APIENTRY *glMap2fPROC) (jint, jfloat, jfloat, jint, jint, jfloat, jfloat, jint, jint, uintptr_t); -typedef void (APIENTRY *glMap2dPROC) (jint, jdouble, jdouble, jint, jint, jdouble, jdouble, jint, jint, uintptr_t); -typedef void (APIENTRY *glMapGrid1fPROC) (jint, jfloat, jfloat); -typedef void (APIENTRY *glMapGrid1dPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glMapGrid2fPROC) (jint, jfloat, jfloat, jint, jfloat, jfloat); -typedef void (APIENTRY *glMapGrid2dPROC) (jint, jdouble, jdouble, jint, jdouble, jdouble); -typedef void (APIENTRY *glMaterialiPROC) (jint, jint, jint); -typedef void (APIENTRY *glMaterialfPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glMaterialivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glMaterialfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glMatrixModePROC) (jint); -typedef void (APIENTRY *glMultMatrixfPROC) (uintptr_t); -typedef void (APIENTRY *glMultMatrixdPROC) (uintptr_t); -typedef void (APIENTRY *glFrustumPROC) (jdouble, jdouble, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glNewListPROC) (jint, jint); -typedef void (APIENTRY *glEndListPROC) (void); -typedef void (APIENTRY *glNormal3fPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glNormal3bPROC) (jbyte, jbyte, jbyte); -typedef void (APIENTRY *glNormal3sPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glNormal3iPROC) (jint, jint, jint); -typedef void (APIENTRY *glNormal3dPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glNormal3fvPROC) (uintptr_t); -typedef void (APIENTRY *glNormal3bvPROC) (uintptr_t); -typedef void (APIENTRY *glNormal3svPROC) (uintptr_t); -typedef void (APIENTRY *glNormal3ivPROC) (uintptr_t); -typedef void (APIENTRY *glNormal3dvPROC) (uintptr_t); -typedef void (APIENTRY *glNormalPointerPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glOrthoPROC) (jdouble, jdouble, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glPassThroughPROC) (jfloat); -typedef void (APIENTRY *glPixelMapfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glPixelMapusvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glPixelMapuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glPixelTransferiPROC) (jint, jint); -typedef void (APIENTRY *glPixelTransferfPROC) (jint, jfloat); -typedef void (APIENTRY *glPixelZoomPROC) (jfloat, jfloat); -typedef void (APIENTRY *glPolygonStipplePROC) (uintptr_t); -typedef void (APIENTRY *glPushAttribPROC) (jint); -typedef void (APIENTRY *glPushClientAttribPROC) (jint); -typedef void (APIENTRY *glPopAttribPROC) (void); -typedef void (APIENTRY *glPopClientAttribPROC) (void); -typedef void (APIENTRY *glPopMatrixPROC) (void); -typedef void (APIENTRY *glPopNamePROC) (void); -typedef void (APIENTRY *glPrioritizeTexturesPROC) (jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glPushMatrixPROC) (void); -typedef void (APIENTRY *glPushNamePROC) (jint); -typedef void (APIENTRY *glRasterPos2iPROC) (jint, jint); -typedef void (APIENTRY *glRasterPos2sPROC) (jshort, jshort); -typedef void (APIENTRY *glRasterPos2fPROC) (jfloat, jfloat); -typedef void (APIENTRY *glRasterPos2dPROC) (jdouble, jdouble); -typedef void (APIENTRY *glRasterPos2ivPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos2svPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos2fvPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos2dvPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos3iPROC) (jint, jint, jint); -typedef void (APIENTRY *glRasterPos3sPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glRasterPos3fPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glRasterPos3dPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glRasterPos3ivPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos3svPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos3fvPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos3dvPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos4iPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glRasterPos4sPROC) (jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glRasterPos4fPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glRasterPos4dPROC) (jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glRasterPos4ivPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos4svPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos4fvPROC) (uintptr_t); -typedef void (APIENTRY *glRasterPos4dvPROC) (uintptr_t); -typedef void (APIENTRY *glRectiPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glRectsPROC) (jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glRectfPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glRectdPROC) (jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glRectivPROC) (uintptr_t, uintptr_t); -typedef void (APIENTRY *glRectsvPROC) (uintptr_t, uintptr_t); -typedef void (APIENTRY *glRectfvPROC) (uintptr_t, uintptr_t); -typedef void (APIENTRY *glRectdvPROC) (uintptr_t, uintptr_t); -typedef jint (APIENTRY *glRenderModePROC) (jint); -typedef void (APIENTRY *glRotatefPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glRotatedPROC) (jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glScalefPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glScaledPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glSelectBufferPROC) (jint, uintptr_t); -typedef void (APIENTRY *glShadeModelPROC) (jint); -typedef void (APIENTRY *glTexCoord1fPROC) (jfloat); -typedef void (APIENTRY *glTexCoord1sPROC) (jshort); -typedef void (APIENTRY *glTexCoord1iPROC) (jint); -typedef void (APIENTRY *glTexCoord1dPROC) (jdouble); -typedef void (APIENTRY *glTexCoord1fvPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord1svPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord1ivPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord1dvPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord2fPROC) (jfloat, jfloat); -typedef void (APIENTRY *glTexCoord2sPROC) (jshort, jshort); -typedef void (APIENTRY *glTexCoord2iPROC) (jint, jint); -typedef void (APIENTRY *glTexCoord2dPROC) (jdouble, jdouble); -typedef void (APIENTRY *glTexCoord2fvPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord2svPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord2ivPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord2dvPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord3fPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glTexCoord3sPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glTexCoord3iPROC) (jint, jint, jint); -typedef void (APIENTRY *glTexCoord3dPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glTexCoord3fvPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord3svPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord3ivPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord3dvPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord4fPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glTexCoord4sPROC) (jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glTexCoord4iPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glTexCoord4dPROC) (jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glTexCoord4fvPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord4svPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord4ivPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord4dvPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoordPointerPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTexEnviPROC) (jint, jint, jint); -typedef void (APIENTRY *glTexEnvivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexEnvfPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glTexEnvfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexGeniPROC) (jint, jint, jint); -typedef void (APIENTRY *glTexGenivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexGenfPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glTexGenfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexGendPROC) (jint, jint, jdouble); -typedef void (APIENTRY *glTexGendvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTranslatefPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glTranslatedPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertex2fPROC) (jfloat, jfloat); -typedef void (APIENTRY *glVertex2sPROC) (jshort, jshort); -typedef void (APIENTRY *glVertex2iPROC) (jint, jint); -typedef void (APIENTRY *glVertex2dPROC) (jdouble, jdouble); -typedef void (APIENTRY *glVertex2fvPROC) (uintptr_t); -typedef void (APIENTRY *glVertex2svPROC) (uintptr_t); -typedef void (APIENTRY *glVertex2ivPROC) (uintptr_t); -typedef void (APIENTRY *glVertex2dvPROC) (uintptr_t); -typedef void (APIENTRY *glVertex3fPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glVertex3sPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glVertex3iPROC) (jint, jint, jint); -typedef void (APIENTRY *glVertex3dPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertex3fvPROC) (uintptr_t); -typedef void (APIENTRY *glVertex3svPROC) (uintptr_t); -typedef void (APIENTRY *glVertex3ivPROC) (uintptr_t); -typedef void (APIENTRY *glVertex3dvPROC) (uintptr_t); -typedef void (APIENTRY *glVertex4fPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glVertex4sPROC) (jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glVertex4iPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glVertex4dPROC) (jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertex4fvPROC) (uintptr_t); -typedef void (APIENTRY *glVertex4svPROC) (uintptr_t); -typedef void (APIENTRY *glVertex4ivPROC) (uintptr_t); -typedef void (APIENTRY *glVertex4dvPROC) (uintptr_t); -typedef void (APIENTRY *glVertexPointerPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glAccum(JNIEnv *__env, jclass clazz, jint op, jfloat value) { - glAccumPROC glAccum = (glAccumPROC)tlsGetFunction(2); - UNUSED_PARAM(clazz) - glAccum(op, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glAlphaFunc(JNIEnv *__env, jclass clazz, jint func, jfloat ref) { - glAlphaFuncPROC glAlphaFunc = (glAlphaFuncPROC)tlsGetFunction(3); - UNUSED_PARAM(clazz) - glAlphaFunc(func, ref); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL11_nglAreTexturesResident__IJJ(JNIEnv *__env, jclass clazz, jint n, jlong texturesAddress, jlong residencesAddress) { - glAreTexturesResidentPROC glAreTexturesResident = (glAreTexturesResidentPROC)tlsGetFunction(4); - uintptr_t textures = (uintptr_t)texturesAddress; - uintptr_t residences = (uintptr_t)residencesAddress; - UNUSED_PARAM(clazz) - return glAreTexturesResident(n, textures, residences); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glArrayElement(JNIEnv *__env, jclass clazz, jint i) { - glArrayElementPROC glArrayElement = (glArrayElementPROC)tlsGetFunction(5); - UNUSED_PARAM(clazz) - glArrayElement(i); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glBegin(JNIEnv *__env, jclass clazz, jint mode) { - glBeginPROC glBegin = (glBeginPROC)tlsGetFunction(6); - UNUSED_PARAM(clazz) - glBegin(mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglBitmap(JNIEnv *__env, jclass clazz, jint w, jint h, jfloat xOrig, jfloat yOrig, jfloat xInc, jfloat yInc, jlong dataAddress) { - glBitmapPROC glBitmap = (glBitmapPROC)tlsGetFunction(8); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glBitmap(w, h, xOrig, yOrig, xInc, yInc, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glCallList(JNIEnv *__env, jclass clazz, jint list) { - glCallListPROC glCallList = (glCallListPROC)tlsGetFunction(10); - UNUSED_PARAM(clazz) - glCallList(list); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglCallLists(JNIEnv *__env, jclass clazz, jint n, jint type, jlong listsAddress) { - glCallListsPROC glCallLists = (glCallListsPROC)tlsGetFunction(11); - uintptr_t lists = (uintptr_t)listsAddress; - UNUSED_PARAM(clazz) - glCallLists(n, type, lists); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glClearAccum(JNIEnv *__env, jclass clazz, jfloat red, jfloat green, jfloat blue, jfloat alpha) { - glClearAccumPROC glClearAccum = (glClearAccumPROC)tlsGetFunction(13); - UNUSED_PARAM(clazz) - glClearAccum(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glClearIndex(JNIEnv *__env, jclass clazz, jfloat index) { - glClearIndexPROC glClearIndex = (glClearIndexPROC)tlsGetFunction(16); - UNUSED_PARAM(clazz) - glClearIndex(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglClipPlane__IJ(JNIEnv *__env, jclass clazz, jint plane, jlong equationAddress) { - glClipPlanePROC glClipPlane = (glClipPlanePROC)tlsGetFunction(18); - uintptr_t equation = (uintptr_t)equationAddress; - UNUSED_PARAM(clazz) - glClipPlane(plane, equation); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor3b(JNIEnv *__env, jclass clazz, jbyte red, jbyte green, jbyte blue) { - glColor3bPROC glColor3b = (glColor3bPROC)tlsGetFunction(19); - UNUSED_PARAM(clazz) - glColor3b(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor3s(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue) { - glColor3sPROC glColor3s = (glColor3sPROC)tlsGetFunction(20); - UNUSED_PARAM(clazz) - glColor3s(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor3i(JNIEnv *__env, jclass clazz, jint red, jint green, jint blue) { - glColor3iPROC glColor3i = (glColor3iPROC)tlsGetFunction(21); - UNUSED_PARAM(clazz) - glColor3i(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor3f(JNIEnv *__env, jclass clazz, jfloat red, jfloat green, jfloat blue) { - glColor3fPROC glColor3f = (glColor3fPROC)tlsGetFunction(22); - UNUSED_PARAM(clazz) - glColor3f(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor3d(JNIEnv *__env, jclass clazz, jdouble red, jdouble green, jdouble blue) { - glColor3dPROC glColor3d = (glColor3dPROC)tlsGetFunction(23); - UNUSED_PARAM(clazz) - glColor3d(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor3ub(JNIEnv *__env, jclass clazz, jbyte red, jbyte green, jbyte blue) { - glColor3ubPROC glColor3ub = (glColor3ubPROC)tlsGetFunction(24); - UNUSED_PARAM(clazz) - glColor3ub((uint8_t)red, (uint8_t)green, (uint8_t)blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor3us(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue) { - glColor3usPROC glColor3us = (glColor3usPROC)tlsGetFunction(25); - UNUSED_PARAM(clazz) - glColor3us((uint16_t)red, (uint16_t)green, (uint16_t)blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor3ui(JNIEnv *__env, jclass clazz, jint red, jint green, jint blue) { - glColor3uiPROC glColor3ui = (glColor3uiPROC)tlsGetFunction(26); - UNUSED_PARAM(clazz) - glColor3ui(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor3bv(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3bvPROC glColor3bv = (glColor3bvPROC)tlsGetFunction(27); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3bv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor3sv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3svPROC glColor3sv = (glColor3svPROC)tlsGetFunction(28); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3sv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor3iv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3ivPROC glColor3iv = (glColor3ivPROC)tlsGetFunction(29); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3iv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor3fv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3fvPROC glColor3fv = (glColor3fvPROC)tlsGetFunction(30); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3fv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor3dv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3dvPROC glColor3dv = (glColor3dvPROC)tlsGetFunction(31); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3dv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor3ubv(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3ubvPROC glColor3ubv = (glColor3ubvPROC)tlsGetFunction(32); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3ubv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor3usv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3usvPROC glColor3usv = (glColor3usvPROC)tlsGetFunction(33); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3usv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor3uiv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3uivPROC glColor3uiv = (glColor3uivPROC)tlsGetFunction(34); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3uiv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor4b(JNIEnv *__env, jclass clazz, jbyte red, jbyte green, jbyte blue, jbyte alpha) { - glColor4bPROC glColor4b = (glColor4bPROC)tlsGetFunction(35); - UNUSED_PARAM(clazz) - glColor4b(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor4s(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue, jshort alpha) { - glColor4sPROC glColor4s = (glColor4sPROC)tlsGetFunction(36); - UNUSED_PARAM(clazz) - glColor4s(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor4i(JNIEnv *__env, jclass clazz, jint red, jint green, jint blue, jint alpha) { - glColor4iPROC glColor4i = (glColor4iPROC)tlsGetFunction(37); - UNUSED_PARAM(clazz) - glColor4i(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor4f(JNIEnv *__env, jclass clazz, jfloat red, jfloat green, jfloat blue, jfloat alpha) { - glColor4fPROC glColor4f = (glColor4fPROC)tlsGetFunction(38); - UNUSED_PARAM(clazz) - glColor4f(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor4d(JNIEnv *__env, jclass clazz, jdouble red, jdouble green, jdouble blue, jdouble alpha) { - glColor4dPROC glColor4d = (glColor4dPROC)tlsGetFunction(39); - UNUSED_PARAM(clazz) - glColor4d(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor4ub(JNIEnv *__env, jclass clazz, jbyte red, jbyte green, jbyte blue, jbyte alpha) { - glColor4ubPROC glColor4ub = (glColor4ubPROC)tlsGetFunction(40); - UNUSED_PARAM(clazz) - glColor4ub((uint8_t)red, (uint8_t)green, (uint8_t)blue, (uint8_t)alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor4us(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue, jshort alpha) { - glColor4usPROC glColor4us = (glColor4usPROC)tlsGetFunction(41); - UNUSED_PARAM(clazz) - glColor4us((uint16_t)red, (uint16_t)green, (uint16_t)blue, (uint16_t)alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColor4ui(JNIEnv *__env, jclass clazz, jint red, jint green, jint blue, jint alpha) { - glColor4uiPROC glColor4ui = (glColor4uiPROC)tlsGetFunction(42); - UNUSED_PARAM(clazz) - glColor4ui(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor4bv(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4bvPROC glColor4bv = (glColor4bvPROC)tlsGetFunction(43); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4bv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor4sv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4svPROC glColor4sv = (glColor4svPROC)tlsGetFunction(44); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4sv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor4iv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4ivPROC glColor4iv = (glColor4ivPROC)tlsGetFunction(45); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4iv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor4fv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4fvPROC glColor4fv = (glColor4fvPROC)tlsGetFunction(46); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4fv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor4dv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4dvPROC glColor4dv = (glColor4dvPROC)tlsGetFunction(47); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4dv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor4ubv(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4ubvPROC glColor4ubv = (glColor4ubvPROC)tlsGetFunction(48); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4ubv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor4usv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4usvPROC glColor4usv = (glColor4usvPROC)tlsGetFunction(49); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4usv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColor4uiv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4uivPROC glColor4uiv = (glColor4uivPROC)tlsGetFunction(50); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4uiv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glColorMaterial(JNIEnv *__env, jclass clazz, jint face, jint mode) { - glColorMaterialPROC glColorMaterial = (glColorMaterialPROC)tlsGetFunction(52); - UNUSED_PARAM(clazz) - glColorMaterial(face, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglColorPointer(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride, jlong pointerAddress) { - glColorPointerPROC glColorPointer = (glColorPointerPROC)tlsGetFunction(53); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glColorPointer(size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glCopyPixels(JNIEnv *__env, jclass clazz, jint x, jint y, jint width, jint height, jint type) { - glCopyPixelsPROC glCopyPixels = (glCopyPixelsPROC)tlsGetFunction(54); - UNUSED_PARAM(clazz) - glCopyPixels(x, y, width, height, type); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glDeleteLists(JNIEnv *__env, jclass clazz, jint list, jint range) { - glDeleteListsPROC glDeleteLists = (glDeleteListsPROC)tlsGetFunction(56); - UNUSED_PARAM(clazz) - glDeleteLists(list, range); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glDisableClientState(JNIEnv *__env, jclass clazz, jint cap) { - glDisableClientStatePROC glDisableClientState = (glDisableClientStatePROC)tlsGetFunction(60); - UNUSED_PARAM(clazz) - glDisableClientState(cap); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglDrawPixels__IIIIJ(JNIEnv *__env, jclass clazz, jint width, jint height, jint format, jint type, jlong pixelsAddress) { - glDrawPixelsPROC glDrawPixels = (glDrawPixelsPROC)tlsGetFunction(64); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glDrawPixels(width, height, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEdgeFlag(JNIEnv *__env, jclass clazz, jboolean flag) { - glEdgeFlagPROC glEdgeFlag = (glEdgeFlagPROC)tlsGetFunction(65); - UNUSED_PARAM(clazz) - glEdgeFlag(flag); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglEdgeFlagv(JNIEnv *__env, jclass clazz, jlong flagAddress) { - glEdgeFlagvPROC glEdgeFlagv = (glEdgeFlagvPROC)tlsGetFunction(66); - uintptr_t flag = (uintptr_t)flagAddress; - UNUSED_PARAM(clazz) - glEdgeFlagv(flag); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglEdgeFlagPointer(JNIEnv *__env, jclass clazz, jint stride, jlong pointerAddress) { - glEdgeFlagPointerPROC glEdgeFlagPointer = (glEdgeFlagPointerPROC)tlsGetFunction(67); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glEdgeFlagPointer(stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEnableClientState(JNIEnv *__env, jclass clazz, jint cap) { - glEnableClientStatePROC glEnableClientState = (glEnableClientStatePROC)tlsGetFunction(68); - UNUSED_PARAM(clazz) - glEnableClientState(cap); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEnd(JNIEnv *__env, jclass clazz) { - glEndPROC glEnd = (glEndPROC)tlsGetFunction(69); - UNUSED_PARAM(clazz) - glEnd(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEvalCoord1f(JNIEnv *__env, jclass clazz, jfloat u) { - glEvalCoord1fPROC glEvalCoord1f = (glEvalCoord1fPROC)tlsGetFunction(70); - UNUSED_PARAM(clazz) - glEvalCoord1f(u); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglEvalCoord1fv__J(JNIEnv *__env, jclass clazz, jlong uAddress) { - glEvalCoord1fvPROC glEvalCoord1fv = (glEvalCoord1fvPROC)tlsGetFunction(71); - uintptr_t u = (uintptr_t)uAddress; - UNUSED_PARAM(clazz) - glEvalCoord1fv(u); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEvalCoord1d(JNIEnv *__env, jclass clazz, jdouble u) { - glEvalCoord1dPROC glEvalCoord1d = (glEvalCoord1dPROC)tlsGetFunction(72); - UNUSED_PARAM(clazz) - glEvalCoord1d(u); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglEvalCoord1dv__J(JNIEnv *__env, jclass clazz, jlong uAddress) { - glEvalCoord1dvPROC glEvalCoord1dv = (glEvalCoord1dvPROC)tlsGetFunction(73); - uintptr_t u = (uintptr_t)uAddress; - UNUSED_PARAM(clazz) - glEvalCoord1dv(u); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEvalCoord2f(JNIEnv *__env, jclass clazz, jfloat u, jfloat v) { - glEvalCoord2fPROC glEvalCoord2f = (glEvalCoord2fPROC)tlsGetFunction(74); - UNUSED_PARAM(clazz) - glEvalCoord2f(u, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglEvalCoord2fv__J(JNIEnv *__env, jclass clazz, jlong uAddress) { - glEvalCoord2fvPROC glEvalCoord2fv = (glEvalCoord2fvPROC)tlsGetFunction(75); - uintptr_t u = (uintptr_t)uAddress; - UNUSED_PARAM(clazz) - glEvalCoord2fv(u); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEvalCoord2d(JNIEnv *__env, jclass clazz, jdouble u, jdouble v) { - glEvalCoord2dPROC glEvalCoord2d = (glEvalCoord2dPROC)tlsGetFunction(76); - UNUSED_PARAM(clazz) - glEvalCoord2d(u, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglEvalCoord2dv__J(JNIEnv *__env, jclass clazz, jlong uAddress) { - glEvalCoord2dvPROC glEvalCoord2dv = (glEvalCoord2dvPROC)tlsGetFunction(77); - uintptr_t u = (uintptr_t)uAddress; - UNUSED_PARAM(clazz) - glEvalCoord2dv(u); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEvalMesh1(JNIEnv *__env, jclass clazz, jint mode, jint i1, jint i2) { - glEvalMesh1PROC glEvalMesh1 = (glEvalMesh1PROC)tlsGetFunction(78); - UNUSED_PARAM(clazz) - glEvalMesh1(mode, i1, i2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEvalMesh2(JNIEnv *__env, jclass clazz, jint mode, jint i1, jint i2, jint j1, jint j2) { - glEvalMesh2PROC glEvalMesh2 = (glEvalMesh2PROC)tlsGetFunction(79); - UNUSED_PARAM(clazz) - glEvalMesh2(mode, i1, i2, j1, j2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEvalPoint1(JNIEnv *__env, jclass clazz, jint i) { - glEvalPoint1PROC glEvalPoint1 = (glEvalPoint1PROC)tlsGetFunction(80); - UNUSED_PARAM(clazz) - glEvalPoint1(i); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEvalPoint2(JNIEnv *__env, jclass clazz, jint i, jint j) { - glEvalPoint2PROC glEvalPoint2 = (glEvalPoint2PROC)tlsGetFunction(81); - UNUSED_PARAM(clazz) - glEvalPoint2(i, j); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglFeedbackBuffer__IIJ(JNIEnv *__env, jclass clazz, jint size, jint type, jlong bufferAddress) { - glFeedbackBufferPROC glFeedbackBuffer = (glFeedbackBufferPROC)tlsGetFunction(82); - uintptr_t buffer = (uintptr_t)bufferAddress; - UNUSED_PARAM(clazz) - glFeedbackBuffer(size, type, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glFogi(JNIEnv *__env, jclass clazz, jint pname, jint param) { - glFogiPROC glFogi = (glFogiPROC)tlsGetFunction(85); - UNUSED_PARAM(clazz) - glFogi(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglFogiv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glFogivPROC glFogiv = (glFogivPROC)tlsGetFunction(86); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glFogiv(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glFogf(JNIEnv *__env, jclass clazz, jint pname, jfloat param) { - glFogfPROC glFogf = (glFogfPROC)tlsGetFunction(87); - UNUSED_PARAM(clazz) - glFogf(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglFogfv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glFogfvPROC glFogfv = (glFogfvPROC)tlsGetFunction(88); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glFogfv(pname, params); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL11_glGenLists(JNIEnv *__env, jclass clazz, jint s) { - glGenListsPROC glGenLists = (glGenListsPROC)tlsGetFunction(90); - UNUSED_PARAM(clazz) - return glGenLists(s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetClipPlane__IJ(JNIEnv *__env, jclass clazz, jint plane, jlong equationAddress) { - glGetClipPlanePROC glGetClipPlane = (glGetClipPlanePROC)tlsGetFunction(93); - uintptr_t equation = (uintptr_t)equationAddress; - UNUSED_PARAM(clazz) - glGetClipPlane(plane, equation); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetLightiv__IIJ(JNIEnv *__env, jclass clazz, jint light, jint pname, jlong dataAddress) { - glGetLightivPROC glGetLightiv = (glGetLightivPROC)tlsGetFunction(99); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetLightiv(light, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetLightfv__IIJ(JNIEnv *__env, jclass clazz, jint light, jint pname, jlong dataAddress) { - glGetLightfvPROC glGetLightfv = (glGetLightfvPROC)tlsGetFunction(100); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetLightfv(light, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetMapiv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jlong dataAddress) { - glGetMapivPROC glGetMapiv = (glGetMapivPROC)tlsGetFunction(101); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetMapiv(target, query, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetMapfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jlong dataAddress) { - glGetMapfvPROC glGetMapfv = (glGetMapfvPROC)tlsGetFunction(102); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetMapfv(target, query, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetMapdv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jlong dataAddress) { - glGetMapdvPROC glGetMapdv = (glGetMapdvPROC)tlsGetFunction(103); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetMapdv(target, query, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetMaterialiv__IIJ(JNIEnv *__env, jclass clazz, jint face, jint pname, jlong dataAddress) { - glGetMaterialivPROC glGetMaterialiv = (glGetMaterialivPROC)tlsGetFunction(104); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetMaterialiv(face, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetMaterialfv__IIJ(JNIEnv *__env, jclass clazz, jint face, jint pname, jlong dataAddress) { - glGetMaterialfvPROC glGetMaterialfv = (glGetMaterialfvPROC)tlsGetFunction(105); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetMaterialfv(face, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetPixelMapfv__IJ(JNIEnv *__env, jclass clazz, jint map, jlong dataAddress) { - glGetPixelMapfvPROC glGetPixelMapfv = (glGetPixelMapfvPROC)tlsGetFunction(106); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetPixelMapfv(map, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetPixelMapusv__IJ(JNIEnv *__env, jclass clazz, jint map, jlong dataAddress) { - glGetPixelMapusvPROC glGetPixelMapusv = (glGetPixelMapusvPROC)tlsGetFunction(107); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetPixelMapusv(map, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetPixelMapuiv__IJ(JNIEnv *__env, jclass clazz, jint map, jlong dataAddress) { - glGetPixelMapuivPROC glGetPixelMapuiv = (glGetPixelMapuivPROC)tlsGetFunction(108); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetPixelMapuiv(map, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetPolygonStipple(JNIEnv *__env, jclass clazz, jlong patternAddress) { - glGetPolygonStipplePROC glGetPolygonStipple = (glGetPolygonStipplePROC)tlsGetFunction(110); - uintptr_t pattern = (uintptr_t)patternAddress; - UNUSED_PARAM(clazz) - glGetPolygonStipple(pattern); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetTexEnviv__IIJ(JNIEnv *__env, jclass clazz, jint env, jint pname, jlong dataAddress) { - glGetTexEnvivPROC glGetTexEnviv = (glGetTexEnvivPROC)tlsGetFunction(112); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetTexEnviv(env, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetTexEnvfv__IIJ(JNIEnv *__env, jclass clazz, jint env, jint pname, jlong dataAddress) { - glGetTexEnvfvPROC glGetTexEnvfv = (glGetTexEnvfvPROC)tlsGetFunction(113); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetTexEnvfv(env, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetTexGeniv__IIJ(JNIEnv *__env, jclass clazz, jint coord, jint pname, jlong dataAddress) { - glGetTexGenivPROC glGetTexGeniv = (glGetTexGenivPROC)tlsGetFunction(114); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetTexGeniv(coord, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetTexGenfv__IIJ(JNIEnv *__env, jclass clazz, jint coord, jint pname, jlong dataAddress) { - glGetTexGenfvPROC glGetTexGenfv = (glGetTexGenfvPROC)tlsGetFunction(115); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetTexGenfv(coord, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglGetTexGendv__IIJ(JNIEnv *__env, jclass clazz, jint coord, jint pname, jlong dataAddress) { - glGetTexGendvPROC glGetTexGendv = (glGetTexGendvPROC)tlsGetFunction(116); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetTexGendv(coord, pname, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glIndexi(JNIEnv *__env, jclass clazz, jint index) { - glIndexiPROC glIndexi = (glIndexiPROC)tlsGetFunction(123); - UNUSED_PARAM(clazz) - glIndexi(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glIndexub(JNIEnv *__env, jclass clazz, jbyte index) { - glIndexubPROC glIndexub = (glIndexubPROC)tlsGetFunction(124); - UNUSED_PARAM(clazz) - glIndexub((uint8_t)index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glIndexs(JNIEnv *__env, jclass clazz, jshort index) { - glIndexsPROC glIndexs = (glIndexsPROC)tlsGetFunction(125); - UNUSED_PARAM(clazz) - glIndexs(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glIndexf(JNIEnv *__env, jclass clazz, jfloat index) { - glIndexfPROC glIndexf = (glIndexfPROC)tlsGetFunction(126); - UNUSED_PARAM(clazz) - glIndexf(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glIndexd(JNIEnv *__env, jclass clazz, jdouble index) { - glIndexdPROC glIndexd = (glIndexdPROC)tlsGetFunction(127); - UNUSED_PARAM(clazz) - glIndexd(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglIndexiv__J(JNIEnv *__env, jclass clazz, jlong indexAddress) { - glIndexivPROC glIndexiv = (glIndexivPROC)tlsGetFunction(128); - uintptr_t index = (uintptr_t)indexAddress; - UNUSED_PARAM(clazz) - glIndexiv(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglIndexubv(JNIEnv *__env, jclass clazz, jlong indexAddress) { - glIndexubvPROC glIndexubv = (glIndexubvPROC)tlsGetFunction(129); - uintptr_t index = (uintptr_t)indexAddress; - UNUSED_PARAM(clazz) - glIndexubv(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglIndexsv__J(JNIEnv *__env, jclass clazz, jlong indexAddress) { - glIndexsvPROC glIndexsv = (glIndexsvPROC)tlsGetFunction(130); - uintptr_t index = (uintptr_t)indexAddress; - UNUSED_PARAM(clazz) - glIndexsv(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglIndexfv__J(JNIEnv *__env, jclass clazz, jlong indexAddress) { - glIndexfvPROC glIndexfv = (glIndexfvPROC)tlsGetFunction(131); - uintptr_t index = (uintptr_t)indexAddress; - UNUSED_PARAM(clazz) - glIndexfv(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglIndexdv__J(JNIEnv *__env, jclass clazz, jlong indexAddress) { - glIndexdvPROC glIndexdv = (glIndexdvPROC)tlsGetFunction(132); - uintptr_t index = (uintptr_t)indexAddress; - UNUSED_PARAM(clazz) - glIndexdv(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glIndexMask(JNIEnv *__env, jclass clazz, jint mask) { - glIndexMaskPROC glIndexMask = (glIndexMaskPROC)tlsGetFunction(133); - UNUSED_PARAM(clazz) - glIndexMask(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglIndexPointer(JNIEnv *__env, jclass clazz, jint type, jint stride, jlong pointerAddress) { - glIndexPointerPROC glIndexPointer = (glIndexPointerPROC)tlsGetFunction(134); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glIndexPointer(type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glInitNames(JNIEnv *__env, jclass clazz) { - glInitNamesPROC glInitNames = (glInitNamesPROC)tlsGetFunction(135); - UNUSED_PARAM(clazz) - glInitNames(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglInterleavedArrays__IIJ(JNIEnv *__env, jclass clazz, jint format, jint stride, jlong pointerAddress) { - glInterleavedArraysPROC glInterleavedArrays = (glInterleavedArraysPROC)tlsGetFunction(136); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glInterleavedArrays(format, stride, pointer); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL11_glIsList(JNIEnv *__env, jclass clazz, jint list) { - glIsListPROC glIsList = (glIsListPROC)tlsGetFunction(138); - UNUSED_PARAM(clazz) - return glIsList(list); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glLightModeli(JNIEnv *__env, jclass clazz, jint pname, jint param) { - glLightModeliPROC glLightModeli = (glLightModeliPROC)tlsGetFunction(140); - UNUSED_PARAM(clazz) - glLightModeli(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glLightModelf(JNIEnv *__env, jclass clazz, jint pname, jfloat param) { - glLightModelfPROC glLightModelf = (glLightModelfPROC)tlsGetFunction(141); - UNUSED_PARAM(clazz) - glLightModelf(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglLightModeliv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glLightModelivPROC glLightModeliv = (glLightModelivPROC)tlsGetFunction(142); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glLightModeliv(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglLightModelfv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glLightModelfvPROC glLightModelfv = (glLightModelfvPROC)tlsGetFunction(143); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glLightModelfv(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glLighti(JNIEnv *__env, jclass clazz, jint light, jint pname, jint param) { - glLightiPROC glLighti = (glLightiPROC)tlsGetFunction(144); - UNUSED_PARAM(clazz) - glLighti(light, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glLightf(JNIEnv *__env, jclass clazz, jint light, jint pname, jfloat param) { - glLightfPROC glLightf = (glLightfPROC)tlsGetFunction(145); - UNUSED_PARAM(clazz) - glLightf(light, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglLightiv__IIJ(JNIEnv *__env, jclass clazz, jint light, jint pname, jlong paramsAddress) { - glLightivPROC glLightiv = (glLightivPROC)tlsGetFunction(146); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glLightiv(light, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglLightfv__IIJ(JNIEnv *__env, jclass clazz, jint light, jint pname, jlong paramsAddress) { - glLightfvPROC glLightfv = (glLightfvPROC)tlsGetFunction(147); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glLightfv(light, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glLineStipple(JNIEnv *__env, jclass clazz, jint factor, jshort pattern) { - glLineStipplePROC glLineStipple = (glLineStipplePROC)tlsGetFunction(148); - UNUSED_PARAM(clazz) - glLineStipple(factor, (uint16_t)pattern); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glListBase(JNIEnv *__env, jclass clazz, jint base) { - glListBasePROC glListBase = (glListBasePROC)tlsGetFunction(150); - UNUSED_PARAM(clazz) - glListBase(base); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglLoadMatrixf__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glLoadMatrixfPROC glLoadMatrixf = (glLoadMatrixfPROC)tlsGetFunction(151); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glLoadMatrixf(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglLoadMatrixd__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glLoadMatrixdPROC glLoadMatrixd = (glLoadMatrixdPROC)tlsGetFunction(152); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glLoadMatrixd(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glLoadIdentity(JNIEnv *__env, jclass clazz) { - glLoadIdentityPROC glLoadIdentity = (glLoadIdentityPROC)tlsGetFunction(153); - UNUSED_PARAM(clazz) - glLoadIdentity(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glLoadName(JNIEnv *__env, jclass clazz, jint name) { - glLoadNamePROC glLoadName = (glLoadNamePROC)tlsGetFunction(154); - UNUSED_PARAM(clazz) - glLoadName(name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglMap1f__IFFIIJ(JNIEnv *__env, jclass clazz, jint target, jfloat u1, jfloat u2, jint stride, jint order, jlong pointsAddress) { - glMap1fPROC glMap1f = (glMap1fPROC)tlsGetFunction(156); - uintptr_t points = (uintptr_t)pointsAddress; - UNUSED_PARAM(clazz) - glMap1f(target, u1, u2, stride, order, points); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglMap1d__IDDIIJ(JNIEnv *__env, jclass clazz, jint target, jdouble u1, jdouble u2, jint stride, jint order, jlong pointsAddress) { - glMap1dPROC glMap1d = (glMap1dPROC)tlsGetFunction(157); - uintptr_t points = (uintptr_t)pointsAddress; - UNUSED_PARAM(clazz) - glMap1d(target, u1, u2, stride, order, points); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglMap2f__IFFIIFFIIJ(JNIEnv *__env, jclass clazz, jint target, jfloat u1, jfloat u2, jint ustride, jint uorder, jfloat v1, jfloat v2, jint vstride, jint vorder, jlong pointsAddress) { - glMap2fPROC glMap2f = (glMap2fPROC)tlsGetFunction(158); - uintptr_t points = (uintptr_t)pointsAddress; - UNUSED_PARAM(clazz) - glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglMap2d__IDDIIDDIIJ(JNIEnv *__env, jclass clazz, jint target, jdouble u1, jdouble u2, jint ustride, jint uorder, jdouble v1, jdouble v2, jint vstride, jint vorder, jlong pointsAddress) { - glMap2dPROC glMap2d = (glMap2dPROC)tlsGetFunction(159); - uintptr_t points = (uintptr_t)pointsAddress; - UNUSED_PARAM(clazz) - glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glMapGrid1f(JNIEnv *__env, jclass clazz, jint n, jfloat u1, jfloat u2) { - glMapGrid1fPROC glMapGrid1f = (glMapGrid1fPROC)tlsGetFunction(160); - UNUSED_PARAM(clazz) - glMapGrid1f(n, u1, u2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glMapGrid1d(JNIEnv *__env, jclass clazz, jint n, jdouble u1, jdouble u2) { - glMapGrid1dPROC glMapGrid1d = (glMapGrid1dPROC)tlsGetFunction(161); - UNUSED_PARAM(clazz) - glMapGrid1d(n, u1, u2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glMapGrid2f(JNIEnv *__env, jclass clazz, jint un, jfloat u1, jfloat u2, jint vn, jfloat v1, jfloat v2) { - glMapGrid2fPROC glMapGrid2f = (glMapGrid2fPROC)tlsGetFunction(162); - UNUSED_PARAM(clazz) - glMapGrid2f(un, u1, u2, vn, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glMapGrid2d(JNIEnv *__env, jclass clazz, jint un, jdouble u1, jdouble u2, jint vn, jdouble v1, jdouble v2) { - glMapGrid2dPROC glMapGrid2d = (glMapGrid2dPROC)tlsGetFunction(163); - UNUSED_PARAM(clazz) - glMapGrid2d(un, u1, u2, vn, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glMateriali(JNIEnv *__env, jclass clazz, jint face, jint pname, jint param) { - glMaterialiPROC glMateriali = (glMaterialiPROC)tlsGetFunction(164); - UNUSED_PARAM(clazz) - glMateriali(face, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glMaterialf(JNIEnv *__env, jclass clazz, jint face, jint pname, jfloat param) { - glMaterialfPROC glMaterialf = (glMaterialfPROC)tlsGetFunction(165); - UNUSED_PARAM(clazz) - glMaterialf(face, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglMaterialiv__IIJ(JNIEnv *__env, jclass clazz, jint face, jint pname, jlong paramsAddress) { - glMaterialivPROC glMaterialiv = (glMaterialivPROC)tlsGetFunction(166); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMaterialiv(face, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglMaterialfv__IIJ(JNIEnv *__env, jclass clazz, jint face, jint pname, jlong paramsAddress) { - glMaterialfvPROC glMaterialfv = (glMaterialfvPROC)tlsGetFunction(167); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMaterialfv(face, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glMatrixMode(JNIEnv *__env, jclass clazz, jint mode) { - glMatrixModePROC glMatrixMode = (glMatrixModePROC)tlsGetFunction(168); - UNUSED_PARAM(clazz) - glMatrixMode(mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglMultMatrixf__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glMultMatrixfPROC glMultMatrixf = (glMultMatrixfPROC)tlsGetFunction(169); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMultMatrixf(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglMultMatrixd__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glMultMatrixdPROC glMultMatrixd = (glMultMatrixdPROC)tlsGetFunction(170); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMultMatrixd(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glFrustum(JNIEnv *__env, jclass clazz, jdouble l, jdouble r, jdouble b, jdouble t, jdouble n, jdouble f) { - glFrustumPROC glFrustum = (glFrustumPROC)tlsGetFunction(171); - UNUSED_PARAM(clazz) - glFrustum(l, r, b, t, n, f); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glNewList(JNIEnv *__env, jclass clazz, jint n, jint mode) { - glNewListPROC glNewList = (glNewListPROC)tlsGetFunction(172); - UNUSED_PARAM(clazz) - glNewList(n, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glEndList(JNIEnv *__env, jclass clazz) { - glEndListPROC glEndList = (glEndListPROC)tlsGetFunction(173); - UNUSED_PARAM(clazz) - glEndList(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glNormal3f(JNIEnv *__env, jclass clazz, jfloat nx, jfloat ny, jfloat nz) { - glNormal3fPROC glNormal3f = (glNormal3fPROC)tlsGetFunction(174); - UNUSED_PARAM(clazz) - glNormal3f(nx, ny, nz); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glNormal3b(JNIEnv *__env, jclass clazz, jbyte nx, jbyte ny, jbyte nz) { - glNormal3bPROC glNormal3b = (glNormal3bPROC)tlsGetFunction(175); - UNUSED_PARAM(clazz) - glNormal3b(nx, ny, nz); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glNormal3s(JNIEnv *__env, jclass clazz, jshort nx, jshort ny, jshort nz) { - glNormal3sPROC glNormal3s = (glNormal3sPROC)tlsGetFunction(176); - UNUSED_PARAM(clazz) - glNormal3s(nx, ny, nz); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glNormal3i(JNIEnv *__env, jclass clazz, jint nx, jint ny, jint nz) { - glNormal3iPROC glNormal3i = (glNormal3iPROC)tlsGetFunction(177); - UNUSED_PARAM(clazz) - glNormal3i(nx, ny, nz); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glNormal3d(JNIEnv *__env, jclass clazz, jdouble nx, jdouble ny, jdouble nz) { - glNormal3dPROC glNormal3d = (glNormal3dPROC)tlsGetFunction(178); - UNUSED_PARAM(clazz) - glNormal3d(nx, ny, nz); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglNormal3fv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glNormal3fvPROC glNormal3fv = (glNormal3fvPROC)tlsGetFunction(179); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glNormal3fv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglNormal3bv(JNIEnv *__env, jclass clazz, jlong vAddress) { - glNormal3bvPROC glNormal3bv = (glNormal3bvPROC)tlsGetFunction(180); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glNormal3bv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglNormal3sv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glNormal3svPROC glNormal3sv = (glNormal3svPROC)tlsGetFunction(181); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glNormal3sv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglNormal3iv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glNormal3ivPROC glNormal3iv = (glNormal3ivPROC)tlsGetFunction(182); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glNormal3iv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglNormal3dv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glNormal3dvPROC glNormal3dv = (glNormal3dvPROC)tlsGetFunction(183); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glNormal3dv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglNormalPointer(JNIEnv *__env, jclass clazz, jint type, jint stride, jlong pointerAddress) { - glNormalPointerPROC glNormalPointer = (glNormalPointerPROC)tlsGetFunction(184); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glNormalPointer(type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glOrtho(JNIEnv *__env, jclass clazz, jdouble l, jdouble r, jdouble b, jdouble t, jdouble n, jdouble f) { - glOrthoPROC glOrtho = (glOrthoPROC)tlsGetFunction(185); - UNUSED_PARAM(clazz) - glOrtho(l, r, b, t, n, f); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPassThrough(JNIEnv *__env, jclass clazz, jfloat token) { - glPassThroughPROC glPassThrough = (glPassThroughPROC)tlsGetFunction(186); - UNUSED_PARAM(clazz) - glPassThrough(token); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglPixelMapfv__IIJ(JNIEnv *__env, jclass clazz, jint map, jint size, jlong valuesAddress) { - glPixelMapfvPROC glPixelMapfv = (glPixelMapfvPROC)tlsGetFunction(187); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glPixelMapfv(map, size, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglPixelMapusv__IIJ(JNIEnv *__env, jclass clazz, jint map, jint size, jlong valuesAddress) { - glPixelMapusvPROC glPixelMapusv = (glPixelMapusvPROC)tlsGetFunction(188); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glPixelMapusv(map, size, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglPixelMapuiv__IIJ(JNIEnv *__env, jclass clazz, jint map, jint size, jlong valuesAddress) { - glPixelMapuivPROC glPixelMapuiv = (glPixelMapuivPROC)tlsGetFunction(189); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glPixelMapuiv(map, size, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPixelTransferi(JNIEnv *__env, jclass clazz, jint pname, jint param) { - glPixelTransferiPROC glPixelTransferi = (glPixelTransferiPROC)tlsGetFunction(192); - UNUSED_PARAM(clazz) - glPixelTransferi(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPixelTransferf(JNIEnv *__env, jclass clazz, jint pname, jfloat param) { - glPixelTransferfPROC glPixelTransferf = (glPixelTransferfPROC)tlsGetFunction(193); - UNUSED_PARAM(clazz) - glPixelTransferf(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPixelZoom(JNIEnv *__env, jclass clazz, jfloat xfactor, jfloat yfactor) { - glPixelZoomPROC glPixelZoom = (glPixelZoomPROC)tlsGetFunction(194); - UNUSED_PARAM(clazz) - glPixelZoom(xfactor, yfactor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglPolygonStipple(JNIEnv *__env, jclass clazz, jlong patternAddress) { - glPolygonStipplePROC glPolygonStipple = (glPolygonStipplePROC)tlsGetFunction(198); - uintptr_t pattern = (uintptr_t)patternAddress; - UNUSED_PARAM(clazz) - glPolygonStipple(pattern); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPushAttrib(JNIEnv *__env, jclass clazz, jint mask) { - glPushAttribPROC glPushAttrib = (glPushAttribPROC)tlsGetFunction(199); - UNUSED_PARAM(clazz) - glPushAttrib(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPushClientAttrib(JNIEnv *__env, jclass clazz, jint mask) { - glPushClientAttribPROC glPushClientAttrib = (glPushClientAttribPROC)tlsGetFunction(200); - UNUSED_PARAM(clazz) - glPushClientAttrib(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPopAttrib(JNIEnv *__env, jclass clazz) { - glPopAttribPROC glPopAttrib = (glPopAttribPROC)tlsGetFunction(201); - UNUSED_PARAM(clazz) - glPopAttrib(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPopClientAttrib(JNIEnv *__env, jclass clazz) { - glPopClientAttribPROC glPopClientAttrib = (glPopClientAttribPROC)tlsGetFunction(202); - UNUSED_PARAM(clazz) - glPopClientAttrib(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPopMatrix(JNIEnv *__env, jclass clazz) { - glPopMatrixPROC glPopMatrix = (glPopMatrixPROC)tlsGetFunction(203); - UNUSED_PARAM(clazz) - glPopMatrix(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPopName(JNIEnv *__env, jclass clazz) { - glPopNamePROC glPopName = (glPopNamePROC)tlsGetFunction(204); - UNUSED_PARAM(clazz) - glPopName(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglPrioritizeTextures__IJJ(JNIEnv *__env, jclass clazz, jint n, jlong texturesAddress, jlong prioritiesAddress) { - glPrioritizeTexturesPROC glPrioritizeTextures = (glPrioritizeTexturesPROC)tlsGetFunction(205); - uintptr_t textures = (uintptr_t)texturesAddress; - uintptr_t priorities = (uintptr_t)prioritiesAddress; - UNUSED_PARAM(clazz) - glPrioritizeTextures(n, textures, priorities); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPushMatrix(JNIEnv *__env, jclass clazz) { - glPushMatrixPROC glPushMatrix = (glPushMatrixPROC)tlsGetFunction(206); - UNUSED_PARAM(clazz) - glPushMatrix(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glPushName(JNIEnv *__env, jclass clazz, jint name) { - glPushNamePROC glPushName = (glPushNamePROC)tlsGetFunction(207); - UNUSED_PARAM(clazz) - glPushName(name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos2i(JNIEnv *__env, jclass clazz, jint x, jint y) { - glRasterPos2iPROC glRasterPos2i = (glRasterPos2iPROC)tlsGetFunction(208); - UNUSED_PARAM(clazz) - glRasterPos2i(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos2s(JNIEnv *__env, jclass clazz, jshort x, jshort y) { - glRasterPos2sPROC glRasterPos2s = (glRasterPos2sPROC)tlsGetFunction(209); - UNUSED_PARAM(clazz) - glRasterPos2s(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos2f(JNIEnv *__env, jclass clazz, jfloat x, jfloat y) { - glRasterPos2fPROC glRasterPos2f = (glRasterPos2fPROC)tlsGetFunction(210); - UNUSED_PARAM(clazz) - glRasterPos2f(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos2d(JNIEnv *__env, jclass clazz, jdouble x, jdouble y) { - glRasterPos2dPROC glRasterPos2d = (glRasterPos2dPROC)tlsGetFunction(211); - UNUSED_PARAM(clazz) - glRasterPos2d(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos2iv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos2ivPROC glRasterPos2iv = (glRasterPos2ivPROC)tlsGetFunction(212); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos2iv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos2sv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos2svPROC glRasterPos2sv = (glRasterPos2svPROC)tlsGetFunction(213); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos2sv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos2fv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos2fvPROC glRasterPos2fv = (glRasterPos2fvPROC)tlsGetFunction(214); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos2fv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos2dv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos2dvPROC glRasterPos2dv = (glRasterPos2dvPROC)tlsGetFunction(215); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos2dv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos3i(JNIEnv *__env, jclass clazz, jint x, jint y, jint z) { - glRasterPos3iPROC glRasterPos3i = (glRasterPos3iPROC)tlsGetFunction(216); - UNUSED_PARAM(clazz) - glRasterPos3i(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos3s(JNIEnv *__env, jclass clazz, jshort x, jshort y, jshort z) { - glRasterPos3sPROC glRasterPos3s = (glRasterPos3sPROC)tlsGetFunction(217); - UNUSED_PARAM(clazz) - glRasterPos3s(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos3f(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z) { - glRasterPos3fPROC glRasterPos3f = (glRasterPos3fPROC)tlsGetFunction(218); - UNUSED_PARAM(clazz) - glRasterPos3f(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos3d(JNIEnv *__env, jclass clazz, jdouble x, jdouble y, jdouble z) { - glRasterPos3dPROC glRasterPos3d = (glRasterPos3dPROC)tlsGetFunction(219); - UNUSED_PARAM(clazz) - glRasterPos3d(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos3iv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos3ivPROC glRasterPos3iv = (glRasterPos3ivPROC)tlsGetFunction(220); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos3iv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos3sv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos3svPROC glRasterPos3sv = (glRasterPos3svPROC)tlsGetFunction(221); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos3sv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos3fv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos3fvPROC glRasterPos3fv = (glRasterPos3fvPROC)tlsGetFunction(222); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos3fv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos3dv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos3dvPROC glRasterPos3dv = (glRasterPos3dvPROC)tlsGetFunction(223); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos3dv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos4i(JNIEnv *__env, jclass clazz, jint x, jint y, jint z, jint w) { - glRasterPos4iPROC glRasterPos4i = (glRasterPos4iPROC)tlsGetFunction(224); - UNUSED_PARAM(clazz) - glRasterPos4i(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos4s(JNIEnv *__env, jclass clazz, jshort x, jshort y, jshort z, jshort w) { - glRasterPos4sPROC glRasterPos4s = (glRasterPos4sPROC)tlsGetFunction(225); - UNUSED_PARAM(clazz) - glRasterPos4s(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos4f(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z, jfloat w) { - glRasterPos4fPROC glRasterPos4f = (glRasterPos4fPROC)tlsGetFunction(226); - UNUSED_PARAM(clazz) - glRasterPos4f(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRasterPos4d(JNIEnv *__env, jclass clazz, jdouble x, jdouble y, jdouble z, jdouble w) { - glRasterPos4dPROC glRasterPos4d = (glRasterPos4dPROC)tlsGetFunction(227); - UNUSED_PARAM(clazz) - glRasterPos4d(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos4iv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos4ivPROC glRasterPos4iv = (glRasterPos4ivPROC)tlsGetFunction(228); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos4iv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos4sv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos4svPROC glRasterPos4sv = (glRasterPos4svPROC)tlsGetFunction(229); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos4sv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos4fv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos4fvPROC glRasterPos4fv = (glRasterPos4fvPROC)tlsGetFunction(230); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos4fv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRasterPos4dv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glRasterPos4dvPROC glRasterPos4dv = (glRasterPos4dvPROC)tlsGetFunction(231); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glRasterPos4dv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRecti(JNIEnv *__env, jclass clazz, jint x1, jint y1, jint x2, jint y2) { - glRectiPROC glRecti = (glRectiPROC)tlsGetFunction(234); - UNUSED_PARAM(clazz) - glRecti(x1, y1, x2, y2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRects(JNIEnv *__env, jclass clazz, jshort x1, jshort y1, jshort x2, jshort y2) { - glRectsPROC glRects = (glRectsPROC)tlsGetFunction(235); - UNUSED_PARAM(clazz) - glRects(x1, y1, x2, y2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRectf(JNIEnv *__env, jclass clazz, jfloat x1, jfloat y1, jfloat x2, jfloat y2) { - glRectfPROC glRectf = (glRectfPROC)tlsGetFunction(236); - UNUSED_PARAM(clazz) - glRectf(x1, y1, x2, y2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRectd(JNIEnv *__env, jclass clazz, jdouble x1, jdouble y1, jdouble x2, jdouble y2) { - glRectdPROC glRectd = (glRectdPROC)tlsGetFunction(237); - UNUSED_PARAM(clazz) - glRectd(x1, y1, x2, y2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRectiv__JJ(JNIEnv *__env, jclass clazz, jlong v1Address, jlong v2Address) { - glRectivPROC glRectiv = (glRectivPROC)tlsGetFunction(238); - uintptr_t v1 = (uintptr_t)v1Address; - uintptr_t v2 = (uintptr_t)v2Address; - UNUSED_PARAM(clazz) - glRectiv(v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRectsv__JJ(JNIEnv *__env, jclass clazz, jlong v1Address, jlong v2Address) { - glRectsvPROC glRectsv = (glRectsvPROC)tlsGetFunction(239); - uintptr_t v1 = (uintptr_t)v1Address; - uintptr_t v2 = (uintptr_t)v2Address; - UNUSED_PARAM(clazz) - glRectsv(v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRectfv__JJ(JNIEnv *__env, jclass clazz, jlong v1Address, jlong v2Address) { - glRectfvPROC glRectfv = (glRectfvPROC)tlsGetFunction(240); - uintptr_t v1 = (uintptr_t)v1Address; - uintptr_t v2 = (uintptr_t)v2Address; - UNUSED_PARAM(clazz) - glRectfv(v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglRectdv__JJ(JNIEnv *__env, jclass clazz, jlong v1Address, jlong v2Address) { - glRectdvPROC glRectdv = (glRectdvPROC)tlsGetFunction(241); - uintptr_t v1 = (uintptr_t)v1Address; - uintptr_t v2 = (uintptr_t)v2Address; - UNUSED_PARAM(clazz) - glRectdv(v1, v2); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL11_glRenderMode(JNIEnv *__env, jclass clazz, jint mode) { - glRenderModePROC glRenderMode = (glRenderModePROC)tlsGetFunction(242); - UNUSED_PARAM(clazz) - return glRenderMode(mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRotatef(JNIEnv *__env, jclass clazz, jfloat angle, jfloat x, jfloat y, jfloat z) { - glRotatefPROC glRotatef = (glRotatefPROC)tlsGetFunction(243); - UNUSED_PARAM(clazz) - glRotatef(angle, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glRotated(JNIEnv *__env, jclass clazz, jdouble angle, jdouble x, jdouble y, jdouble z) { - glRotatedPROC glRotated = (glRotatedPROC)tlsGetFunction(244); - UNUSED_PARAM(clazz) - glRotated(angle, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glScalef(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z) { - glScalefPROC glScalef = (glScalefPROC)tlsGetFunction(245); - UNUSED_PARAM(clazz) - glScalef(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glScaled(JNIEnv *__env, jclass clazz, jdouble x, jdouble y, jdouble z) { - glScaledPROC glScaled = (glScaledPROC)tlsGetFunction(246); - UNUSED_PARAM(clazz) - glScaled(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglSelectBuffer__IJ(JNIEnv *__env, jclass clazz, jint size, jlong bufferAddress) { - glSelectBufferPROC glSelectBuffer = (glSelectBufferPROC)tlsGetFunction(248); - uintptr_t buffer = (uintptr_t)bufferAddress; - UNUSED_PARAM(clazz) - glSelectBuffer(size, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glShadeModel(JNIEnv *__env, jclass clazz, jint mode) { - glShadeModelPROC glShadeModel = (glShadeModelPROC)tlsGetFunction(249); - UNUSED_PARAM(clazz) - glShadeModel(mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord1f(JNIEnv *__env, jclass clazz, jfloat s) { - glTexCoord1fPROC glTexCoord1f = (glTexCoord1fPROC)tlsGetFunction(253); - UNUSED_PARAM(clazz) - glTexCoord1f(s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord1s(JNIEnv *__env, jclass clazz, jshort s) { - glTexCoord1sPROC glTexCoord1s = (glTexCoord1sPROC)tlsGetFunction(254); - UNUSED_PARAM(clazz) - glTexCoord1s(s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord1i(JNIEnv *__env, jclass clazz, jint s) { - glTexCoord1iPROC glTexCoord1i = (glTexCoord1iPROC)tlsGetFunction(255); - UNUSED_PARAM(clazz) - glTexCoord1i(s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord1d(JNIEnv *__env, jclass clazz, jdouble s) { - glTexCoord1dPROC glTexCoord1d = (glTexCoord1dPROC)tlsGetFunction(256); - UNUSED_PARAM(clazz) - glTexCoord1d(s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord1fv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord1fvPROC glTexCoord1fv = (glTexCoord1fvPROC)tlsGetFunction(257); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord1fv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord1sv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord1svPROC glTexCoord1sv = (glTexCoord1svPROC)tlsGetFunction(258); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord1sv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord1iv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord1ivPROC glTexCoord1iv = (glTexCoord1ivPROC)tlsGetFunction(259); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord1iv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord1dv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord1dvPROC glTexCoord1dv = (glTexCoord1dvPROC)tlsGetFunction(260); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord1dv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord2f(JNIEnv *__env, jclass clazz, jfloat s, jfloat t) { - glTexCoord2fPROC glTexCoord2f = (glTexCoord2fPROC)tlsGetFunction(261); - UNUSED_PARAM(clazz) - glTexCoord2f(s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord2s(JNIEnv *__env, jclass clazz, jshort s, jshort t) { - glTexCoord2sPROC glTexCoord2s = (glTexCoord2sPROC)tlsGetFunction(262); - UNUSED_PARAM(clazz) - glTexCoord2s(s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord2i(JNIEnv *__env, jclass clazz, jint s, jint t) { - glTexCoord2iPROC glTexCoord2i = (glTexCoord2iPROC)tlsGetFunction(263); - UNUSED_PARAM(clazz) - glTexCoord2i(s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord2d(JNIEnv *__env, jclass clazz, jdouble s, jdouble t) { - glTexCoord2dPROC glTexCoord2d = (glTexCoord2dPROC)tlsGetFunction(264); - UNUSED_PARAM(clazz) - glTexCoord2d(s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord2fv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord2fvPROC glTexCoord2fv = (glTexCoord2fvPROC)tlsGetFunction(265); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord2fv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord2sv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord2svPROC glTexCoord2sv = (glTexCoord2svPROC)tlsGetFunction(266); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord2sv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord2iv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord2ivPROC glTexCoord2iv = (glTexCoord2ivPROC)tlsGetFunction(267); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord2iv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord2dv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord2dvPROC glTexCoord2dv = (glTexCoord2dvPROC)tlsGetFunction(268); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord2dv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord3f(JNIEnv *__env, jclass clazz, jfloat s, jfloat t, jfloat r) { - glTexCoord3fPROC glTexCoord3f = (glTexCoord3fPROC)tlsGetFunction(269); - UNUSED_PARAM(clazz) - glTexCoord3f(s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord3s(JNIEnv *__env, jclass clazz, jshort s, jshort t, jshort r) { - glTexCoord3sPROC glTexCoord3s = (glTexCoord3sPROC)tlsGetFunction(270); - UNUSED_PARAM(clazz) - glTexCoord3s(s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord3i(JNIEnv *__env, jclass clazz, jint s, jint t, jint r) { - glTexCoord3iPROC glTexCoord3i = (glTexCoord3iPROC)tlsGetFunction(271); - UNUSED_PARAM(clazz) - glTexCoord3i(s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord3d(JNIEnv *__env, jclass clazz, jdouble s, jdouble t, jdouble r) { - glTexCoord3dPROC glTexCoord3d = (glTexCoord3dPROC)tlsGetFunction(272); - UNUSED_PARAM(clazz) - glTexCoord3d(s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord3fv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord3fvPROC glTexCoord3fv = (glTexCoord3fvPROC)tlsGetFunction(273); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord3fv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord3sv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord3svPROC glTexCoord3sv = (glTexCoord3svPROC)tlsGetFunction(274); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord3sv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord3iv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord3ivPROC glTexCoord3iv = (glTexCoord3ivPROC)tlsGetFunction(275); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord3iv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord3dv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord3dvPROC glTexCoord3dv = (glTexCoord3dvPROC)tlsGetFunction(276); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord3dv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord4f(JNIEnv *__env, jclass clazz, jfloat s, jfloat t, jfloat r, jfloat q) { - glTexCoord4fPROC glTexCoord4f = (glTexCoord4fPROC)tlsGetFunction(277); - UNUSED_PARAM(clazz) - glTexCoord4f(s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord4s(JNIEnv *__env, jclass clazz, jshort s, jshort t, jshort r, jshort q) { - glTexCoord4sPROC glTexCoord4s = (glTexCoord4sPROC)tlsGetFunction(278); - UNUSED_PARAM(clazz) - glTexCoord4s(s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord4i(JNIEnv *__env, jclass clazz, jint s, jint t, jint r, jint q) { - glTexCoord4iPROC glTexCoord4i = (glTexCoord4iPROC)tlsGetFunction(279); - UNUSED_PARAM(clazz) - glTexCoord4i(s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexCoord4d(JNIEnv *__env, jclass clazz, jdouble s, jdouble t, jdouble r, jdouble q) { - glTexCoord4dPROC glTexCoord4d = (glTexCoord4dPROC)tlsGetFunction(280); - UNUSED_PARAM(clazz) - glTexCoord4d(s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord4fv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord4fvPROC glTexCoord4fv = (glTexCoord4fvPROC)tlsGetFunction(281); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord4fv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord4sv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord4svPROC glTexCoord4sv = (glTexCoord4svPROC)tlsGetFunction(282); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord4sv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord4iv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord4ivPROC glTexCoord4iv = (glTexCoord4ivPROC)tlsGetFunction(283); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord4iv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoord4dv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord4dvPROC glTexCoord4dv = (glTexCoord4dvPROC)tlsGetFunction(284); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord4dv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexCoordPointer(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride, jlong pointerAddress) { - glTexCoordPointerPROC glTexCoordPointer = (glTexCoordPointerPROC)tlsGetFunction(285); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glTexCoordPointer(size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexEnvi(JNIEnv *__env, jclass clazz, jint target, jint pname, jint param) { - glTexEnviPROC glTexEnvi = (glTexEnviPROC)tlsGetFunction(286); - UNUSED_PARAM(clazz) - glTexEnvi(target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexEnviv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glTexEnvivPROC glTexEnviv = (glTexEnvivPROC)tlsGetFunction(287); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexEnviv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexEnvf(JNIEnv *__env, jclass clazz, jint target, jint pname, jfloat param) { - glTexEnvfPROC glTexEnvf = (glTexEnvfPROC)tlsGetFunction(288); - UNUSED_PARAM(clazz) - glTexEnvf(target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexEnvfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glTexEnvfvPROC glTexEnvfv = (glTexEnvfvPROC)tlsGetFunction(289); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexEnvfv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexGeni(JNIEnv *__env, jclass clazz, jint coord, jint pname, jint param) { - glTexGeniPROC glTexGeni = (glTexGeniPROC)tlsGetFunction(290); - UNUSED_PARAM(clazz) - glTexGeni(coord, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexGeniv__IIJ(JNIEnv *__env, jclass clazz, jint coord, jint pname, jlong paramsAddress) { - glTexGenivPROC glTexGeniv = (glTexGenivPROC)tlsGetFunction(291); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexGeniv(coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexGenf(JNIEnv *__env, jclass clazz, jint coord, jint pname, jfloat param) { - glTexGenfPROC glTexGenf = (glTexGenfPROC)tlsGetFunction(292); - UNUSED_PARAM(clazz) - glTexGenf(coord, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexGenfv__IIJ(JNIEnv *__env, jclass clazz, jint coord, jint pname, jlong paramsAddress) { - glTexGenfvPROC glTexGenfv = (glTexGenfvPROC)tlsGetFunction(293); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexGenfv(coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTexGend(JNIEnv *__env, jclass clazz, jint coord, jint pname, jdouble param) { - glTexGendPROC glTexGend = (glTexGendPROC)tlsGetFunction(294); - UNUSED_PARAM(clazz) - glTexGend(coord, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglTexGendv__IIJ(JNIEnv *__env, jclass clazz, jint coord, jint pname, jlong paramsAddress) { - glTexGendvPROC glTexGendv = (glTexGendvPROC)tlsGetFunction(295); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexGendv(coord, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTranslatef(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z) { - glTranslatefPROC glTranslatef = (glTranslatefPROC)tlsGetFunction(308); - UNUSED_PARAM(clazz) - glTranslatef(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glTranslated(JNIEnv *__env, jclass clazz, jdouble x, jdouble y, jdouble z) { - glTranslatedPROC glTranslated = (glTranslatedPROC)tlsGetFunction(309); - UNUSED_PARAM(clazz) - glTranslated(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex2f(JNIEnv *__env, jclass clazz, jfloat x, jfloat y) { - glVertex2fPROC glVertex2f = (glVertex2fPROC)tlsGetFunction(310); - UNUSED_PARAM(clazz) - glVertex2f(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex2s(JNIEnv *__env, jclass clazz, jshort x, jshort y) { - glVertex2sPROC glVertex2s = (glVertex2sPROC)tlsGetFunction(311); - UNUSED_PARAM(clazz) - glVertex2s(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex2i(JNIEnv *__env, jclass clazz, jint x, jint y) { - glVertex2iPROC glVertex2i = (glVertex2iPROC)tlsGetFunction(312); - UNUSED_PARAM(clazz) - glVertex2i(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex2d(JNIEnv *__env, jclass clazz, jdouble x, jdouble y) { - glVertex2dPROC glVertex2d = (glVertex2dPROC)tlsGetFunction(313); - UNUSED_PARAM(clazz) - glVertex2d(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex2fv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex2fvPROC glVertex2fv = (glVertex2fvPROC)tlsGetFunction(314); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex2fv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex2sv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex2svPROC glVertex2sv = (glVertex2svPROC)tlsGetFunction(315); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex2sv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex2iv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex2ivPROC glVertex2iv = (glVertex2ivPROC)tlsGetFunction(316); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex2iv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex2dv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex2dvPROC glVertex2dv = (glVertex2dvPROC)tlsGetFunction(317); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex2dv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex3f(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z) { - glVertex3fPROC glVertex3f = (glVertex3fPROC)tlsGetFunction(318); - UNUSED_PARAM(clazz) - glVertex3f(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex3s(JNIEnv *__env, jclass clazz, jshort x, jshort y, jshort z) { - glVertex3sPROC glVertex3s = (glVertex3sPROC)tlsGetFunction(319); - UNUSED_PARAM(clazz) - glVertex3s(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex3i(JNIEnv *__env, jclass clazz, jint x, jint y, jint z) { - glVertex3iPROC glVertex3i = (glVertex3iPROC)tlsGetFunction(320); - UNUSED_PARAM(clazz) - glVertex3i(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex3d(JNIEnv *__env, jclass clazz, jdouble x, jdouble y, jdouble z) { - glVertex3dPROC glVertex3d = (glVertex3dPROC)tlsGetFunction(321); - UNUSED_PARAM(clazz) - glVertex3d(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex3fv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex3fvPROC glVertex3fv = (glVertex3fvPROC)tlsGetFunction(322); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex3fv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex3sv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex3svPROC glVertex3sv = (glVertex3svPROC)tlsGetFunction(323); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex3sv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex3iv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex3ivPROC glVertex3iv = (glVertex3ivPROC)tlsGetFunction(324); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex3iv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex3dv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex3dvPROC glVertex3dv = (glVertex3dvPROC)tlsGetFunction(325); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex3dv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex4f(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z, jfloat w) { - glVertex4fPROC glVertex4f = (glVertex4fPROC)tlsGetFunction(326); - UNUSED_PARAM(clazz) - glVertex4f(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex4s(JNIEnv *__env, jclass clazz, jshort x, jshort y, jshort z, jshort w) { - glVertex4sPROC glVertex4s = (glVertex4sPROC)tlsGetFunction(327); - UNUSED_PARAM(clazz) - glVertex4s(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex4i(JNIEnv *__env, jclass clazz, jint x, jint y, jint z, jint w) { - glVertex4iPROC glVertex4i = (glVertex4iPROC)tlsGetFunction(328); - UNUSED_PARAM(clazz) - glVertex4i(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_glVertex4d(JNIEnv *__env, jclass clazz, jdouble x, jdouble y, jdouble z, jdouble w) { - glVertex4dPROC glVertex4d = (glVertex4dPROC)tlsGetFunction(329); - UNUSED_PARAM(clazz) - glVertex4d(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex4fv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex4fvPROC glVertex4fv = (glVertex4fvPROC)tlsGetFunction(330); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex4fv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex4sv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex4svPROC glVertex4sv = (glVertex4svPROC)tlsGetFunction(331); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex4sv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex4iv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex4ivPROC glVertex4iv = (glVertex4ivPROC)tlsGetFunction(332); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex4iv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertex4dv__J(JNIEnv *__env, jclass clazz, jlong coordsAddress) { - glVertex4dvPROC glVertex4dv = (glVertex4dvPROC)tlsGetFunction(333); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glVertex4dv(coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11_nglVertexPointer(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride, jlong pointerAddress) { - glVertexPointerPROC glVertexPointer = (glVertexPointerPROC)tlsGetFunction(334); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glVertexPointer(size, type, stride, pointer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL11C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL11C.c deleted file mode 100644 index 2fa516c4..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL11C.c +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glEnablePROC) (jint); -typedef void (APIENTRY *glDisablePROC) (jint); -typedef void (APIENTRY *glBindTexturePROC) (jint, jint); -typedef void (APIENTRY *glBlendFuncPROC) (jint, jint); -typedef void (APIENTRY *glClearPROC) (jint); -typedef void (APIENTRY *glClearColorPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glClearDepthPROC) (jdouble); -typedef void (APIENTRY *glClearStencilPROC) (jint); -typedef void (APIENTRY *glColorMaskPROC) (jboolean, jboolean, jboolean, jboolean); -typedef void (APIENTRY *glCullFacePROC) (jint); -typedef void (APIENTRY *glDepthFuncPROC) (jint); -typedef void (APIENTRY *glDepthMaskPROC) (jboolean); -typedef void (APIENTRY *glDepthRangePROC) (jdouble, jdouble); -typedef void (APIENTRY *glDrawArraysPROC) (jint, jint, jint); -typedef void (APIENTRY *glDrawBufferPROC) (jint); -typedef void (APIENTRY *glDrawElementsPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glFinishPROC) (void); -typedef void (APIENTRY *glFlushPROC) (void); -typedef void (APIENTRY *glFrontFacePROC) (jint); -typedef void (APIENTRY *glGenTexturesPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeleteTexturesPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetBooleanvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetFloatvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetIntegervPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetDoublevPROC) (jint, uintptr_t); -typedef jint (APIENTRY *glGetErrorPROC) (void); -typedef void (APIENTRY *glGetPointervPROC) (jint, uintptr_t); -typedef uintptr_t (APIENTRY *glGetStringPROC) (jint); -typedef void (APIENTRY *glGetTexImagePROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexLevelParameterivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexLevelParameterfvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glHintPROC) (jint, jint); -typedef jboolean (APIENTRY *glIsEnabledPROC) (jint); -typedef jboolean (APIENTRY *glIsTexturePROC) (jint); -typedef void (APIENTRY *glLineWidthPROC) (jfloat); -typedef void (APIENTRY *glLogicOpPROC) (jint); -typedef void (APIENTRY *glPixelStoreiPROC) (jint, jint); -typedef void (APIENTRY *glPixelStorefPROC) (jint, jfloat); -typedef void (APIENTRY *glPointSizePROC) (jfloat); -typedef void (APIENTRY *glPolygonModePROC) (jint, jint); -typedef void (APIENTRY *glPolygonOffsetPROC) (jfloat, jfloat); -typedef void (APIENTRY *glReadBufferPROC) (jint); -typedef void (APIENTRY *glReadPixelsPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glScissorPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glStencilFuncPROC) (jint, jint, jint); -typedef void (APIENTRY *glStencilMaskPROC) (jint); -typedef void (APIENTRY *glStencilOpPROC) (jint, jint, jint); -typedef void (APIENTRY *glTexImage1DPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTexImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyTexImage1DPROC) (jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyTexImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyTexSubImage1DPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyTexSubImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTexParameteriPROC) (jint, jint, jint); -typedef void (APIENTRY *glTexParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexParameterfPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glTexParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexSubImage1DPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTexSubImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glViewportPROC) (jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glEnable(JNIEnv *__env, jclass clazz, jint target) { - glEnablePROC glEnable = (glEnablePROC)tlsGetFunction(0); - UNUSED_PARAM(clazz) - glEnable(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glDisable(JNIEnv *__env, jclass clazz, jint target) { - glDisablePROC glDisable = (glDisablePROC)tlsGetFunction(1); - UNUSED_PARAM(clazz) - glDisable(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glBindTexture(JNIEnv *__env, jclass clazz, jint target, jint texture) { - glBindTexturePROC glBindTexture = (glBindTexturePROC)tlsGetFunction(7); - UNUSED_PARAM(clazz) - glBindTexture(target, texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glBlendFunc(JNIEnv *__env, jclass clazz, jint sfactor, jint dfactor) { - glBlendFuncPROC glBlendFunc = (glBlendFuncPROC)tlsGetFunction(9); - UNUSED_PARAM(clazz) - glBlendFunc(sfactor, dfactor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glClear(JNIEnv *__env, jclass clazz, jint mask) { - glClearPROC glClear = (glClearPROC)tlsGetFunction(12); - UNUSED_PARAM(clazz) - glClear(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glClearColor(JNIEnv *__env, jclass clazz, jfloat red, jfloat green, jfloat blue, jfloat alpha) { - glClearColorPROC glClearColor = (glClearColorPROC)tlsGetFunction(14); - UNUSED_PARAM(clazz) - glClearColor(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glClearDepth(JNIEnv *__env, jclass clazz, jdouble depth) { - glClearDepthPROC glClearDepth = (glClearDepthPROC)tlsGetFunction(15); - UNUSED_PARAM(clazz) - glClearDepth(depth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glClearStencil(JNIEnv *__env, jclass clazz, jint s) { - glClearStencilPROC glClearStencil = (glClearStencilPROC)tlsGetFunction(17); - UNUSED_PARAM(clazz) - glClearStencil(s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glColorMask(JNIEnv *__env, jclass clazz, jboolean red, jboolean green, jboolean blue, jboolean alpha) { - glColorMaskPROC glColorMask = (glColorMaskPROC)tlsGetFunction(51); - UNUSED_PARAM(clazz) - glColorMask(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glCullFace(JNIEnv *__env, jclass clazz, jint mode) { - glCullFacePROC glCullFace = (glCullFacePROC)tlsGetFunction(55); - UNUSED_PARAM(clazz) - glCullFace(mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glDepthFunc(JNIEnv *__env, jclass clazz, jint func) { - glDepthFuncPROC glDepthFunc = (glDepthFuncPROC)tlsGetFunction(57); - UNUSED_PARAM(clazz) - glDepthFunc(func); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glDepthMask(JNIEnv *__env, jclass clazz, jboolean flag) { - glDepthMaskPROC glDepthMask = (glDepthMaskPROC)tlsGetFunction(58); - UNUSED_PARAM(clazz) - glDepthMask(flag); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glDepthRange(JNIEnv *__env, jclass clazz, jdouble zNear, jdouble zFar) { - glDepthRangePROC glDepthRange = (glDepthRangePROC)tlsGetFunction(59); - UNUSED_PARAM(clazz) - glDepthRange(zNear, zFar); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glDrawArrays(JNIEnv *__env, jclass clazz, jint mode, jint first, jint count) { - glDrawArraysPROC glDrawArrays = (glDrawArraysPROC)tlsGetFunction(61); - UNUSED_PARAM(clazz) - glDrawArrays(mode, first, count); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glDrawBuffer(JNIEnv *__env, jclass clazz, jint buf) { - glDrawBufferPROC glDrawBuffer = (glDrawBufferPROC)tlsGetFunction(62); - UNUSED_PARAM(clazz) - glDrawBuffer(buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglDrawElements(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress) { - glDrawElementsPROC glDrawElements = (glDrawElementsPROC)tlsGetFunction(63); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawElements(mode, count, type, indices); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glFinish(JNIEnv *__env, jclass clazz) { - glFinishPROC glFinish = (glFinishPROC)tlsGetFunction(83); - UNUSED_PARAM(clazz) - glFinish(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glFlush(JNIEnv *__env, jclass clazz) { - glFlushPROC glFlush = (glFlushPROC)tlsGetFunction(84); - UNUSED_PARAM(clazz) - glFlush(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glFrontFace(JNIEnv *__env, jclass clazz, jint dir) { - glFrontFacePROC glFrontFace = (glFrontFacePROC)tlsGetFunction(89); - UNUSED_PARAM(clazz) - glFrontFace(dir); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGenTextures__IJ(JNIEnv *__env, jclass clazz, jint n, jlong texturesAddress) { - glGenTexturesPROC glGenTextures = (glGenTexturesPROC)tlsGetFunction(91); - uintptr_t textures = (uintptr_t)texturesAddress; - UNUSED_PARAM(clazz) - glGenTextures(n, textures); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglDeleteTextures__IJ(JNIEnv *__env, jclass clazz, jint n, jlong texturesAddress) { - glDeleteTexturesPROC glDeleteTextures = (glDeleteTexturesPROC)tlsGetFunction(92); - uintptr_t textures = (uintptr_t)texturesAddress; - UNUSED_PARAM(clazz) - glDeleteTextures(n, textures); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetBooleanv(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glGetBooleanvPROC glGetBooleanv = (glGetBooleanvPROC)tlsGetFunction(94); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetBooleanv(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetFloatv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glGetFloatvPROC glGetFloatv = (glGetFloatvPROC)tlsGetFunction(95); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetFloatv(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetIntegerv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glGetIntegervPROC glGetIntegerv = (glGetIntegervPROC)tlsGetFunction(96); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetIntegerv(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetDoublev__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glGetDoublevPROC glGetDoublev = (glGetDoublevPROC)tlsGetFunction(97); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetDoublev(pname, params); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL11C_glGetError(JNIEnv *__env, jclass clazz) { - glGetErrorPROC glGetError = (glGetErrorPROC)tlsGetFunction(98); - UNUSED_PARAM(clazz) - return glGetError(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetPointerv(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glGetPointervPROC glGetPointerv = (glGetPointervPROC)tlsGetFunction(109); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetPointerv(pname, params); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GL11C_nglGetString(JNIEnv *__env, jclass clazz, jint name) { - glGetStringPROC glGetString = (glGetStringPROC)tlsGetFunction(111); - UNUSED_PARAM(clazz) - return (jlong)glGetString(name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetTexImage__IIIIJ(JNIEnv *__env, jclass clazz, jint tex, jint level, jint format, jint type, jlong pixelsAddress) { - glGetTexImagePROC glGetTexImage = (glGetTexImagePROC)tlsGetFunction(117); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetTexImage(tex, level, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetTexLevelParameteriv__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint level, jint pname, jlong paramsAddress) { - glGetTexLevelParameterivPROC glGetTexLevelParameteriv = (glGetTexLevelParameterivPROC)tlsGetFunction(118); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTexLevelParameteriv(target, level, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetTexLevelParameterfv__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint level, jint pname, jlong paramsAddress) { - glGetTexLevelParameterfvPROC glGetTexLevelParameterfv = (glGetTexLevelParameterfvPROC)tlsGetFunction(119); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTexLevelParameterfv(target, level, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetTexParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetTexParameterivPROC glGetTexParameteriv = (glGetTexParameterivPROC)tlsGetFunction(120); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTexParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglGetTexParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetTexParameterfvPROC glGetTexParameterfv = (glGetTexParameterfvPROC)tlsGetFunction(121); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTexParameterfv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glHint(JNIEnv *__env, jclass clazz, jint target, jint hint) { - glHintPROC glHint = (glHintPROC)tlsGetFunction(122); - UNUSED_PARAM(clazz) - glHint(target, hint); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL11C_glIsEnabled(JNIEnv *__env, jclass clazz, jint cap) { - glIsEnabledPROC glIsEnabled = (glIsEnabledPROC)tlsGetFunction(137); - UNUSED_PARAM(clazz) - return glIsEnabled(cap); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL11C_glIsTexture(JNIEnv *__env, jclass clazz, jint texture) { - glIsTexturePROC glIsTexture = (glIsTexturePROC)tlsGetFunction(139); - UNUSED_PARAM(clazz) - return glIsTexture(texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glLineWidth(JNIEnv *__env, jclass clazz, jfloat width) { - glLineWidthPROC glLineWidth = (glLineWidthPROC)tlsGetFunction(149); - UNUSED_PARAM(clazz) - glLineWidth(width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glLogicOp(JNIEnv *__env, jclass clazz, jint op) { - glLogicOpPROC glLogicOp = (glLogicOpPROC)tlsGetFunction(155); - UNUSED_PARAM(clazz) - glLogicOp(op); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glPixelStorei(JNIEnv *__env, jclass clazz, jint pname, jint param) { - glPixelStoreiPROC glPixelStorei = (glPixelStoreiPROC)tlsGetFunction(190); - UNUSED_PARAM(clazz) - glPixelStorei(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glPixelStoref(JNIEnv *__env, jclass clazz, jint pname, jfloat param) { - glPixelStorefPROC glPixelStoref = (glPixelStorefPROC)tlsGetFunction(191); - UNUSED_PARAM(clazz) - glPixelStoref(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glPointSize(JNIEnv *__env, jclass clazz, jfloat size) { - glPointSizePROC glPointSize = (glPointSizePROC)tlsGetFunction(195); - UNUSED_PARAM(clazz) - glPointSize(size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glPolygonMode(JNIEnv *__env, jclass clazz, jint face, jint mode) { - glPolygonModePROC glPolygonMode = (glPolygonModePROC)tlsGetFunction(196); - UNUSED_PARAM(clazz) - glPolygonMode(face, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glPolygonOffset(JNIEnv *__env, jclass clazz, jfloat factor, jfloat units) { - glPolygonOffsetPROC glPolygonOffset = (glPolygonOffsetPROC)tlsGetFunction(197); - UNUSED_PARAM(clazz) - glPolygonOffset(factor, units); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glReadBuffer(JNIEnv *__env, jclass clazz, jint src) { - glReadBufferPROC glReadBuffer = (glReadBufferPROC)tlsGetFunction(232); - UNUSED_PARAM(clazz) - glReadBuffer(src); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglReadPixels__IIIIIIJ(JNIEnv *__env, jclass clazz, jint x, jint y, jint width, jint height, jint format, jint type, jlong pixelsAddress) { - glReadPixelsPROC glReadPixels = (glReadPixelsPROC)tlsGetFunction(233); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glReadPixels(x, y, width, height, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glScissor(JNIEnv *__env, jclass clazz, jint x, jint y, jint width, jint height) { - glScissorPROC glScissor = (glScissorPROC)tlsGetFunction(247); - UNUSED_PARAM(clazz) - glScissor(x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glStencilFunc(JNIEnv *__env, jclass clazz, jint func, jint ref, jint mask) { - glStencilFuncPROC glStencilFunc = (glStencilFuncPROC)tlsGetFunction(250); - UNUSED_PARAM(clazz) - glStencilFunc(func, ref, mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glStencilMask(JNIEnv *__env, jclass clazz, jint mask) { - glStencilMaskPROC glStencilMask = (glStencilMaskPROC)tlsGetFunction(251); - UNUSED_PARAM(clazz) - glStencilMask(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glStencilOp(JNIEnv *__env, jclass clazz, jint sfail, jint dpfail, jint dppass) { - glStencilOpPROC glStencilOp = (glStencilOpPROC)tlsGetFunction(252); - UNUSED_PARAM(clazz) - glStencilOp(sfail, dpfail, dppass); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglTexImage1D__IIIIIIIJ(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint border, jint format, jint type, jlong pixelsAddress) { - glTexImage1DPROC glTexImage1D = (glTexImage1DPROC)tlsGetFunction(296); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTexImage1D(target, level, internalformat, width, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglTexImage2D__IIIIIIIIJ(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jlong pixelsAddress) { - glTexImage2DPROC glTexImage2D = (glTexImage2DPROC)tlsGetFunction(297); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glCopyTexImage1D(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalFormat, jint x, jint y, jint width, jint border) { - glCopyTexImage1DPROC glCopyTexImage1D = (glCopyTexImage1DPROC)tlsGetFunction(298); - UNUSED_PARAM(clazz) - glCopyTexImage1D(target, level, internalFormat, x, y, width, border); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glCopyTexImage2D(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalFormat, jint x, jint y, jint width, jint height, jint border) { - glCopyTexImage2DPROC glCopyTexImage2D = (glCopyTexImage2DPROC)tlsGetFunction(299); - UNUSED_PARAM(clazz) - glCopyTexImage2D(target, level, internalFormat, x, y, width, height, border); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glCopyTexSubImage1D(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint x, jint y, jint width) { - glCopyTexSubImage1DPROC glCopyTexSubImage1D = (glCopyTexSubImage1DPROC)tlsGetFunction(300); - UNUSED_PARAM(clazz) - glCopyTexSubImage1D(target, level, xoffset, x, y, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glCopyTexSubImage2D(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { - glCopyTexSubImage2DPROC glCopyTexSubImage2D = (glCopyTexSubImage2DPROC)tlsGetFunction(301); - UNUSED_PARAM(clazz) - glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glTexParameteri(JNIEnv *__env, jclass clazz, jint target, jint pname, jint param) { - glTexParameteriPROC glTexParameteri = (glTexParameteriPROC)tlsGetFunction(302); - UNUSED_PARAM(clazz) - glTexParameteri(target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglTexParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glTexParameterivPROC glTexParameteriv = (glTexParameterivPROC)tlsGetFunction(303); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glTexParameterf(JNIEnv *__env, jclass clazz, jint target, jint pname, jfloat param) { - glTexParameterfPROC glTexParameterf = (glTexParameterfPROC)tlsGetFunction(304); - UNUSED_PARAM(clazz) - glTexParameterf(target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglTexParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glTexParameterfvPROC glTexParameterfv = (glTexParameterfvPROC)tlsGetFunction(305); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexParameterfv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglTexSubImage1D__IIIIIIJ(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint width, jint format, jint type, jlong pixelsAddress) { - glTexSubImage1DPROC glTexSubImage1D = (glTexSubImage1DPROC)tlsGetFunction(306); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTexSubImage1D(target, level, xoffset, width, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_nglTexSubImage2D__IIIIIIIIJ(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jlong pixelsAddress) { - glTexSubImage2DPROC glTexSubImage2D = (glTexSubImage2DPROC)tlsGetFunction(307); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL11C_glViewport(JNIEnv *__env, jclass clazz, jint x, jint y, jint w, jint h) { - glViewportPROC glViewport = (glViewportPROC)tlsGetFunction(335); - UNUSED_PARAM(clazz) - glViewport(x, y, w, h); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL12C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL12C.c deleted file mode 100644 index 6815d043..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL12C.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTexImage3DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTexSubImage3DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyTexSubImage3DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glDrawRangeElementsPROC) (jint, jint, jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL12C_nglTexImage3D__IIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jlong pixelsAddress) { - glTexImage3DPROC glTexImage3D = (glTexImage3DPROC)tlsGetFunction(336); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL12C_nglTexSubImage3D__IIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jlong pixelsAddress) { - glTexSubImage3DPROC glTexSubImage3D = (glTexSubImage3DPROC)tlsGetFunction(337); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL12C_glCopyTexSubImage3D(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) { - glCopyTexSubImage3DPROC glCopyTexSubImage3D = (glCopyTexSubImage3DPROC)tlsGetFunction(338); - UNUSED_PARAM(clazz) - glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL12C_nglDrawRangeElements(JNIEnv *__env, jclass clazz, jint mode, jint start, jint end, jint count, jint type, jlong indicesAddress) { - glDrawRangeElementsPROC glDrawRangeElements = (glDrawRangeElementsPROC)tlsGetFunction(339); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawRangeElements(mode, start, end, count, type, indices); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL13.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL13.c deleted file mode 100644 index 303b9fd7..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL13.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glClientActiveTexturePROC) (jint); -typedef void (APIENTRY *glMultiTexCoord1fPROC) (jint, jfloat); -typedef void (APIENTRY *glMultiTexCoord1sPROC) (jint, jshort); -typedef void (APIENTRY *glMultiTexCoord1iPROC) (jint, jint); -typedef void (APIENTRY *glMultiTexCoord1dPROC) (jint, jdouble); -typedef void (APIENTRY *glMultiTexCoord1fvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord1svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord1ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord1dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2fPROC) (jint, jfloat, jfloat); -typedef void (APIENTRY *glMultiTexCoord2sPROC) (jint, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord2iPROC) (jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoord2dPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glMultiTexCoord2fvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3fPROC) (jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glMultiTexCoord3sPROC) (jint, jshort, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord3iPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoord3dPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMultiTexCoord3fvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4fPROC) (jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glMultiTexCoord4sPROC) (jint, jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord4iPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoord4dPROC) (jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glMultiTexCoord4fvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glLoadTransposeMatrixfPROC) (uintptr_t); -typedef void (APIENTRY *glLoadTransposeMatrixdPROC) (uintptr_t); -typedef void (APIENTRY *glMultTransposeMatrixfPROC) (uintptr_t); -typedef void (APIENTRY *glMultTransposeMatrixdPROC) (uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glClientActiveTexture(JNIEnv *__env, jclass clazz, jint texture) { - glClientActiveTexturePROC glClientActiveTexture = (glClientActiveTexturePROC)tlsGetFunction(349); - UNUSED_PARAM(clazz) - glClientActiveTexture(texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord1f(JNIEnv *__env, jclass clazz, jint texture, jfloat s) { - glMultiTexCoord1fPROC glMultiTexCoord1f = (glMultiTexCoord1fPROC)tlsGetFunction(350); - UNUSED_PARAM(clazz) - glMultiTexCoord1f(texture, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord1s(JNIEnv *__env, jclass clazz, jint texture, jshort s) { - glMultiTexCoord1sPROC glMultiTexCoord1s = (glMultiTexCoord1sPROC)tlsGetFunction(351); - UNUSED_PARAM(clazz) - glMultiTexCoord1s(texture, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord1i(JNIEnv *__env, jclass clazz, jint texture, jint s) { - glMultiTexCoord1iPROC glMultiTexCoord1i = (glMultiTexCoord1iPROC)tlsGetFunction(352); - UNUSED_PARAM(clazz) - glMultiTexCoord1i(texture, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord1d(JNIEnv *__env, jclass clazz, jint texture, jdouble s) { - glMultiTexCoord1dPROC glMultiTexCoord1d = (glMultiTexCoord1dPROC)tlsGetFunction(353); - UNUSED_PARAM(clazz) - glMultiTexCoord1d(texture, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord1fv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord1fvPROC glMultiTexCoord1fv = (glMultiTexCoord1fvPROC)tlsGetFunction(354); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1fv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord1sv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord1svPROC glMultiTexCoord1sv = (glMultiTexCoord1svPROC)tlsGetFunction(355); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1sv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord1iv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord1ivPROC glMultiTexCoord1iv = (glMultiTexCoord1ivPROC)tlsGetFunction(356); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1iv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord1dv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord1dvPROC glMultiTexCoord1dv = (glMultiTexCoord1dvPROC)tlsGetFunction(357); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1dv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord2f(JNIEnv *__env, jclass clazz, jint texture, jfloat s, jfloat t) { - glMultiTexCoord2fPROC glMultiTexCoord2f = (glMultiTexCoord2fPROC)tlsGetFunction(358); - UNUSED_PARAM(clazz) - glMultiTexCoord2f(texture, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord2s(JNIEnv *__env, jclass clazz, jint texture, jshort s, jshort t) { - glMultiTexCoord2sPROC glMultiTexCoord2s = (glMultiTexCoord2sPROC)tlsGetFunction(359); - UNUSED_PARAM(clazz) - glMultiTexCoord2s(texture, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord2i(JNIEnv *__env, jclass clazz, jint texture, jint s, jint t) { - glMultiTexCoord2iPROC glMultiTexCoord2i = (glMultiTexCoord2iPROC)tlsGetFunction(360); - UNUSED_PARAM(clazz) - glMultiTexCoord2i(texture, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord2d(JNIEnv *__env, jclass clazz, jint texture, jdouble s, jdouble t) { - glMultiTexCoord2dPROC glMultiTexCoord2d = (glMultiTexCoord2dPROC)tlsGetFunction(361); - UNUSED_PARAM(clazz) - glMultiTexCoord2d(texture, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord2fv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord2fvPROC glMultiTexCoord2fv = (glMultiTexCoord2fvPROC)tlsGetFunction(362); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2fv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord2sv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord2svPROC glMultiTexCoord2sv = (glMultiTexCoord2svPROC)tlsGetFunction(363); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2sv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord2iv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord2ivPROC glMultiTexCoord2iv = (glMultiTexCoord2ivPROC)tlsGetFunction(364); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2iv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord2dv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord2dvPROC glMultiTexCoord2dv = (glMultiTexCoord2dvPROC)tlsGetFunction(365); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2dv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord3f(JNIEnv *__env, jclass clazz, jint texture, jfloat s, jfloat t, jfloat r) { - glMultiTexCoord3fPROC glMultiTexCoord3f = (glMultiTexCoord3fPROC)tlsGetFunction(366); - UNUSED_PARAM(clazz) - glMultiTexCoord3f(texture, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord3s(JNIEnv *__env, jclass clazz, jint texture, jshort s, jshort t, jshort r) { - glMultiTexCoord3sPROC glMultiTexCoord3s = (glMultiTexCoord3sPROC)tlsGetFunction(367); - UNUSED_PARAM(clazz) - glMultiTexCoord3s(texture, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord3i(JNIEnv *__env, jclass clazz, jint texture, jint s, jint t, jint r) { - glMultiTexCoord3iPROC glMultiTexCoord3i = (glMultiTexCoord3iPROC)tlsGetFunction(368); - UNUSED_PARAM(clazz) - glMultiTexCoord3i(texture, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord3d(JNIEnv *__env, jclass clazz, jint texture, jdouble s, jdouble t, jdouble r) { - glMultiTexCoord3dPROC glMultiTexCoord3d = (glMultiTexCoord3dPROC)tlsGetFunction(369); - UNUSED_PARAM(clazz) - glMultiTexCoord3d(texture, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord3fv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord3fvPROC glMultiTexCoord3fv = (glMultiTexCoord3fvPROC)tlsGetFunction(370); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3fv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord3sv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord3svPROC glMultiTexCoord3sv = (glMultiTexCoord3svPROC)tlsGetFunction(371); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3sv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord3iv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord3ivPROC glMultiTexCoord3iv = (glMultiTexCoord3ivPROC)tlsGetFunction(372); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3iv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord3dv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord3dvPROC glMultiTexCoord3dv = (glMultiTexCoord3dvPROC)tlsGetFunction(373); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3dv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord4f(JNIEnv *__env, jclass clazz, jint texture, jfloat s, jfloat t, jfloat r, jfloat q) { - glMultiTexCoord4fPROC glMultiTexCoord4f = (glMultiTexCoord4fPROC)tlsGetFunction(374); - UNUSED_PARAM(clazz) - glMultiTexCoord4f(texture, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord4s(JNIEnv *__env, jclass clazz, jint texture, jshort s, jshort t, jshort r, jshort q) { - glMultiTexCoord4sPROC glMultiTexCoord4s = (glMultiTexCoord4sPROC)tlsGetFunction(375); - UNUSED_PARAM(clazz) - glMultiTexCoord4s(texture, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord4i(JNIEnv *__env, jclass clazz, jint texture, jint s, jint t, jint r, jint q) { - glMultiTexCoord4iPROC glMultiTexCoord4i = (glMultiTexCoord4iPROC)tlsGetFunction(376); - UNUSED_PARAM(clazz) - glMultiTexCoord4i(texture, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_glMultiTexCoord4d(JNIEnv *__env, jclass clazz, jint texture, jdouble s, jdouble t, jdouble r, jdouble q) { - glMultiTexCoord4dPROC glMultiTexCoord4d = (glMultiTexCoord4dPROC)tlsGetFunction(377); - UNUSED_PARAM(clazz) - glMultiTexCoord4d(texture, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord4fv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord4fvPROC glMultiTexCoord4fv = (glMultiTexCoord4fvPROC)tlsGetFunction(378); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4fv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord4sv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord4svPROC glMultiTexCoord4sv = (glMultiTexCoord4svPROC)tlsGetFunction(379); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4sv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord4iv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord4ivPROC glMultiTexCoord4iv = (glMultiTexCoord4ivPROC)tlsGetFunction(380); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4iv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultiTexCoord4dv__IJ(JNIEnv *__env, jclass clazz, jint texture, jlong vAddress) { - glMultiTexCoord4dvPROC glMultiTexCoord4dv = (glMultiTexCoord4dvPROC)tlsGetFunction(381); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4dv(texture, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglLoadTransposeMatrixf__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glLoadTransposeMatrixfPROC glLoadTransposeMatrixf = (glLoadTransposeMatrixfPROC)tlsGetFunction(382); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glLoadTransposeMatrixf(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglLoadTransposeMatrixd__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glLoadTransposeMatrixdPROC glLoadTransposeMatrixd = (glLoadTransposeMatrixdPROC)tlsGetFunction(383); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glLoadTransposeMatrixd(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultTransposeMatrixf__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glMultTransposeMatrixfPROC glMultTransposeMatrixf = (glMultTransposeMatrixfPROC)tlsGetFunction(384); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMultTransposeMatrixf(m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13_nglMultTransposeMatrixd__J(JNIEnv *__env, jclass clazz, jlong mAddress) { - glMultTransposeMatrixdPROC glMultTransposeMatrixd = (glMultTransposeMatrixdPROC)tlsGetFunction(385); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMultTransposeMatrixd(m); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL13C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL13C.c deleted file mode 100644 index 4826dfed..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL13C.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glCompressedTexImage3DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexImage1DPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexSubImage3DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexSubImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTexSubImage1DPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetCompressedTexImagePROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glSampleCoveragePROC) (jfloat, jboolean); -typedef void (APIENTRY *glActiveTexturePROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_nglCompressedTexImage3D(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jlong dataAddress) { - glCompressedTexImage3DPROC glCompressedTexImage3D = (glCompressedTexImage3DPROC)tlsGetFunction(340); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_nglCompressedTexImage2D(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jlong dataAddress) { - glCompressedTexImage2DPROC glCompressedTexImage2D = (glCompressedTexImage2DPROC)tlsGetFunction(341); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_nglCompressedTexImage1D(JNIEnv *__env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint border, jint imageSize, jlong dataAddress) { - glCompressedTexImage1DPROC glCompressedTexImage1D = (glCompressedTexImage1DPROC)tlsGetFunction(342); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_nglCompressedTexSubImage3D(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jlong dataAddress) { - glCompressedTexSubImage3DPROC glCompressedTexSubImage3D = (glCompressedTexSubImage3DPROC)tlsGetFunction(343); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_nglCompressedTexSubImage2D(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jlong dataAddress) { - glCompressedTexSubImage2DPROC glCompressedTexSubImage2D = (glCompressedTexSubImage2DPROC)tlsGetFunction(344); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_nglCompressedTexSubImage1D(JNIEnv *__env, jclass clazz, jint target, jint level, jint xoffset, jint width, jint format, jint imageSize, jlong dataAddress) { - glCompressedTexSubImage1DPROC glCompressedTexSubImage1D = (glCompressedTexSubImage1DPROC)tlsGetFunction(345); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_nglGetCompressedTexImage(JNIEnv *__env, jclass clazz, jint target, jint level, jlong pixelsAddress) { - glGetCompressedTexImagePROC glGetCompressedTexImage = (glGetCompressedTexImagePROC)tlsGetFunction(346); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetCompressedTexImage(target, level, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_glSampleCoverage(JNIEnv *__env, jclass clazz, jfloat value, jboolean invert) { - glSampleCoveragePROC glSampleCoverage = (glSampleCoveragePROC)tlsGetFunction(347); - UNUSED_PARAM(clazz) - glSampleCoverage(value, invert); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL13C_glActiveTexture(JNIEnv *__env, jclass clazz, jint texture) { - glActiveTexturePROC glActiveTexture = (glActiveTexturePROC)tlsGetFunction(348); - UNUSED_PARAM(clazz) - glActiveTexture(texture); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL14.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL14.c deleted file mode 100644 index dc885501..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL14.c +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFogCoordfPROC) (jfloat); -typedef void (APIENTRY *glFogCoorddPROC) (jdouble); -typedef void (APIENTRY *glFogCoordfvPROC) (uintptr_t); -typedef void (APIENTRY *glFogCoorddvPROC) (uintptr_t); -typedef void (APIENTRY *glFogCoordPointerPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glSecondaryColor3bPROC) (jbyte, jbyte, jbyte); -typedef void (APIENTRY *glSecondaryColor3sPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glSecondaryColor3iPROC) (jint, jint, jint); -typedef void (APIENTRY *glSecondaryColor3fPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glSecondaryColor3dPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glSecondaryColor3ubPROC) (uint8_t, uint8_t, uint8_t); -typedef void (APIENTRY *glSecondaryColor3usPROC) (uint16_t, uint16_t, uint16_t); -typedef void (APIENTRY *glSecondaryColor3uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glSecondaryColor3bvPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3svPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3ivPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3fvPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3dvPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3ubvPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3usvPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3uivPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColorPointerPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glWindowPos2iPROC) (jint, jint); -typedef void (APIENTRY *glWindowPos2sPROC) (jshort, jshort); -typedef void (APIENTRY *glWindowPos2fPROC) (jfloat, jfloat); -typedef void (APIENTRY *glWindowPos2dPROC) (jdouble, jdouble); -typedef void (APIENTRY *glWindowPos2ivPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos2svPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos2fvPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos2dvPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos3iPROC) (jint, jint, jint); -typedef void (APIENTRY *glWindowPos3sPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glWindowPos3fPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glWindowPos3dPROC) (jdouble, jdouble, jdouble); -typedef void (APIENTRY *glWindowPos3ivPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos3svPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos3fvPROC) (uintptr_t); -typedef void (APIENTRY *glWindowPos3dvPROC) (uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glFogCoordf(JNIEnv *__env, jclass clazz, jfloat coord) { - glFogCoordfPROC glFogCoordf = (glFogCoordfPROC)tlsGetFunction(388); - UNUSED_PARAM(clazz) - glFogCoordf(coord); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glFogCoordd(JNIEnv *__env, jclass clazz, jdouble coord) { - glFogCoorddPROC glFogCoordd = (glFogCoorddPROC)tlsGetFunction(389); - UNUSED_PARAM(clazz) - glFogCoordd(coord); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoordfv__J(JNIEnv *__env, jclass clazz, jlong coordAddress) { - glFogCoordfvPROC glFogCoordfv = (glFogCoordfvPROC)tlsGetFunction(390); - uintptr_t coord = (uintptr_t)coordAddress; - UNUSED_PARAM(clazz) - glFogCoordfv(coord); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoorddv__J(JNIEnv *__env, jclass clazz, jlong coordAddress) { - glFogCoorddvPROC glFogCoorddv = (glFogCoorddvPROC)tlsGetFunction(391); - uintptr_t coord = (uintptr_t)coordAddress; - UNUSED_PARAM(clazz) - glFogCoorddv(coord); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglFogCoordPointer(JNIEnv *__env, jclass clazz, jint type, jint stride, jlong pointerAddress) { - glFogCoordPointerPROC glFogCoordPointer = (glFogCoordPointerPROC)tlsGetFunction(392); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glFogCoordPointer(type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3b(JNIEnv *__env, jclass clazz, jbyte red, jbyte green, jbyte blue) { - glSecondaryColor3bPROC glSecondaryColor3b = (glSecondaryColor3bPROC)tlsGetFunction(399); - UNUSED_PARAM(clazz) - glSecondaryColor3b(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3s(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue) { - glSecondaryColor3sPROC glSecondaryColor3s = (glSecondaryColor3sPROC)tlsGetFunction(400); - UNUSED_PARAM(clazz) - glSecondaryColor3s(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3i(JNIEnv *__env, jclass clazz, jint red, jint green, jint blue) { - glSecondaryColor3iPROC glSecondaryColor3i = (glSecondaryColor3iPROC)tlsGetFunction(401); - UNUSED_PARAM(clazz) - glSecondaryColor3i(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3f(JNIEnv *__env, jclass clazz, jfloat red, jfloat green, jfloat blue) { - glSecondaryColor3fPROC glSecondaryColor3f = (glSecondaryColor3fPROC)tlsGetFunction(402); - UNUSED_PARAM(clazz) - glSecondaryColor3f(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3d(JNIEnv *__env, jclass clazz, jdouble red, jdouble green, jdouble blue) { - glSecondaryColor3dPROC glSecondaryColor3d = (glSecondaryColor3dPROC)tlsGetFunction(403); - UNUSED_PARAM(clazz) - glSecondaryColor3d(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3ub(JNIEnv *__env, jclass clazz, jbyte red, jbyte green, jbyte blue) { - glSecondaryColor3ubPROC glSecondaryColor3ub = (glSecondaryColor3ubPROC)tlsGetFunction(404); - UNUSED_PARAM(clazz) - glSecondaryColor3ub((uint8_t)red, (uint8_t)green, (uint8_t)blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3us(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue) { - glSecondaryColor3usPROC glSecondaryColor3us = (glSecondaryColor3usPROC)tlsGetFunction(405); - UNUSED_PARAM(clazz) - glSecondaryColor3us((uint16_t)red, (uint16_t)green, (uint16_t)blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glSecondaryColor3ui(JNIEnv *__env, jclass clazz, jint red, jint green, jint blue) { - glSecondaryColor3uiPROC glSecondaryColor3ui = (glSecondaryColor3uiPROC)tlsGetFunction(406); - UNUSED_PARAM(clazz) - glSecondaryColor3ui(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColor3bv(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3bvPROC glSecondaryColor3bv = (glSecondaryColor3bvPROC)tlsGetFunction(407); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3bv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColor3sv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3svPROC glSecondaryColor3sv = (glSecondaryColor3svPROC)tlsGetFunction(408); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3sv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColor3iv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3ivPROC glSecondaryColor3iv = (glSecondaryColor3ivPROC)tlsGetFunction(409); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3iv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColor3fv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3fvPROC glSecondaryColor3fv = (glSecondaryColor3fvPROC)tlsGetFunction(410); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3fv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColor3dv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3dvPROC glSecondaryColor3dv = (glSecondaryColor3dvPROC)tlsGetFunction(411); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3dv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColor3ubv(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3ubvPROC glSecondaryColor3ubv = (glSecondaryColor3ubvPROC)tlsGetFunction(412); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3ubv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColor3usv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3usvPROC glSecondaryColor3usv = (glSecondaryColor3usvPROC)tlsGetFunction(413); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3usv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColor3uiv__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3uivPROC glSecondaryColor3uiv = (glSecondaryColor3uivPROC)tlsGetFunction(414); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3uiv(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglSecondaryColorPointer(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride, jlong pointerAddress) { - glSecondaryColorPointerPROC glSecondaryColorPointer = (glSecondaryColorPointerPROC)tlsGetFunction(415); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glSecondaryColorPointer(size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos2i(JNIEnv *__env, jclass clazz, jint x, jint y) { - glWindowPos2iPROC glWindowPos2i = (glWindowPos2iPROC)tlsGetFunction(417); - UNUSED_PARAM(clazz) - glWindowPos2i(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos2s(JNIEnv *__env, jclass clazz, jshort x, jshort y) { - glWindowPos2sPROC glWindowPos2s = (glWindowPos2sPROC)tlsGetFunction(418); - UNUSED_PARAM(clazz) - glWindowPos2s(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos2f(JNIEnv *__env, jclass clazz, jfloat x, jfloat y) { - glWindowPos2fPROC glWindowPos2f = (glWindowPos2fPROC)tlsGetFunction(419); - UNUSED_PARAM(clazz) - glWindowPos2f(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos2d(JNIEnv *__env, jclass clazz, jdouble x, jdouble y) { - glWindowPos2dPROC glWindowPos2d = (glWindowPos2dPROC)tlsGetFunction(420); - UNUSED_PARAM(clazz) - glWindowPos2d(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglWindowPos2iv__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos2ivPROC glWindowPos2iv = (glWindowPos2ivPROC)tlsGetFunction(421); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos2iv(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglWindowPos2sv__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos2svPROC glWindowPos2sv = (glWindowPos2svPROC)tlsGetFunction(422); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos2sv(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglWindowPos2fv__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos2fvPROC glWindowPos2fv = (glWindowPos2fvPROC)tlsGetFunction(423); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos2fv(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglWindowPos2dv__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos2dvPROC glWindowPos2dv = (glWindowPos2dvPROC)tlsGetFunction(424); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos2dv(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos3i(JNIEnv *__env, jclass clazz, jint x, jint y, jint z) { - glWindowPos3iPROC glWindowPos3i = (glWindowPos3iPROC)tlsGetFunction(425); - UNUSED_PARAM(clazz) - glWindowPos3i(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos3s(JNIEnv *__env, jclass clazz, jshort x, jshort y, jshort z) { - glWindowPos3sPROC glWindowPos3s = (glWindowPos3sPROC)tlsGetFunction(426); - UNUSED_PARAM(clazz) - glWindowPos3s(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos3f(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z) { - glWindowPos3fPROC glWindowPos3f = (glWindowPos3fPROC)tlsGetFunction(427); - UNUSED_PARAM(clazz) - glWindowPos3f(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_glWindowPos3d(JNIEnv *__env, jclass clazz, jdouble x, jdouble y, jdouble z) { - glWindowPos3dPROC glWindowPos3d = (glWindowPos3dPROC)tlsGetFunction(428); - UNUSED_PARAM(clazz) - glWindowPos3d(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglWindowPos3iv__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos3ivPROC glWindowPos3iv = (glWindowPos3ivPROC)tlsGetFunction(429); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos3iv(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglWindowPos3sv__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos3svPROC glWindowPos3sv = (glWindowPos3svPROC)tlsGetFunction(430); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos3sv(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglWindowPos3fv__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos3fvPROC glWindowPos3fv = (glWindowPos3fvPROC)tlsGetFunction(431); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos3fv(p); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14_nglWindowPos3dv__J(JNIEnv *__env, jclass clazz, jlong pAddress) { - glWindowPos3dvPROC glWindowPos3dv = (glWindowPos3dvPROC)tlsGetFunction(432); - uintptr_t p = (uintptr_t)pAddress; - UNUSED_PARAM(clazz) - glWindowPos3dv(p); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL14C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL14C.c deleted file mode 100644 index 82843aff..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL14C.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendColorPROC) (jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glBlendEquationPROC) (jint); -typedef void (APIENTRY *glMultiDrawArraysPROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glMultiDrawElementsPROC) (jint, uintptr_t, jint, uintptr_t, jint); -typedef void (APIENTRY *glPointParameterfPROC) (jint, jfloat); -typedef void (APIENTRY *glPointParameteriPROC) (jint, jint); -typedef void (APIENTRY *glPointParameterfvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glPointParameterivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glBlendFuncSeparatePROC) (jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_glBlendColor(JNIEnv *__env, jclass clazz, jfloat red, jfloat green, jfloat blue, jfloat alpha) { - glBlendColorPROC glBlendColor = (glBlendColorPROC)tlsGetFunction(386); - UNUSED_PARAM(clazz) - glBlendColor(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_glBlendEquation(JNIEnv *__env, jclass clazz, jint mode) { - glBlendEquationPROC glBlendEquation = (glBlendEquationPROC)tlsGetFunction(387); - UNUSED_PARAM(clazz) - glBlendEquation(mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_nglMultiDrawArrays__IJJI(JNIEnv *__env, jclass clazz, jint mode, jlong firstAddress, jlong countAddress, jint drawcount) { - glMultiDrawArraysPROC glMultiDrawArrays = (glMultiDrawArraysPROC)tlsGetFunction(393); - uintptr_t first = (uintptr_t)firstAddress; - uintptr_t count = (uintptr_t)countAddress; - UNUSED_PARAM(clazz) - glMultiDrawArrays(mode, first, count, drawcount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_nglMultiDrawElements__IJIJI(JNIEnv *__env, jclass clazz, jint mode, jlong countAddress, jint type, jlong indicesAddress, jint drawcount) { - glMultiDrawElementsPROC glMultiDrawElements = (glMultiDrawElementsPROC)tlsGetFunction(394); - uintptr_t count = (uintptr_t)countAddress; - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glMultiDrawElements(mode, count, type, indices, drawcount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_glPointParameterf(JNIEnv *__env, jclass clazz, jint pname, jfloat param) { - glPointParameterfPROC glPointParameterf = (glPointParameterfPROC)tlsGetFunction(395); - UNUSED_PARAM(clazz) - glPointParameterf(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_glPointParameteri(JNIEnv *__env, jclass clazz, jint pname, jint param) { - glPointParameteriPROC glPointParameteri = (glPointParameteriPROC)tlsGetFunction(396); - UNUSED_PARAM(clazz) - glPointParameteri(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_nglPointParameterfv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glPointParameterfvPROC glPointParameterfv = (glPointParameterfvPROC)tlsGetFunction(397); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glPointParameterfv(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_nglPointParameteriv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glPointParameterivPROC glPointParameteriv = (glPointParameterivPROC)tlsGetFunction(398); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glPointParameteriv(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_glBlendFuncSeparate(JNIEnv *__env, jclass clazz, jint sfactorRGB, jint dfactorRGB, jint sfactorAlpha, jint dfactorAlpha) { - glBlendFuncSeparatePROC glBlendFuncSeparate = (glBlendFuncSeparatePROC)tlsGetFunction(416); - UNUSED_PARAM(clazz) - glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL15C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL15C.c deleted file mode 100644 index 354ef987..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL15C.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBindBufferPROC) (jint, jint); -typedef void (APIENTRY *glDeleteBuffersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenBuffersPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsBufferPROC) (jint); -typedef void (APIENTRY *glBufferDataPROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glBufferSubDataPROC) (jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetBufferSubDataPROC) (jint, uintptr_t, uintptr_t, uintptr_t); -typedef uintptr_t (APIENTRY *glMapBufferPROC) (jint, jint); -typedef jboolean (APIENTRY *glUnmapBufferPROC) (jint); -typedef void (APIENTRY *glGetBufferParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetBufferPointervPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGenQueriesPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeleteQueriesPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsQueryPROC) (jint); -typedef void (APIENTRY *glBeginQueryPROC) (jint, jint); -typedef void (APIENTRY *glEndQueryPROC) (jint); -typedef void (APIENTRY *glGetQueryivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryObjectivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryObjectuivPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_glBindBuffer(JNIEnv *__env, jclass clazz, jint target, jint buffer) { - glBindBufferPROC glBindBuffer = (glBindBufferPROC)tlsGetFunction(433); - UNUSED_PARAM(clazz) - glBindBuffer(target, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglDeleteBuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong buffersAddress) { - glDeleteBuffersPROC glDeleteBuffers = (glDeleteBuffersPROC)tlsGetFunction(434); - uintptr_t buffers = (uintptr_t)buffersAddress; - UNUSED_PARAM(clazz) - glDeleteBuffers(n, buffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglGenBuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong buffersAddress) { - glGenBuffersPROC glGenBuffers = (glGenBuffersPROC)tlsGetFunction(435); - uintptr_t buffers = (uintptr_t)buffersAddress; - UNUSED_PARAM(clazz) - glGenBuffers(n, buffers); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL15C_glIsBuffer(JNIEnv *__env, jclass clazz, jint buffer) { - glIsBufferPROC glIsBuffer = (glIsBufferPROC)tlsGetFunction(436); - UNUSED_PARAM(clazz) - return glIsBuffer(buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglBufferData__IJJI(JNIEnv *__env, jclass clazz, jint target, jlong size, jlong dataAddress, jint usage) { - glBufferDataPROC glBufferData = (glBufferDataPROC)tlsGetFunction(437); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glBufferData(target, (uintptr_t)size, data, usage); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglBufferSubData__IJJJ(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong size, jlong dataAddress) { - glBufferSubDataPROC glBufferSubData = (glBufferSubDataPROC)tlsGetFunction(438); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glBufferSubData(target, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglGetBufferSubData__IJJJ(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong size, jlong dataAddress) { - glGetBufferSubDataPROC glGetBufferSubData = (glGetBufferSubDataPROC)tlsGetFunction(439); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetBufferSubData(target, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GL15C_nglMapBuffer(JNIEnv *__env, jclass clazz, jint target, jint access) { - glMapBufferPROC glMapBuffer = (glMapBufferPROC)tlsGetFunction(440); - UNUSED_PARAM(clazz) - return (jlong)glMapBuffer(target, access); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL15C_glUnmapBuffer(JNIEnv *__env, jclass clazz, jint target) { - glUnmapBufferPROC glUnmapBuffer = (glUnmapBufferPROC)tlsGetFunction(441); - UNUSED_PARAM(clazz) - return glUnmapBuffer(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglGetBufferParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetBufferParameterivPROC glGetBufferParameteriv = (glGetBufferParameterivPROC)tlsGetFunction(442); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetBufferParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglGetBufferPointerv(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetBufferPointervPROC glGetBufferPointerv = (glGetBufferPointervPROC)tlsGetFunction(443); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetBufferPointerv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglGenQueries__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glGenQueriesPROC glGenQueries = (glGenQueriesPROC)tlsGetFunction(444); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glGenQueries(n, ids); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglDeleteQueries__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glDeleteQueriesPROC glDeleteQueries = (glDeleteQueriesPROC)tlsGetFunction(445); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glDeleteQueries(n, ids); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL15C_glIsQuery(JNIEnv *__env, jclass clazz, jint id) { - glIsQueryPROC glIsQuery = (glIsQueryPROC)tlsGetFunction(446); - UNUSED_PARAM(clazz) - return glIsQuery(id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_glBeginQuery(JNIEnv *__env, jclass clazz, jint target, jint id) { - glBeginQueryPROC glBeginQuery = (glBeginQueryPROC)tlsGetFunction(447); - UNUSED_PARAM(clazz) - glBeginQuery(target, id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_glEndQuery(JNIEnv *__env, jclass clazz, jint target) { - glEndQueryPROC glEndQuery = (glEndQueryPROC)tlsGetFunction(448); - UNUSED_PARAM(clazz) - glEndQuery(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglGetQueryiv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetQueryivPROC glGetQueryiv = (glGetQueryivPROC)tlsGetFunction(449); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryiv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglGetQueryObjectiv__IIJ(JNIEnv *__env, jclass clazz, jint id, jint pname, jlong paramsAddress) { - glGetQueryObjectivPROC glGetQueryObjectiv = (glGetQueryObjectivPROC)tlsGetFunction(450); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryObjectiv(id, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL15C_nglGetQueryObjectuiv__IIJ(JNIEnv *__env, jclass clazz, jint id, jint pname, jlong paramsAddress) { - glGetQueryObjectuivPROC glGetQueryObjectuiv = (glGetQueryObjectuivPROC)tlsGetFunction(451); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryObjectuiv(id, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL20C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL20C.c deleted file mode 100644 index 712e8e3c..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL20C.c +++ /dev/null @@ -1,728 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jint (APIENTRY *glCreateProgramPROC) (void); -typedef void (APIENTRY *glDeleteProgramPROC) (jint); -typedef jboolean (APIENTRY *glIsProgramPROC) (jint); -typedef jint (APIENTRY *glCreateShaderPROC) (jint); -typedef void (APIENTRY *glDeleteShaderPROC) (jint); -typedef jboolean (APIENTRY *glIsShaderPROC) (jint); -typedef void (APIENTRY *glAttachShaderPROC) (jint, jint); -typedef void (APIENTRY *glDetachShaderPROC) (jint, jint); -typedef void (APIENTRY *glShaderSourcePROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glCompileShaderPROC) (jint); -typedef void (APIENTRY *glLinkProgramPROC) (jint); -typedef void (APIENTRY *glUseProgramPROC) (jint); -typedef void (APIENTRY *glValidateProgramPROC) (jint); -typedef void (APIENTRY *glUniform1fPROC) (jint, jfloat); -typedef void (APIENTRY *glUniform2fPROC) (jint, jfloat, jfloat); -typedef void (APIENTRY *glUniform3fPROC) (jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glUniform4fPROC) (jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glUniform1iPROC) (jint, jint); -typedef void (APIENTRY *glUniform2iPROC) (jint, jint, jint); -typedef void (APIENTRY *glUniform3iPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glUniform4iPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glUniform1fvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2fvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3fvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4fvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform1ivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2ivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3ivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4ivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniformMatrix2fvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix3fvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix4fvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glGetShaderivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetShaderInfoLogPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetProgramInfoLogPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetAttachedShadersPROC) (jint, jint, uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetUniformLocationPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetActiveUniformPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetUniformfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetShaderSourcePROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glVertexAttrib1fPROC) (jint, jfloat); -typedef void (APIENTRY *glVertexAttrib1sPROC) (jint, jshort); -typedef void (APIENTRY *glVertexAttrib1dPROC) (jint, jdouble); -typedef void (APIENTRY *glVertexAttrib2fPROC) (jint, jfloat, jfloat); -typedef void (APIENTRY *glVertexAttrib2sPROC) (jint, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib2dPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttrib3fPROC) (jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glVertexAttrib3sPROC) (jint, jshort, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib3dPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttrib4fPROC) (jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glVertexAttrib4sPROC) (jint, jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib4dPROC) (jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttrib4NubPROC) (jint, uint8_t, uint8_t, uint8_t, uint8_t); -typedef void (APIENTRY *glVertexAttrib1fvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib1svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib1dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib2fvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib2svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib2dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib3fvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib3svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib3dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4fvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4bvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4ubvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4usvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NbvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NsvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NubvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NusvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4NuivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribPointerPROC) (jint, jint, jint, jboolean, jint, uintptr_t); -typedef void (APIENTRY *glEnableVertexAttribArrayPROC) (jint); -typedef void (APIENTRY *glDisableVertexAttribArrayPROC) (jint); -typedef void (APIENTRY *glBindAttribLocationPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetActiveAttribPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetAttribLocationPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribdvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribPointervPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glDrawBuffersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glBlendEquationSeparatePROC) (jint, jint); -typedef void (APIENTRY *glStencilOpSeparatePROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glStencilFuncSeparatePROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glStencilMaskSeparatePROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20C_glCreateProgram(JNIEnv *__env, jclass clazz) { - glCreateProgramPROC glCreateProgram = (glCreateProgramPROC)tlsGetFunction(452); - UNUSED_PARAM(clazz) - return glCreateProgram(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glDeleteProgram(JNIEnv *__env, jclass clazz, jint program) { - glDeleteProgramPROC glDeleteProgram = (glDeleteProgramPROC)tlsGetFunction(453); - UNUSED_PARAM(clazz) - glDeleteProgram(program); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL20C_glIsProgram(JNIEnv *__env, jclass clazz, jint program) { - glIsProgramPROC glIsProgram = (glIsProgramPROC)tlsGetFunction(454); - UNUSED_PARAM(clazz) - return glIsProgram(program); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20C_glCreateShader(JNIEnv *__env, jclass clazz, jint type) { - glCreateShaderPROC glCreateShader = (glCreateShaderPROC)tlsGetFunction(455); - UNUSED_PARAM(clazz) - return glCreateShader(type); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glDeleteShader(JNIEnv *__env, jclass clazz, jint shader) { - glDeleteShaderPROC glDeleteShader = (glDeleteShaderPROC)tlsGetFunction(456); - UNUSED_PARAM(clazz) - glDeleteShader(shader); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL20C_glIsShader(JNIEnv *__env, jclass clazz, jint shader) { - glIsShaderPROC glIsShader = (glIsShaderPROC)tlsGetFunction(457); - UNUSED_PARAM(clazz) - return glIsShader(shader); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glAttachShader(JNIEnv *__env, jclass clazz, jint program, jint shader) { - glAttachShaderPROC glAttachShader = (glAttachShaderPROC)tlsGetFunction(458); - UNUSED_PARAM(clazz) - glAttachShader(program, shader); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glDetachShader(JNIEnv *__env, jclass clazz, jint program, jint shader) { - glDetachShaderPROC glDetachShader = (glDetachShaderPROC)tlsGetFunction(459); - UNUSED_PARAM(clazz) - glDetachShader(program, shader); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglShaderSource__IIJJ(JNIEnv *__env, jclass clazz, jint shader, jint count, jlong stringsAddress, jlong lengthAddress) { - glShaderSourcePROC glShaderSource = (glShaderSourcePROC)tlsGetFunction(460); - uintptr_t strings = (uintptr_t)stringsAddress; - uintptr_t length = (uintptr_t)lengthAddress; - UNUSED_PARAM(clazz) - glShaderSource(shader, count, strings, length); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glCompileShader(JNIEnv *__env, jclass clazz, jint shader) { - glCompileShaderPROC glCompileShader = (glCompileShaderPROC)tlsGetFunction(461); - UNUSED_PARAM(clazz) - glCompileShader(shader); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glLinkProgram(JNIEnv *__env, jclass clazz, jint program) { - glLinkProgramPROC glLinkProgram = (glLinkProgramPROC)tlsGetFunction(462); - UNUSED_PARAM(clazz) - glLinkProgram(program); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUseProgram(JNIEnv *__env, jclass clazz, jint program) { - glUseProgramPROC glUseProgram = (glUseProgramPROC)tlsGetFunction(463); - UNUSED_PARAM(clazz) - glUseProgram(program); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glValidateProgram(JNIEnv *__env, jclass clazz, jint program) { - glValidateProgramPROC glValidateProgram = (glValidateProgramPROC)tlsGetFunction(464); - UNUSED_PARAM(clazz) - glValidateProgram(program); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUniform1f(JNIEnv *__env, jclass clazz, jint location, jfloat v0) { - glUniform1fPROC glUniform1f = (glUniform1fPROC)tlsGetFunction(465); - UNUSED_PARAM(clazz) - glUniform1f(location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUniform2f(JNIEnv *__env, jclass clazz, jint location, jfloat v0, jfloat v1) { - glUniform2fPROC glUniform2f = (glUniform2fPROC)tlsGetFunction(466); - UNUSED_PARAM(clazz) - glUniform2f(location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUniform3f(JNIEnv *__env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2) { - glUniform3fPROC glUniform3f = (glUniform3fPROC)tlsGetFunction(467); - UNUSED_PARAM(clazz) - glUniform3f(location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUniform4f(JNIEnv *__env, jclass clazz, jint location, jfloat v0, jfloat v1, jfloat v2, jfloat v3) { - glUniform4fPROC glUniform4f = (glUniform4fPROC)tlsGetFunction(468); - UNUSED_PARAM(clazz) - glUniform4f(location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUniform1i(JNIEnv *__env, jclass clazz, jint location, jint v0) { - glUniform1iPROC glUniform1i = (glUniform1iPROC)tlsGetFunction(469); - UNUSED_PARAM(clazz) - glUniform1i(location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUniform2i(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1) { - glUniform2iPROC glUniform2i = (glUniform2iPROC)tlsGetFunction(470); - UNUSED_PARAM(clazz) - glUniform2i(location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUniform3i(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1, jint v2) { - glUniform3iPROC glUniform3i = (glUniform3iPROC)tlsGetFunction(471); - UNUSED_PARAM(clazz) - glUniform3i(location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glUniform4i(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1, jint v2, jint v3) { - glUniform4iPROC glUniform4i = (glUniform4iPROC)tlsGetFunction(472); - UNUSED_PARAM(clazz) - glUniform4i(location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniform1fv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1fvPROC glUniform1fv = (glUniform1fvPROC)tlsGetFunction(473); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1fv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniform2fv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2fvPROC glUniform2fv = (glUniform2fvPROC)tlsGetFunction(474); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2fv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniform3fv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3fvPROC glUniform3fv = (glUniform3fvPROC)tlsGetFunction(475); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3fv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniform4fv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4fvPROC glUniform4fv = (glUniform4fvPROC)tlsGetFunction(476); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4fv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniform1iv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1ivPROC glUniform1iv = (glUniform1ivPROC)tlsGetFunction(477); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1iv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniform2iv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2ivPROC glUniform2iv = (glUniform2ivPROC)tlsGetFunction(478); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2iv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniform3iv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3ivPROC glUniform3iv = (glUniform3ivPROC)tlsGetFunction(479); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3iv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniform4iv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4ivPROC glUniform4iv = (glUniform4ivPROC)tlsGetFunction(480); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4iv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniformMatrix2fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix2fvPROC glUniformMatrix2fv = (glUniformMatrix2fvPROC)tlsGetFunction(481); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix2fv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniformMatrix3fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix3fvPROC glUniformMatrix3fv = (glUniformMatrix3fvPROC)tlsGetFunction(482); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix3fv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglUniformMatrix4fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix4fvPROC glUniformMatrix4fv = (glUniformMatrix4fvPROC)tlsGetFunction(483); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix4fv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetShaderiv__IIJ(JNIEnv *__env, jclass clazz, jint shader, jint pname, jlong paramsAddress) { - glGetShaderivPROC glGetShaderiv = (glGetShaderivPROC)tlsGetFunction(484); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetShaderiv(shader, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetProgramiv__IIJ(JNIEnv *__env, jclass clazz, jint program, jint pname, jlong paramsAddress) { - glGetProgramivPROC glGetProgramiv = (glGetProgramivPROC)tlsGetFunction(485); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramiv(program, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetShaderInfoLog__IIJJ(JNIEnv *__env, jclass clazz, jint shader, jint maxLength, jlong lengthAddress, jlong infoLogAddress) { - glGetShaderInfoLogPROC glGetShaderInfoLog = (glGetShaderInfoLogPROC)tlsGetFunction(486); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t infoLog = (uintptr_t)infoLogAddress; - UNUSED_PARAM(clazz) - glGetShaderInfoLog(shader, maxLength, length, infoLog); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetProgramInfoLog__IIJJ(JNIEnv *__env, jclass clazz, jint program, jint maxLength, jlong lengthAddress, jlong infoLogAddress) { - glGetProgramInfoLogPROC glGetProgramInfoLog = (glGetProgramInfoLogPROC)tlsGetFunction(487); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t infoLog = (uintptr_t)infoLogAddress; - UNUSED_PARAM(clazz) - glGetProgramInfoLog(program, maxLength, length, infoLog); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetAttachedShaders__IIJJ(JNIEnv *__env, jclass clazz, jint program, jint maxCount, jlong countAddress, jlong shadersAddress) { - glGetAttachedShadersPROC glGetAttachedShaders = (glGetAttachedShadersPROC)tlsGetFunction(488); - uintptr_t count = (uintptr_t)countAddress; - uintptr_t shaders = (uintptr_t)shadersAddress; - UNUSED_PARAM(clazz) - glGetAttachedShaders(program, maxCount, count, shaders); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20C_nglGetUniformLocation(JNIEnv *__env, jclass clazz, jint program, jlong nameAddress) { - glGetUniformLocationPROC glGetUniformLocation = (glGetUniformLocationPROC)tlsGetFunction(489); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetUniformLocation(program, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetActiveUniform__IIIJJJJ(JNIEnv *__env, jclass clazz, jint program, jint index, jint maxLength, jlong lengthAddress, jlong sizeAddress, jlong typeAddress, jlong nameAddress) { - glGetActiveUniformPROC glGetActiveUniform = (glGetActiveUniformPROC)tlsGetFunction(490); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t size = (uintptr_t)sizeAddress; - uintptr_t type = (uintptr_t)typeAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetActiveUniform(program, index, maxLength, length, size, type, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetUniformfv__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformfvPROC glGetUniformfv = (glGetUniformfvPROC)tlsGetFunction(491); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformfv(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetUniformiv__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformivPROC glGetUniformiv = (glGetUniformivPROC)tlsGetFunction(492); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformiv(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetShaderSource__IIJJ(JNIEnv *__env, jclass clazz, jint shader, jint maxLength, jlong lengthAddress, jlong sourceAddress) { - glGetShaderSourcePROC glGetShaderSource = (glGetShaderSourcePROC)tlsGetFunction(493); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t source = (uintptr_t)sourceAddress; - UNUSED_PARAM(clazz) - glGetShaderSource(shader, maxLength, length, source); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib1f(JNIEnv *__env, jclass clazz, jint index, jfloat v0) { - glVertexAttrib1fPROC glVertexAttrib1f = (glVertexAttrib1fPROC)tlsGetFunction(494); - UNUSED_PARAM(clazz) - glVertexAttrib1f(index, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib1s(JNIEnv *__env, jclass clazz, jint index, jshort v0) { - glVertexAttrib1sPROC glVertexAttrib1s = (glVertexAttrib1sPROC)tlsGetFunction(495); - UNUSED_PARAM(clazz) - glVertexAttrib1s(index, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib1d(JNIEnv *__env, jclass clazz, jint index, jdouble v0) { - glVertexAttrib1dPROC glVertexAttrib1d = (glVertexAttrib1dPROC)tlsGetFunction(496); - UNUSED_PARAM(clazz) - glVertexAttrib1d(index, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib2f(JNIEnv *__env, jclass clazz, jint index, jfloat v0, jfloat v1) { - glVertexAttrib2fPROC glVertexAttrib2f = (glVertexAttrib2fPROC)tlsGetFunction(497); - UNUSED_PARAM(clazz) - glVertexAttrib2f(index, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib2s(JNIEnv *__env, jclass clazz, jint index, jshort v0, jshort v1) { - glVertexAttrib2sPROC glVertexAttrib2s = (glVertexAttrib2sPROC)tlsGetFunction(498); - UNUSED_PARAM(clazz) - glVertexAttrib2s(index, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib2d(JNIEnv *__env, jclass clazz, jint index, jdouble v0, jdouble v1) { - glVertexAttrib2dPROC glVertexAttrib2d = (glVertexAttrib2dPROC)tlsGetFunction(499); - UNUSED_PARAM(clazz) - glVertexAttrib2d(index, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib3f(JNIEnv *__env, jclass clazz, jint index, jfloat v0, jfloat v1, jfloat v2) { - glVertexAttrib3fPROC glVertexAttrib3f = (glVertexAttrib3fPROC)tlsGetFunction(500); - UNUSED_PARAM(clazz) - glVertexAttrib3f(index, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib3s(JNIEnv *__env, jclass clazz, jint index, jshort v0, jshort v1, jshort v2) { - glVertexAttrib3sPROC glVertexAttrib3s = (glVertexAttrib3sPROC)tlsGetFunction(501); - UNUSED_PARAM(clazz) - glVertexAttrib3s(index, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib3d(JNIEnv *__env, jclass clazz, jint index, jdouble v0, jdouble v1, jdouble v2) { - glVertexAttrib3dPROC glVertexAttrib3d = (glVertexAttrib3dPROC)tlsGetFunction(502); - UNUSED_PARAM(clazz) - glVertexAttrib3d(index, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib4f(JNIEnv *__env, jclass clazz, jint index, jfloat v0, jfloat v1, jfloat v2, jfloat v3) { - glVertexAttrib4fPROC glVertexAttrib4f = (glVertexAttrib4fPROC)tlsGetFunction(503); - UNUSED_PARAM(clazz) - glVertexAttrib4f(index, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib4s(JNIEnv *__env, jclass clazz, jint index, jshort v0, jshort v1, jshort v2, jshort v3) { - glVertexAttrib4sPROC glVertexAttrib4s = (glVertexAttrib4sPROC)tlsGetFunction(504); - UNUSED_PARAM(clazz) - glVertexAttrib4s(index, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib4d(JNIEnv *__env, jclass clazz, jint index, jdouble v0, jdouble v1, jdouble v2, jdouble v3) { - glVertexAttrib4dPROC glVertexAttrib4d = (glVertexAttrib4dPROC)tlsGetFunction(505); - UNUSED_PARAM(clazz) - glVertexAttrib4d(index, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glVertexAttrib4Nub(JNIEnv *__env, jclass clazz, jint index, jbyte x, jbyte y, jbyte z, jbyte w) { - glVertexAttrib4NubPROC glVertexAttrib4Nub = (glVertexAttrib4NubPROC)tlsGetFunction(506); - UNUSED_PARAM(clazz) - glVertexAttrib4Nub(index, (uint8_t)x, (uint8_t)y, (uint8_t)z, (uint8_t)w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib1fv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib1fvPROC glVertexAttrib1fv = (glVertexAttrib1fvPROC)tlsGetFunction(507); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib1fv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib1sv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib1svPROC glVertexAttrib1sv = (glVertexAttrib1svPROC)tlsGetFunction(508); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib1sv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib1dv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib1dvPROC glVertexAttrib1dv = (glVertexAttrib1dvPROC)tlsGetFunction(509); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib1dv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib2fv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib2fvPROC glVertexAttrib2fv = (glVertexAttrib2fvPROC)tlsGetFunction(510); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib2fv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib2sv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib2svPROC glVertexAttrib2sv = (glVertexAttrib2svPROC)tlsGetFunction(511); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib2sv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib2dv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib2dvPROC glVertexAttrib2dv = (glVertexAttrib2dvPROC)tlsGetFunction(512); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib2dv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib3fv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib3fvPROC glVertexAttrib3fv = (glVertexAttrib3fvPROC)tlsGetFunction(513); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib3fv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib3sv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib3svPROC glVertexAttrib3sv = (glVertexAttrib3svPROC)tlsGetFunction(514); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib3sv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib3dv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib3dvPROC glVertexAttrib3dv = (glVertexAttrib3dvPROC)tlsGetFunction(515); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib3dv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4fv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4fvPROC glVertexAttrib4fv = (glVertexAttrib4fvPROC)tlsGetFunction(516); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4fv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4sv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4svPROC glVertexAttrib4sv = (glVertexAttrib4svPROC)tlsGetFunction(517); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4sv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4dv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4dvPROC glVertexAttrib4dv = (glVertexAttrib4dvPROC)tlsGetFunction(518); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4dv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4iv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4ivPROC glVertexAttrib4iv = (glVertexAttrib4ivPROC)tlsGetFunction(519); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4iv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4bv(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4bvPROC glVertexAttrib4bv = (glVertexAttrib4bvPROC)tlsGetFunction(520); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4bv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4ubv(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4ubvPROC glVertexAttrib4ubv = (glVertexAttrib4ubvPROC)tlsGetFunction(521); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4ubv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4usv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4usvPROC glVertexAttrib4usv = (glVertexAttrib4usvPROC)tlsGetFunction(522); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4usv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4uiv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4uivPROC glVertexAttrib4uiv = (glVertexAttrib4uivPROC)tlsGetFunction(523); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4uiv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4Nbv(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NbvPROC glVertexAttrib4Nbv = (glVertexAttrib4NbvPROC)tlsGetFunction(524); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4Nbv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4Nsv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NsvPROC glVertexAttrib4Nsv = (glVertexAttrib4NsvPROC)tlsGetFunction(525); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4Nsv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4Niv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NivPROC glVertexAttrib4Niv = (glVertexAttrib4NivPROC)tlsGetFunction(526); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4Niv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4Nubv(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NubvPROC glVertexAttrib4Nubv = (glVertexAttrib4NubvPROC)tlsGetFunction(527); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4Nubv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4Nusv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NusvPROC glVertexAttrib4Nusv = (glVertexAttrib4NusvPROC)tlsGetFunction(528); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4Nusv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttrib4Nuiv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4NuivPROC glVertexAttrib4Nuiv = (glVertexAttrib4NuivPROC)tlsGetFunction(529); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4Nuiv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglVertexAttribPointer(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride, jlong pointerAddress) { - glVertexAttribPointerPROC glVertexAttribPointer = (glVertexAttribPointerPROC)tlsGetFunction(530); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glVertexAttribPointer(index, size, type, normalized, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glEnableVertexAttribArray(JNIEnv *__env, jclass clazz, jint index) { - glEnableVertexAttribArrayPROC glEnableVertexAttribArray = (glEnableVertexAttribArrayPROC)tlsGetFunction(531); - UNUSED_PARAM(clazz) - glEnableVertexAttribArray(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glDisableVertexAttribArray(JNIEnv *__env, jclass clazz, jint index) { - glDisableVertexAttribArrayPROC glDisableVertexAttribArray = (glDisableVertexAttribArrayPROC)tlsGetFunction(532); - UNUSED_PARAM(clazz) - glDisableVertexAttribArray(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglBindAttribLocation(JNIEnv *__env, jclass clazz, jint program, jint index, jlong nameAddress) { - glBindAttribLocationPROC glBindAttribLocation = (glBindAttribLocationPROC)tlsGetFunction(533); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glBindAttribLocation(program, index, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetActiveAttrib__IIIJJJJ(JNIEnv *__env, jclass clazz, jint program, jint index, jint maxLength, jlong lengthAddress, jlong sizeAddress, jlong typeAddress, jlong nameAddress) { - glGetActiveAttribPROC glGetActiveAttrib = (glGetActiveAttribPROC)tlsGetFunction(534); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t size = (uintptr_t)sizeAddress; - uintptr_t type = (uintptr_t)typeAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetActiveAttrib(program, index, maxLength, length, size, type, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL20C_nglGetAttribLocation(JNIEnv *__env, jclass clazz, jint program, jlong nameAddress) { - glGetAttribLocationPROC glGetAttribLocation = (glGetAttribLocationPROC)tlsGetFunction(535); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetAttribLocation(program, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetVertexAttribiv__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribivPROC glGetVertexAttribiv = (glGetVertexAttribivPROC)tlsGetFunction(536); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribiv(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetVertexAttribfv__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribfvPROC glGetVertexAttribfv = (glGetVertexAttribfvPROC)tlsGetFunction(537); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribfv(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetVertexAttribdv__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribdvPROC glGetVertexAttribdv = (glGetVertexAttribdvPROC)tlsGetFunction(538); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribdv(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglGetVertexAttribPointerv(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong pointerAddress) { - glGetVertexAttribPointervPROC glGetVertexAttribPointerv = (glGetVertexAttribPointervPROC)tlsGetFunction(539); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribPointerv(index, pname, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_nglDrawBuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong bufsAddress) { - glDrawBuffersPROC glDrawBuffers = (glDrawBuffersPROC)tlsGetFunction(540); - uintptr_t bufs = (uintptr_t)bufsAddress; - UNUSED_PARAM(clazz) - glDrawBuffers(n, bufs); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glBlendEquationSeparate(JNIEnv *__env, jclass clazz, jint modeRGB, jint modeAlpha) { - glBlendEquationSeparatePROC glBlendEquationSeparate = (glBlendEquationSeparatePROC)tlsGetFunction(541); - UNUSED_PARAM(clazz) - glBlendEquationSeparate(modeRGB, modeAlpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glStencilOpSeparate(JNIEnv *__env, jclass clazz, jint face, jint sfail, jint dpfail, jint dppass) { - glStencilOpSeparatePROC glStencilOpSeparate = (glStencilOpSeparatePROC)tlsGetFunction(542); - UNUSED_PARAM(clazz) - glStencilOpSeparate(face, sfail, dpfail, dppass); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glStencilFuncSeparate(JNIEnv *__env, jclass clazz, jint face, jint func, jint ref, jint mask) { - glStencilFuncSeparatePROC glStencilFuncSeparate = (glStencilFuncSeparatePROC)tlsGetFunction(543); - UNUSED_PARAM(clazz) - glStencilFuncSeparate(face, func, ref, mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL20C_glStencilMaskSeparate(JNIEnv *__env, jclass clazz, jint face, jint mask) { - glStencilMaskSeparatePROC glStencilMaskSeparate = (glStencilMaskSeparatePROC)tlsGetFunction(544); - UNUSED_PARAM(clazz) - glStencilMaskSeparate(face, mask); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL21C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL21C.c deleted file mode 100644 index 411bce5b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL21C.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glUniformMatrix2x3fvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix3x2fvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix2x4fvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix4x2fvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix3x4fvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix4x3fvPROC) (jint, jint, jboolean, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21C_nglUniformMatrix2x3fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix2x3fvPROC glUniformMatrix2x3fv = (glUniformMatrix2x3fvPROC)tlsGetFunction(545); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix2x3fv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21C_nglUniformMatrix3x2fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix3x2fvPROC glUniformMatrix3x2fv = (glUniformMatrix3x2fvPROC)tlsGetFunction(546); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix3x2fv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21C_nglUniformMatrix2x4fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix2x4fvPROC glUniformMatrix2x4fv = (glUniformMatrix2x4fvPROC)tlsGetFunction(547); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix2x4fv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21C_nglUniformMatrix4x2fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix4x2fvPROC glUniformMatrix4x2fv = (glUniformMatrix4x2fvPROC)tlsGetFunction(548); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix4x2fv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21C_nglUniformMatrix3x4fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix3x4fvPROC glUniformMatrix3x4fv = (glUniformMatrix3x4fvPROC)tlsGetFunction(549); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix3x4fv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL21C_nglUniformMatrix4x3fv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix4x3fvPROC glUniformMatrix4x3fv = (glUniformMatrix4x3fvPROC)tlsGetFunction(550); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix4x3fv(location, count, transpose, value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL30C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL30C.c deleted file mode 100644 index 6eb33332..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL30C.c +++ /dev/null @@ -1,644 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef uintptr_t (APIENTRY *glGetStringiPROC) (jint, jint); -typedef void (APIENTRY *glClearBufferivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glClearBufferuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glClearBufferfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glClearBufferfiPROC) (jint, jint, jfloat, jint); -typedef void (APIENTRY *glVertexAttribI1iPROC) (jint, jint); -typedef void (APIENTRY *glVertexAttribI2iPROC) (jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI3iPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI4iPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI1uiPROC) (jint, jint); -typedef void (APIENTRY *glVertexAttribI2uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI3uiPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI4uiPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribI1ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI2ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI3ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4ivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI1uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI2uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI3uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4bvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4svPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4ubvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribI4usvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribIPointerPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribIivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribIuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform1uiPROC) (jint, jint); -typedef void (APIENTRY *glUniform2uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glUniform3uiPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glUniform4uiPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glUniform1uivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2uivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3uivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4uivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glBindFragDataLocationPROC) (jint, jint, uintptr_t); -typedef jint (APIENTRY *glGetFragDataLocationPROC) (jint, uintptr_t); -typedef void (APIENTRY *glBeginConditionalRenderPROC) (jint, jint); -typedef void (APIENTRY *glEndConditionalRenderPROC) (void); -typedef uintptr_t (APIENTRY *glMapBufferRangePROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glFlushMappedBufferRangePROC) (jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glClampColorPROC) (jint, jint); -typedef jboolean (APIENTRY *glIsRenderbufferPROC) (jint); -typedef void (APIENTRY *glBindRenderbufferPROC) (jint, jint); -typedef void (APIENTRY *glDeleteRenderbuffersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenRenderbuffersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glRenderbufferStoragePROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glRenderbufferStorageMultisamplePROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glGetRenderbufferParameterivPROC) (jint, jint, uintptr_t); -typedef jboolean (APIENTRY *glIsFramebufferPROC) (jint); -typedef void (APIENTRY *glBindFramebufferPROC) (jint, jint); -typedef void (APIENTRY *glDeleteFramebuffersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenFramebuffersPROC) (jint, uintptr_t); -typedef jint (APIENTRY *glCheckFramebufferStatusPROC) (jint); -typedef void (APIENTRY *glFramebufferTexture1DPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferTexture2DPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferTexture3DPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferTextureLayerPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glFramebufferRenderbufferPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glGetFramebufferAttachmentParameterivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glBlitFramebufferPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glGenerateMipmapPROC) (jint); -typedef void (APIENTRY *glTexParameterIivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTexParameterIuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexParameterIivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTexParameterIuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glColorMaskiPROC) (jint, jboolean, jboolean, jboolean, jboolean); -typedef void (APIENTRY *glGetBooleani_vPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetIntegeri_vPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glEnableiPROC) (jint, jint); -typedef void (APIENTRY *glDisableiPROC) (jint, jint); -typedef jboolean (APIENTRY *glIsEnablediPROC) (jint, jint); -typedef void (APIENTRY *glBindBufferRangePROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glBindBufferBasePROC) (jint, jint, jint); -typedef void (APIENTRY *glBeginTransformFeedbackPROC) (jint); -typedef void (APIENTRY *glEndTransformFeedbackPROC) (void); -typedef void (APIENTRY *glTransformFeedbackVaryingsPROC) (jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glGetTransformFeedbackVaryingPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glBindVertexArrayPROC) (jint); -typedef void (APIENTRY *glDeleteVertexArraysPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenVertexArraysPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsVertexArrayPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GL30C_nglGetStringi(JNIEnv *__env, jclass clazz, jint name, jint index) { - glGetStringiPROC glGetStringi = (glGetStringiPROC)tlsGetFunction(551); - UNUSED_PARAM(clazz) - return (jlong)glGetStringi(name, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglClearBufferiv__IIJ(JNIEnv *__env, jclass clazz, jint buffer, jint drawbuffer, jlong valueAddress) { - glClearBufferivPROC glClearBufferiv = (glClearBufferivPROC)tlsGetFunction(552); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glClearBufferiv(buffer, drawbuffer, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglClearBufferuiv__IIJ(JNIEnv *__env, jclass clazz, jint buffer, jint drawbuffer, jlong valueAddress) { - glClearBufferuivPROC glClearBufferuiv = (glClearBufferuivPROC)tlsGetFunction(553); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glClearBufferuiv(buffer, drawbuffer, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglClearBufferfv__IIJ(JNIEnv *__env, jclass clazz, jint buffer, jint drawbuffer, jlong valueAddress) { - glClearBufferfvPROC glClearBufferfv = (glClearBufferfvPROC)tlsGetFunction(554); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glClearBufferfv(buffer, drawbuffer, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glClearBufferfi(JNIEnv *__env, jclass clazz, jint buffer, jint drawbuffer, jfloat depth, jint stencil) { - glClearBufferfiPROC glClearBufferfi = (glClearBufferfiPROC)tlsGetFunction(555); - UNUSED_PARAM(clazz) - glClearBufferfi(buffer, drawbuffer, depth, stencil); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glVertexAttribI1i(JNIEnv *__env, jclass clazz, jint index, jint x) { - glVertexAttribI1iPROC glVertexAttribI1i = (glVertexAttribI1iPROC)tlsGetFunction(556); - UNUSED_PARAM(clazz) - glVertexAttribI1i(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glVertexAttribI2i(JNIEnv *__env, jclass clazz, jint index, jint x, jint y) { - glVertexAttribI2iPROC glVertexAttribI2i = (glVertexAttribI2iPROC)tlsGetFunction(557); - UNUSED_PARAM(clazz) - glVertexAttribI2i(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glVertexAttribI3i(JNIEnv *__env, jclass clazz, jint index, jint x, jint y, jint z) { - glVertexAttribI3iPROC glVertexAttribI3i = (glVertexAttribI3iPROC)tlsGetFunction(558); - UNUSED_PARAM(clazz) - glVertexAttribI3i(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glVertexAttribI4i(JNIEnv *__env, jclass clazz, jint index, jint x, jint y, jint z, jint w) { - glVertexAttribI4iPROC glVertexAttribI4i = (glVertexAttribI4iPROC)tlsGetFunction(559); - UNUSED_PARAM(clazz) - glVertexAttribI4i(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glVertexAttribI1ui(JNIEnv *__env, jclass clazz, jint index, jint x) { - glVertexAttribI1uiPROC glVertexAttribI1ui = (glVertexAttribI1uiPROC)tlsGetFunction(560); - UNUSED_PARAM(clazz) - glVertexAttribI1ui(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glVertexAttribI2ui(JNIEnv *__env, jclass clazz, jint index, jint x, jint y) { - glVertexAttribI2uiPROC glVertexAttribI2ui = (glVertexAttribI2uiPROC)tlsGetFunction(561); - UNUSED_PARAM(clazz) - glVertexAttribI2ui(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glVertexAttribI3ui(JNIEnv *__env, jclass clazz, jint index, jint x, jint y, jint z) { - glVertexAttribI3uiPROC glVertexAttribI3ui = (glVertexAttribI3uiPROC)tlsGetFunction(562); - UNUSED_PARAM(clazz) - glVertexAttribI3ui(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glVertexAttribI4ui(JNIEnv *__env, jclass clazz, jint index, jint x, jint y, jint z, jint w) { - glVertexAttribI4uiPROC glVertexAttribI4ui = (glVertexAttribI4uiPROC)tlsGetFunction(563); - UNUSED_PARAM(clazz) - glVertexAttribI4ui(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI1iv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI1ivPROC glVertexAttribI1iv = (glVertexAttribI1ivPROC)tlsGetFunction(564); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI1iv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI2iv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI2ivPROC glVertexAttribI2iv = (glVertexAttribI2ivPROC)tlsGetFunction(565); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI2iv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI3iv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI3ivPROC glVertexAttribI3iv = (glVertexAttribI3ivPROC)tlsGetFunction(566); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI3iv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI4iv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4ivPROC glVertexAttribI4iv = (glVertexAttribI4ivPROC)tlsGetFunction(567); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4iv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI1uiv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI1uivPROC glVertexAttribI1uiv = (glVertexAttribI1uivPROC)tlsGetFunction(568); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI1uiv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI2uiv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI2uivPROC glVertexAttribI2uiv = (glVertexAttribI2uivPROC)tlsGetFunction(569); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI2uiv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI3uiv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI3uivPROC glVertexAttribI3uiv = (glVertexAttribI3uivPROC)tlsGetFunction(570); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI3uiv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI4uiv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4uivPROC glVertexAttribI4uiv = (glVertexAttribI4uivPROC)tlsGetFunction(571); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4uiv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI4bv(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4bvPROC glVertexAttribI4bv = (glVertexAttribI4bvPROC)tlsGetFunction(572); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4bv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI4sv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4svPROC glVertexAttribI4sv = (glVertexAttribI4svPROC)tlsGetFunction(573); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4sv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI4ubv(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4ubvPROC glVertexAttribI4ubv = (glVertexAttribI4ubvPROC)tlsGetFunction(574); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4ubv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribI4usv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribI4usvPROC glVertexAttribI4usv = (glVertexAttribI4usvPROC)tlsGetFunction(575); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribI4usv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglVertexAttribIPointer(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jint stride, jlong pointerAddress) { - glVertexAttribIPointerPROC glVertexAttribIPointer = (glVertexAttribIPointerPROC)tlsGetFunction(576); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glVertexAttribIPointer(index, size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetVertexAttribIiv__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribIivPROC glGetVertexAttribIiv = (glGetVertexAttribIivPROC)tlsGetFunction(577); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribIiv(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetVertexAttribIuiv__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribIuivPROC glGetVertexAttribIuiv = (glGetVertexAttribIuivPROC)tlsGetFunction(578); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribIuiv(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glUniform1ui(JNIEnv *__env, jclass clazz, jint location, jint v0) { - glUniform1uiPROC glUniform1ui = (glUniform1uiPROC)tlsGetFunction(579); - UNUSED_PARAM(clazz) - glUniform1ui(location, v0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glUniform2ui(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1) { - glUniform2uiPROC glUniform2ui = (glUniform2uiPROC)tlsGetFunction(580); - UNUSED_PARAM(clazz) - glUniform2ui(location, v0, v1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glUniform3ui(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1, jint v2) { - glUniform3uiPROC glUniform3ui = (glUniform3uiPROC)tlsGetFunction(581); - UNUSED_PARAM(clazz) - glUniform3ui(location, v0, v1, v2); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glUniform4ui(JNIEnv *__env, jclass clazz, jint location, jint v0, jint v1, jint v2, jint v3) { - glUniform4uiPROC glUniform4ui = (glUniform4uiPROC)tlsGetFunction(582); - UNUSED_PARAM(clazz) - glUniform4ui(location, v0, v1, v2, v3); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglUniform1uiv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1uivPROC glUniform1uiv = (glUniform1uivPROC)tlsGetFunction(583); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1uiv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglUniform2uiv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2uivPROC glUniform2uiv = (glUniform2uivPROC)tlsGetFunction(584); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2uiv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglUniform3uiv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3uivPROC glUniform3uiv = (glUniform3uivPROC)tlsGetFunction(585); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3uiv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglUniform4uiv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4uivPROC glUniform4uiv = (glUniform4uivPROC)tlsGetFunction(586); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4uiv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetUniformuiv__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformuivPROC glGetUniformuiv = (glGetUniformuivPROC)tlsGetFunction(587); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformuiv(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglBindFragDataLocation(JNIEnv *__env, jclass clazz, jint program, jint colorNumber, jlong nameAddress) { - glBindFragDataLocationPROC glBindFragDataLocation = (glBindFragDataLocationPROC)tlsGetFunction(588); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glBindFragDataLocation(program, colorNumber, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL30C_nglGetFragDataLocation(JNIEnv *__env, jclass clazz, jint program, jlong nameAddress) { - glGetFragDataLocationPROC glGetFragDataLocation = (glGetFragDataLocationPROC)tlsGetFunction(589); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetFragDataLocation(program, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glBeginConditionalRender(JNIEnv *__env, jclass clazz, jint id, jint mode) { - glBeginConditionalRenderPROC glBeginConditionalRender = (glBeginConditionalRenderPROC)tlsGetFunction(590); - UNUSED_PARAM(clazz) - glBeginConditionalRender(id, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glEndConditionalRender(JNIEnv *__env, jclass clazz) { - glEndConditionalRenderPROC glEndConditionalRender = (glEndConditionalRenderPROC)tlsGetFunction(591); - UNUSED_PARAM(clazz) - glEndConditionalRender(); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GL30C_nglMapBufferRange(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong length, jint access) { - glMapBufferRangePROC glMapBufferRange = (glMapBufferRangePROC)tlsGetFunction(592); - UNUSED_PARAM(clazz) - return (jlong)glMapBufferRange(target, (uintptr_t)offset, (uintptr_t)length, access); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glFlushMappedBufferRange(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong length) { - glFlushMappedBufferRangePROC glFlushMappedBufferRange = (glFlushMappedBufferRangePROC)tlsGetFunction(593); - UNUSED_PARAM(clazz) - glFlushMappedBufferRange(target, (uintptr_t)offset, (uintptr_t)length); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glClampColor(JNIEnv *__env, jclass clazz, jint target, jint clamp) { - glClampColorPROC glClampColor = (glClampColorPROC)tlsGetFunction(594); - UNUSED_PARAM(clazz) - glClampColor(target, clamp); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL30C_glIsRenderbuffer(JNIEnv *__env, jclass clazz, jint renderbuffer) { - glIsRenderbufferPROC glIsRenderbuffer = (glIsRenderbufferPROC)tlsGetFunction(595); - UNUSED_PARAM(clazz) - return glIsRenderbuffer(renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glBindRenderbuffer(JNIEnv *__env, jclass clazz, jint target, jint renderbuffer) { - glBindRenderbufferPROC glBindRenderbuffer = (glBindRenderbufferPROC)tlsGetFunction(596); - UNUSED_PARAM(clazz) - glBindRenderbuffer(target, renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglDeleteRenderbuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong renderbuffersAddress) { - glDeleteRenderbuffersPROC glDeleteRenderbuffers = (glDeleteRenderbuffersPROC)tlsGetFunction(597); - uintptr_t renderbuffers = (uintptr_t)renderbuffersAddress; - UNUSED_PARAM(clazz) - glDeleteRenderbuffers(n, renderbuffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGenRenderbuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong renderbuffersAddress) { - glGenRenderbuffersPROC glGenRenderbuffers = (glGenRenderbuffersPROC)tlsGetFunction(598); - uintptr_t renderbuffers = (uintptr_t)renderbuffersAddress; - UNUSED_PARAM(clazz) - glGenRenderbuffers(n, renderbuffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glRenderbufferStorage(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint width, jint height) { - glRenderbufferStoragePROC glRenderbufferStorage = (glRenderbufferStoragePROC)tlsGetFunction(599); - UNUSED_PARAM(clazz) - glRenderbufferStorage(target, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glRenderbufferStorageMultisample(JNIEnv *__env, jclass clazz, jint target, jint samples, jint internalformat, jint width, jint height) { - glRenderbufferStorageMultisamplePROC glRenderbufferStorageMultisample = (glRenderbufferStorageMultisamplePROC)tlsGetFunction(600); - UNUSED_PARAM(clazz) - glRenderbufferStorageMultisample(target, samples, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetRenderbufferParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetRenderbufferParameterivPROC glGetRenderbufferParameteriv = (glGetRenderbufferParameterivPROC)tlsGetFunction(601); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetRenderbufferParameteriv(target, pname, params); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL30C_glIsFramebuffer(JNIEnv *__env, jclass clazz, jint framebuffer) { - glIsFramebufferPROC glIsFramebuffer = (glIsFramebufferPROC)tlsGetFunction(602); - UNUSED_PARAM(clazz) - return glIsFramebuffer(framebuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glBindFramebuffer(JNIEnv *__env, jclass clazz, jint target, jint framebuffer) { - glBindFramebufferPROC glBindFramebuffer = (glBindFramebufferPROC)tlsGetFunction(603); - UNUSED_PARAM(clazz) - glBindFramebuffer(target, framebuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglDeleteFramebuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong framebuffersAddress) { - glDeleteFramebuffersPROC glDeleteFramebuffers = (glDeleteFramebuffersPROC)tlsGetFunction(604); - uintptr_t framebuffers = (uintptr_t)framebuffersAddress; - UNUSED_PARAM(clazz) - glDeleteFramebuffers(n, framebuffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGenFramebuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong framebuffersAddress) { - glGenFramebuffersPROC glGenFramebuffers = (glGenFramebuffersPROC)tlsGetFunction(605); - uintptr_t framebuffers = (uintptr_t)framebuffersAddress; - UNUSED_PARAM(clazz) - glGenFramebuffers(n, framebuffers); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL30C_glCheckFramebufferStatus(JNIEnv *__env, jclass clazz, jint target) { - glCheckFramebufferStatusPROC glCheckFramebufferStatus = (glCheckFramebufferStatusPROC)tlsGetFunction(606); - UNUSED_PARAM(clazz) - return glCheckFramebufferStatus(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glFramebufferTexture1D(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint textarget, jint texture, jint level) { - glFramebufferTexture1DPROC glFramebufferTexture1D = (glFramebufferTexture1DPROC)tlsGetFunction(607); - UNUSED_PARAM(clazz) - glFramebufferTexture1D(target, attachment, textarget, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glFramebufferTexture2D(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint textarget, jint texture, jint level) { - glFramebufferTexture2DPROC glFramebufferTexture2D = (glFramebufferTexture2DPROC)tlsGetFunction(608); - UNUSED_PARAM(clazz) - glFramebufferTexture2D(target, attachment, textarget, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glFramebufferTexture3D(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint textarget, jint texture, jint level, jint layer) { - glFramebufferTexture3DPROC glFramebufferTexture3D = (glFramebufferTexture3DPROC)tlsGetFunction(609); - UNUSED_PARAM(clazz) - glFramebufferTexture3D(target, attachment, textarget, texture, level, layer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glFramebufferTextureLayer(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level, jint layer) { - glFramebufferTextureLayerPROC glFramebufferTextureLayer = (glFramebufferTextureLayerPROC)tlsGetFunction(610); - UNUSED_PARAM(clazz) - glFramebufferTextureLayer(target, attachment, texture, level, layer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glFramebufferRenderbuffer(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { - glFramebufferRenderbufferPROC glFramebufferRenderbuffer = (glFramebufferRenderbufferPROC)tlsGetFunction(611); - UNUSED_PARAM(clazz) - glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetFramebufferAttachmentParameteriv__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint pname, jlong paramsAddress) { - glGetFramebufferAttachmentParameterivPROC glGetFramebufferAttachmentParameteriv = (glGetFramebufferAttachmentParameterivPROC)tlsGetFunction(612); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetFramebufferAttachmentParameteriv(target, attachment, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glBlitFramebuffer(JNIEnv *__env, jclass clazz, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) { - glBlitFramebufferPROC glBlitFramebuffer = (glBlitFramebufferPROC)tlsGetFunction(613); - UNUSED_PARAM(clazz) - glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glGenerateMipmap(JNIEnv *__env, jclass clazz, jint target) { - glGenerateMipmapPROC glGenerateMipmap = (glGenerateMipmapPROC)tlsGetFunction(614); - UNUSED_PARAM(clazz) - glGenerateMipmap(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglTexParameterIiv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glTexParameterIivPROC glTexParameterIiv = (glTexParameterIivPROC)tlsGetFunction(615); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexParameterIiv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglTexParameterIuiv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glTexParameterIuivPROC glTexParameterIuiv = (glTexParameterIuivPROC)tlsGetFunction(616); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTexParameterIuiv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetTexParameterIiv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetTexParameterIivPROC glGetTexParameterIiv = (glGetTexParameterIivPROC)tlsGetFunction(617); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTexParameterIiv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetTexParameterIuiv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetTexParameterIuivPROC glGetTexParameterIuiv = (glGetTexParameterIuivPROC)tlsGetFunction(618); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTexParameterIuiv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glColorMaski(JNIEnv *__env, jclass clazz, jint buf, jboolean r, jboolean g, jboolean b, jboolean a) { - glColorMaskiPROC glColorMaski = (glColorMaskiPROC)tlsGetFunction(619); - UNUSED_PARAM(clazz) - glColorMaski(buf, r, g, b, a); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetBooleani_1v(JNIEnv *__env, jclass clazz, jint target, jint index, jlong dataAddress) { - glGetBooleani_vPROC glGetBooleani_v = (glGetBooleani_vPROC)tlsGetFunction(620); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetBooleani_v(target, index, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetIntegeri_1v__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong dataAddress) { - glGetIntegeri_vPROC glGetIntegeri_v = (glGetIntegeri_vPROC)tlsGetFunction(621); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetIntegeri_v(target, index, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glEnablei(JNIEnv *__env, jclass clazz, jint cap, jint index) { - glEnableiPROC glEnablei = (glEnableiPROC)tlsGetFunction(622); - UNUSED_PARAM(clazz) - glEnablei(cap, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glDisablei(JNIEnv *__env, jclass clazz, jint target, jint index) { - glDisableiPROC glDisablei = (glDisableiPROC)tlsGetFunction(623); - UNUSED_PARAM(clazz) - glDisablei(target, index); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL30C_glIsEnabledi(JNIEnv *__env, jclass clazz, jint target, jint index) { - glIsEnablediPROC glIsEnabledi = (glIsEnablediPROC)tlsGetFunction(624); - UNUSED_PARAM(clazz) - return glIsEnabledi(target, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glBindBufferRange(JNIEnv *__env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong size) { - glBindBufferRangePROC glBindBufferRange = (glBindBufferRangePROC)tlsGetFunction(625); - UNUSED_PARAM(clazz) - glBindBufferRange(target, index, buffer, (uintptr_t)offset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glBindBufferBase(JNIEnv *__env, jclass clazz, jint target, jint index, jint buffer) { - glBindBufferBasePROC glBindBufferBase = (glBindBufferBasePROC)tlsGetFunction(626); - UNUSED_PARAM(clazz) - glBindBufferBase(target, index, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glBeginTransformFeedback(JNIEnv *__env, jclass clazz, jint primitiveMode) { - glBeginTransformFeedbackPROC glBeginTransformFeedback = (glBeginTransformFeedbackPROC)tlsGetFunction(627); - UNUSED_PARAM(clazz) - glBeginTransformFeedback(primitiveMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glEndTransformFeedback(JNIEnv *__env, jclass clazz) { - glEndTransformFeedbackPROC glEndTransformFeedback = (glEndTransformFeedbackPROC)tlsGetFunction(628); - UNUSED_PARAM(clazz) - glEndTransformFeedback(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglTransformFeedbackVaryings(JNIEnv *__env, jclass clazz, jint program, jint count, jlong varyingsAddress, jint bufferMode) { - glTransformFeedbackVaryingsPROC glTransformFeedbackVaryings = (glTransformFeedbackVaryingsPROC)tlsGetFunction(629); - uintptr_t varyings = (uintptr_t)varyingsAddress; - UNUSED_PARAM(clazz) - glTransformFeedbackVaryings(program, count, varyings, bufferMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGetTransformFeedbackVarying__IIIJJJJ(JNIEnv *__env, jclass clazz, jint program, jint index, jint bufSize, jlong lengthAddress, jlong sizeAddress, jlong typeAddress, jlong nameAddress) { - glGetTransformFeedbackVaryingPROC glGetTransformFeedbackVarying = (glGetTransformFeedbackVaryingPROC)tlsGetFunction(630); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t size = (uintptr_t)sizeAddress; - uintptr_t type = (uintptr_t)typeAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_glBindVertexArray(JNIEnv *__env, jclass clazz, jint array) { - glBindVertexArrayPROC glBindVertexArray = (glBindVertexArrayPROC)tlsGetFunction(631); - UNUSED_PARAM(clazz) - glBindVertexArray(array); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglDeleteVertexArrays__IJ(JNIEnv *__env, jclass clazz, jint n, jlong arraysAddress) { - glDeleteVertexArraysPROC glDeleteVertexArrays = (glDeleteVertexArraysPROC)tlsGetFunction(632); - uintptr_t arrays = (uintptr_t)arraysAddress; - UNUSED_PARAM(clazz) - glDeleteVertexArrays(n, arrays); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL30C_nglGenVertexArrays__IJ(JNIEnv *__env, jclass clazz, jint n, jlong arraysAddress) { - glGenVertexArraysPROC glGenVertexArrays = (glGenVertexArraysPROC)tlsGetFunction(633); - uintptr_t arrays = (uintptr_t)arraysAddress; - UNUSED_PARAM(clazz) - glGenVertexArrays(n, arrays); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL30C_glIsVertexArray(JNIEnv *__env, jclass clazz, jint array) { - glIsVertexArrayPROC glIsVertexArray = (glIsVertexArrayPROC)tlsGetFunction(634); - UNUSED_PARAM(clazz) - return glIsVertexArray(array); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL31C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL31C.c deleted file mode 100644 index c30f32e1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL31C.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDrawArraysInstancedPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glDrawElementsInstancedPROC) (jint, jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glCopyBufferSubDataPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glPrimitiveRestartIndexPROC) (jint); -typedef void (APIENTRY *glTexBufferPROC) (jint, jint, jint); -typedef void (APIENTRY *glGetUniformIndicesPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetActiveUniformsivPROC) (jint, jint, uintptr_t, jint, uintptr_t); -typedef void (APIENTRY *glGetActiveUniformNamePROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetUniformBlockIndexPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetActiveUniformBlockivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetActiveUniformBlockNamePROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glUniformBlockBindingPROC) (jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_glDrawArraysInstanced(JNIEnv *__env, jclass clazz, jint mode, jint first, jint count, jint primcount) { - glDrawArraysInstancedPROC glDrawArraysInstanced = (glDrawArraysInstancedPROC)tlsGetFunction(635); - UNUSED_PARAM(clazz) - glDrawArraysInstanced(mode, first, count, primcount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_nglDrawElementsInstanced(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress, jint primcount) { - glDrawElementsInstancedPROC glDrawElementsInstanced = (glDrawElementsInstancedPROC)tlsGetFunction(636); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawElementsInstanced(mode, count, type, indices, primcount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_glCopyBufferSubData(JNIEnv *__env, jclass clazz, jint readTarget, jint writeTarget, jlong readOffset, jlong writeOffset, jlong size) { - glCopyBufferSubDataPROC glCopyBufferSubData = (glCopyBufferSubDataPROC)tlsGetFunction(637); - UNUSED_PARAM(clazz) - glCopyBufferSubData(readTarget, writeTarget, (uintptr_t)readOffset, (uintptr_t)writeOffset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_glPrimitiveRestartIndex(JNIEnv *__env, jclass clazz, jint index) { - glPrimitiveRestartIndexPROC glPrimitiveRestartIndex = (glPrimitiveRestartIndexPROC)tlsGetFunction(638); - UNUSED_PARAM(clazz) - glPrimitiveRestartIndex(index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_glTexBuffer(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint buffer) { - glTexBufferPROC glTexBuffer = (glTexBufferPROC)tlsGetFunction(639); - UNUSED_PARAM(clazz) - glTexBuffer(target, internalformat, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_nglGetUniformIndices__IIJJ(JNIEnv *__env, jclass clazz, jint program, jint uniformCount, jlong uniformNamesAddress, jlong uniformIndicesAddress) { - glGetUniformIndicesPROC glGetUniformIndices = (glGetUniformIndicesPROC)tlsGetFunction(640); - uintptr_t uniformNames = (uintptr_t)uniformNamesAddress; - uintptr_t uniformIndices = (uintptr_t)uniformIndicesAddress; - UNUSED_PARAM(clazz) - glGetUniformIndices(program, uniformCount, uniformNames, uniformIndices); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_nglGetActiveUniformsiv__IIJIJ(JNIEnv *__env, jclass clazz, jint program, jint uniformCount, jlong uniformIndicesAddress, jint pname, jlong paramsAddress) { - glGetActiveUniformsivPROC glGetActiveUniformsiv = (glGetActiveUniformsivPROC)tlsGetFunction(641); - uintptr_t uniformIndices = (uintptr_t)uniformIndicesAddress; - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_nglGetActiveUniformName__IIIJJ(JNIEnv *__env, jclass clazz, jint program, jint uniformIndex, jint bufSize, jlong lengthAddress, jlong uniformNameAddress) { - glGetActiveUniformNamePROC glGetActiveUniformName = (glGetActiveUniformNamePROC)tlsGetFunction(642); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t uniformName = (uintptr_t)uniformNameAddress; - UNUSED_PARAM(clazz) - glGetActiveUniformName(program, uniformIndex, bufSize, length, uniformName); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL31C_nglGetUniformBlockIndex(JNIEnv *__env, jclass clazz, jint program, jlong uniformBlockNameAddress) { - glGetUniformBlockIndexPROC glGetUniformBlockIndex = (glGetUniformBlockIndexPROC)tlsGetFunction(643); - uintptr_t uniformBlockName = (uintptr_t)uniformBlockNameAddress; - UNUSED_PARAM(clazz) - return glGetUniformBlockIndex(program, uniformBlockName); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_nglGetActiveUniformBlockiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint uniformBlockIndex, jint pname, jlong paramsAddress) { - glGetActiveUniformBlockivPROC glGetActiveUniformBlockiv = (glGetActiveUniformBlockivPROC)tlsGetFunction(644); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_nglGetActiveUniformBlockName__IIIJJ(JNIEnv *__env, jclass clazz, jint program, jint uniformBlockIndex, jint bufSize, jlong lengthAddress, jlong uniformBlockNameAddress) { - glGetActiveUniformBlockNamePROC glGetActiveUniformBlockName = (glGetActiveUniformBlockNamePROC)tlsGetFunction(645); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t uniformBlockName = (uintptr_t)uniformBlockNameAddress; - UNUSED_PARAM(clazz) - glGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL31C_glUniformBlockBinding(JNIEnv *__env, jclass clazz, jint program, jint uniformBlockIndex, jint uniformBlockBinding) { - glUniformBlockBindingPROC glUniformBlockBinding = (glUniformBlockBindingPROC)tlsGetFunction(646); - UNUSED_PARAM(clazz) - glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL32C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL32C.c deleted file mode 100644 index 74d65594..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL32C.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetBufferParameteri64vPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glDrawElementsBaseVertexPROC) (jint, jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glDrawRangeElementsBaseVertexPROC) (jint, jint, jint, jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glDrawElementsInstancedBaseVertexPROC) (jint, jint, jint, uintptr_t, jint, jint); -typedef void (APIENTRY *glMultiDrawElementsBaseVertexPROC) (jint, uintptr_t, jint, uintptr_t, jint, uintptr_t); -typedef void (APIENTRY *glProvokingVertexPROC) (jint); -typedef void (APIENTRY *glTexImage2DMultisamplePROC) (jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTexImage3DMultisamplePROC) (jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glGetMultisamplefvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glSampleMaskiPROC) (jint, jint); -typedef void (APIENTRY *glFramebufferTexturePROC) (jint, jint, jint, jint); -typedef uintptr_t (APIENTRY *glFenceSyncPROC) (jint, jint); -typedef jboolean (APIENTRY *glIsSyncPROC) (uintptr_t); -typedef void (APIENTRY *glDeleteSyncPROC) (uintptr_t); -typedef jint (APIENTRY *glClientWaitSyncPROC) (uintptr_t, jint, jlong); -typedef void (APIENTRY *glWaitSyncPROC) (uintptr_t, jint, jlong); -typedef void (APIENTRY *glGetInteger64vPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetInteger64i_vPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetSyncivPROC) (uintptr_t, jint, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglGetBufferParameteri64v__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetBufferParameteri64vPROC glGetBufferParameteri64v = (glGetBufferParameteri64vPROC)tlsGetFunction(647); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetBufferParameteri64v(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglDrawElementsBaseVertex(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress, jint basevertex) { - glDrawElementsBaseVertexPROC glDrawElementsBaseVertex = (glDrawElementsBaseVertexPROC)tlsGetFunction(648); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawElementsBaseVertex(mode, count, type, indices, basevertex); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglDrawRangeElementsBaseVertex(JNIEnv *__env, jclass clazz, jint mode, jint start, jint end, jint count, jint type, jlong indicesAddress, jint basevertex) { - glDrawRangeElementsBaseVertexPROC glDrawRangeElementsBaseVertex = (glDrawRangeElementsBaseVertexPROC)tlsGetFunction(649); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglDrawElementsInstancedBaseVertex(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress, jint primcount, jint basevertex) { - glDrawElementsInstancedBaseVertexPROC glDrawElementsInstancedBaseVertex = (glDrawElementsInstancedBaseVertexPROC)tlsGetFunction(650); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglMultiDrawElementsBaseVertex__IJIJIJ(JNIEnv *__env, jclass clazz, jint mode, jlong countAddress, jint type, jlong indicesAddress, jint drawcount, jlong basevertexAddress) { - glMultiDrawElementsBaseVertexPROC glMultiDrawElementsBaseVertex = (glMultiDrawElementsBaseVertexPROC)tlsGetFunction(651); - uintptr_t count = (uintptr_t)countAddress; - uintptr_t indices = (uintptr_t)indicesAddress; - uintptr_t basevertex = (uintptr_t)basevertexAddress; - UNUSED_PARAM(clazz) - glMultiDrawElementsBaseVertex(mode, count, type, indices, drawcount, basevertex); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_glProvokingVertex(JNIEnv *__env, jclass clazz, jint mode) { - glProvokingVertexPROC glProvokingVertex = (glProvokingVertexPROC)tlsGetFunction(652); - UNUSED_PARAM(clazz) - glProvokingVertex(mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_glTexImage2DMultisample(JNIEnv *__env, jclass clazz, jint target, jint samples, jint internalformat, jint width, jint height, jboolean fixedsamplelocations) { - glTexImage2DMultisamplePROC glTexImage2DMultisample = (glTexImage2DMultisamplePROC)tlsGetFunction(653); - UNUSED_PARAM(clazz) - glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_glTexImage3DMultisample(JNIEnv *__env, jclass clazz, jint target, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) { - glTexImage3DMultisamplePROC glTexImage3DMultisample = (glTexImage3DMultisamplePROC)tlsGetFunction(654); - UNUSED_PARAM(clazz) - glTexImage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglGetMultisamplefv__IIJ(JNIEnv *__env, jclass clazz, jint pname, jint index, jlong valAddress) { - glGetMultisamplefvPROC glGetMultisamplefv = (glGetMultisamplefvPROC)tlsGetFunction(655); - uintptr_t val = (uintptr_t)valAddress; - UNUSED_PARAM(clazz) - glGetMultisamplefv(pname, index, val); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_glSampleMaski(JNIEnv *__env, jclass clazz, jint index, jint mask) { - glSampleMaskiPROC glSampleMaski = (glSampleMaskiPROC)tlsGetFunction(656); - UNUSED_PARAM(clazz) - glSampleMaski(index, mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_glFramebufferTexture(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level) { - glFramebufferTexturePROC glFramebufferTexture = (glFramebufferTexturePROC)tlsGetFunction(657); - UNUSED_PARAM(clazz) - glFramebufferTexture(target, attachment, texture, level); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GL32C_glFenceSync(JNIEnv *__env, jclass clazz, jint condition, jint flags) { - glFenceSyncPROC glFenceSync = (glFenceSyncPROC)tlsGetFunction(658); - UNUSED_PARAM(clazz) - return (jlong)glFenceSync(condition, flags); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL32C_nglIsSync(JNIEnv *__env, jclass clazz, jlong syncAddress) { - glIsSyncPROC glIsSync = (glIsSyncPROC)tlsGetFunction(659); - uintptr_t sync = (uintptr_t)syncAddress; - UNUSED_PARAM(clazz) - return glIsSync(sync); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglDeleteSync(JNIEnv *__env, jclass clazz, jlong syncAddress) { - glDeleteSyncPROC glDeleteSync = (glDeleteSyncPROC)tlsGetFunction(660); - uintptr_t sync = (uintptr_t)syncAddress; - UNUSED_PARAM(clazz) - glDeleteSync(sync); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL32C_nglClientWaitSync(JNIEnv *__env, jclass clazz, jlong syncAddress, jint flags, jlong timeout) { - glClientWaitSyncPROC glClientWaitSync = (glClientWaitSyncPROC)tlsGetFunction(661); - uintptr_t sync = (uintptr_t)syncAddress; - UNUSED_PARAM(clazz) - return glClientWaitSync(sync, flags, timeout); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglWaitSync(JNIEnv *__env, jclass clazz, jlong syncAddress, jint flags, jlong timeout) { - glWaitSyncPROC glWaitSync = (glWaitSyncPROC)tlsGetFunction(662); - uintptr_t sync = (uintptr_t)syncAddress; - UNUSED_PARAM(clazz) - glWaitSync(sync, flags, timeout); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglGetInteger64v__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glGetInteger64vPROC glGetInteger64v = (glGetInteger64vPROC)tlsGetFunction(663); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetInteger64v(pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglGetInteger64i_1v__IIJ(JNIEnv *__env, jclass clazz, jint pname, jint index, jlong paramsAddress) { - glGetInteger64i_vPROC glGetInteger64i_v = (glGetInteger64i_vPROC)tlsGetFunction(664); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetInteger64i_v(pname, index, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL32C_nglGetSynciv__JIIJJ(JNIEnv *__env, jclass clazz, jlong syncAddress, jint pname, jint bufSize, jlong lengthAddress, jlong valuesAddress) { - glGetSyncivPROC glGetSynciv = (glGetSyncivPROC)tlsGetFunction(665); - uintptr_t sync = (uintptr_t)syncAddress; - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetSynciv(sync, pname, bufSize, length, values); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL33.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL33.c deleted file mode 100644 index b36e6196..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL33.c +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexP2uiPROC) (jint, jint); -typedef void (APIENTRY *glVertexP3uiPROC) (jint, jint); -typedef void (APIENTRY *glVertexP4uiPROC) (jint, jint); -typedef void (APIENTRY *glVertexP2uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexP3uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexP4uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glTexCoordP1uiPROC) (jint, jint); -typedef void (APIENTRY *glTexCoordP2uiPROC) (jint, jint); -typedef void (APIENTRY *glTexCoordP3uiPROC) (jint, jint); -typedef void (APIENTRY *glTexCoordP4uiPROC) (jint, jint); -typedef void (APIENTRY *glTexCoordP1uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glTexCoordP2uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glTexCoordP3uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glTexCoordP4uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoordP1uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoordP2uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoordP3uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoordP4uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glMultiTexCoordP1uivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoordP2uivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoordP3uivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoordP4uivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glNormalP3uiPROC) (jint, jint); -typedef void (APIENTRY *glNormalP3uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glColorP3uiPROC) (jint, jint); -typedef void (APIENTRY *glColorP4uiPROC) (jint, jint); -typedef void (APIENTRY *glColorP3uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glColorP4uivPROC) (jint, uintptr_t); -typedef void (APIENTRY *glSecondaryColorP3uiPROC) (jint, jint); -typedef void (APIENTRY *glSecondaryColorP3uivPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glVertexP2ui(JNIEnv *__env, jclass clazz, jint type, jint value) { - glVertexP2uiPROC glVertexP2ui = (glVertexP2uiPROC)tlsGetFunction(686); - UNUSED_PARAM(clazz) - glVertexP2ui(type, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glVertexP3ui(JNIEnv *__env, jclass clazz, jint type, jint value) { - glVertexP3uiPROC glVertexP3ui = (glVertexP3uiPROC)tlsGetFunction(687); - UNUSED_PARAM(clazz) - glVertexP3ui(type, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glVertexP4ui(JNIEnv *__env, jclass clazz, jint type, jint value) { - glVertexP4uiPROC glVertexP4ui = (glVertexP4uiPROC)tlsGetFunction(688); - UNUSED_PARAM(clazz) - glVertexP4ui(type, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglVertexP2uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong valueAddress) { - glVertexP2uivPROC glVertexP2uiv = (glVertexP2uivPROC)tlsGetFunction(689); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glVertexP2uiv(type, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglVertexP3uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong valueAddress) { - glVertexP3uivPROC glVertexP3uiv = (glVertexP3uivPROC)tlsGetFunction(690); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glVertexP3uiv(type, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglVertexP4uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong valueAddress) { - glVertexP4uivPROC glVertexP4uiv = (glVertexP4uivPROC)tlsGetFunction(691); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glVertexP4uiv(type, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glTexCoordP1ui(JNIEnv *__env, jclass clazz, jint type, jint coords) { - glTexCoordP1uiPROC glTexCoordP1ui = (glTexCoordP1uiPROC)tlsGetFunction(692); - UNUSED_PARAM(clazz) - glTexCoordP1ui(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glTexCoordP2ui(JNIEnv *__env, jclass clazz, jint type, jint coords) { - glTexCoordP2uiPROC glTexCoordP2ui = (glTexCoordP2uiPROC)tlsGetFunction(693); - UNUSED_PARAM(clazz) - glTexCoordP2ui(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glTexCoordP3ui(JNIEnv *__env, jclass clazz, jint type, jint coords) { - glTexCoordP3uiPROC glTexCoordP3ui = (glTexCoordP3uiPROC)tlsGetFunction(694); - UNUSED_PARAM(clazz) - glTexCoordP3ui(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glTexCoordP4ui(JNIEnv *__env, jclass clazz, jint type, jint coords) { - glTexCoordP4uiPROC glTexCoordP4ui = (glTexCoordP4uiPROC)tlsGetFunction(695); - UNUSED_PARAM(clazz) - glTexCoordP4ui(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglTexCoordP1uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong coordsAddress) { - glTexCoordP1uivPROC glTexCoordP1uiv = (glTexCoordP1uivPROC)tlsGetFunction(696); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glTexCoordP1uiv(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglTexCoordP2uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong coordsAddress) { - glTexCoordP2uivPROC glTexCoordP2uiv = (glTexCoordP2uivPROC)tlsGetFunction(697); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glTexCoordP2uiv(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglTexCoordP3uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong coordsAddress) { - glTexCoordP3uivPROC glTexCoordP3uiv = (glTexCoordP3uivPROC)tlsGetFunction(698); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glTexCoordP3uiv(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglTexCoordP4uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong coordsAddress) { - glTexCoordP4uivPROC glTexCoordP4uiv = (glTexCoordP4uivPROC)tlsGetFunction(699); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glTexCoordP4uiv(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glMultiTexCoordP1ui(JNIEnv *__env, jclass clazz, jint texture, jint type, jint coords) { - glMultiTexCoordP1uiPROC glMultiTexCoordP1ui = (glMultiTexCoordP1uiPROC)tlsGetFunction(700); - UNUSED_PARAM(clazz) - glMultiTexCoordP1ui(texture, type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glMultiTexCoordP2ui(JNIEnv *__env, jclass clazz, jint texture, jint type, jint coords) { - glMultiTexCoordP2uiPROC glMultiTexCoordP2ui = (glMultiTexCoordP2uiPROC)tlsGetFunction(701); - UNUSED_PARAM(clazz) - glMultiTexCoordP2ui(texture, type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glMultiTexCoordP3ui(JNIEnv *__env, jclass clazz, jint texture, jint type, jint coords) { - glMultiTexCoordP3uiPROC glMultiTexCoordP3ui = (glMultiTexCoordP3uiPROC)tlsGetFunction(702); - UNUSED_PARAM(clazz) - glMultiTexCoordP3ui(texture, type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glMultiTexCoordP4ui(JNIEnv *__env, jclass clazz, jint texture, jint type, jint coords) { - glMultiTexCoordP4uiPROC glMultiTexCoordP4ui = (glMultiTexCoordP4uiPROC)tlsGetFunction(703); - UNUSED_PARAM(clazz) - glMultiTexCoordP4ui(texture, type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglMultiTexCoordP1uiv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint type, jlong coordsAddress) { - glMultiTexCoordP1uivPROC glMultiTexCoordP1uiv = (glMultiTexCoordP1uivPROC)tlsGetFunction(704); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glMultiTexCoordP1uiv(texture, type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglMultiTexCoordP2uiv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint type, jlong coordsAddress) { - glMultiTexCoordP2uivPROC glMultiTexCoordP2uiv = (glMultiTexCoordP2uivPROC)tlsGetFunction(705); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glMultiTexCoordP2uiv(texture, type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglMultiTexCoordP3uiv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint type, jlong coordsAddress) { - glMultiTexCoordP3uivPROC glMultiTexCoordP3uiv = (glMultiTexCoordP3uivPROC)tlsGetFunction(706); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glMultiTexCoordP3uiv(texture, type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglMultiTexCoordP4uiv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint type, jlong coordsAddress) { - glMultiTexCoordP4uivPROC glMultiTexCoordP4uiv = (glMultiTexCoordP4uivPROC)tlsGetFunction(707); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glMultiTexCoordP4uiv(texture, type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glNormalP3ui(JNIEnv *__env, jclass clazz, jint type, jint coords) { - glNormalP3uiPROC glNormalP3ui = (glNormalP3uiPROC)tlsGetFunction(708); - UNUSED_PARAM(clazz) - glNormalP3ui(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglNormalP3uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong coordsAddress) { - glNormalP3uivPROC glNormalP3uiv = (glNormalP3uivPROC)tlsGetFunction(709); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glNormalP3uiv(type, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glColorP3ui(JNIEnv *__env, jclass clazz, jint type, jint color) { - glColorP3uiPROC glColorP3ui = (glColorP3uiPROC)tlsGetFunction(710); - UNUSED_PARAM(clazz) - glColorP3ui(type, color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glColorP4ui(JNIEnv *__env, jclass clazz, jint type, jint color) { - glColorP4uiPROC glColorP4ui = (glColorP4uiPROC)tlsGetFunction(711); - UNUSED_PARAM(clazz) - glColorP4ui(type, color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglColorP3uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong colorAddress) { - glColorP3uivPROC glColorP3uiv = (glColorP3uivPROC)tlsGetFunction(712); - uintptr_t color = (uintptr_t)colorAddress; - UNUSED_PARAM(clazz) - glColorP3uiv(type, color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglColorP4uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong colorAddress) { - glColorP4uivPROC glColorP4uiv = (glColorP4uivPROC)tlsGetFunction(713); - uintptr_t color = (uintptr_t)colorAddress; - UNUSED_PARAM(clazz) - glColorP4uiv(type, color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_glSecondaryColorP3ui(JNIEnv *__env, jclass clazz, jint type, jint color) { - glSecondaryColorP3uiPROC glSecondaryColorP3ui = (glSecondaryColorP3uiPROC)tlsGetFunction(714); - UNUSED_PARAM(clazz) - glSecondaryColorP3ui(type, color); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33_nglSecondaryColorP3uiv__IJ(JNIEnv *__env, jclass clazz, jint type, jlong colorAddress) { - glSecondaryColorP3uivPROC glSecondaryColorP3uiv = (glSecondaryColorP3uivPROC)tlsGetFunction(715); - uintptr_t color = (uintptr_t)colorAddress; - UNUSED_PARAM(clazz) - glSecondaryColorP3uiv(type, color); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL33C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL33C.c deleted file mode 100644 index 83ce9515..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL33C.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBindFragDataLocationIndexedPROC) (jint, jint, jint, uintptr_t); -typedef jint (APIENTRY *glGetFragDataIndexPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenSamplersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeleteSamplersPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsSamplerPROC) (jint); -typedef void (APIENTRY *glBindSamplerPROC) (jint, jint); -typedef void (APIENTRY *glSamplerParameteriPROC) (jint, jint, jint); -typedef void (APIENTRY *glSamplerParameterfPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glSamplerParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glSamplerParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glSamplerParameterIivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glSamplerParameterIuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetSamplerParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetSamplerParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetSamplerParameterIivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetSamplerParameterIuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glQueryCounterPROC) (jint, jint); -typedef void (APIENTRY *glGetQueryObjecti64vPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryObjectui64vPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribDivisorPROC) (jint, jint); -typedef void (APIENTRY *glVertexAttribP1uiPROC) (jint, jint, jboolean, jint); -typedef void (APIENTRY *glVertexAttribP2uiPROC) (jint, jint, jboolean, jint); -typedef void (APIENTRY *glVertexAttribP3uiPROC) (jint, jint, jboolean, jint); -typedef void (APIENTRY *glVertexAttribP4uiPROC) (jint, jint, jboolean, jint); -typedef void (APIENTRY *glVertexAttribP1uivPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glVertexAttribP2uivPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glVertexAttribP3uivPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glVertexAttribP4uivPROC) (jint, jint, jboolean, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglBindFragDataLocationIndexed(JNIEnv *__env, jclass clazz, jint program, jint colorNumber, jint index, jlong nameAddress) { - glBindFragDataLocationIndexedPROC glBindFragDataLocationIndexed = (glBindFragDataLocationIndexedPROC)tlsGetFunction(666); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glBindFragDataLocationIndexed(program, colorNumber, index, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL33C_nglGetFragDataIndex(JNIEnv *__env, jclass clazz, jint program, jlong nameAddress) { - glGetFragDataIndexPROC glGetFragDataIndex = (glGetFragDataIndexPROC)tlsGetFunction(667); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetFragDataIndex(program, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglGenSamplers__IJ(JNIEnv *__env, jclass clazz, jint count, jlong samplersAddress) { - glGenSamplersPROC glGenSamplers = (glGenSamplersPROC)tlsGetFunction(668); - uintptr_t samplers = (uintptr_t)samplersAddress; - UNUSED_PARAM(clazz) - glGenSamplers(count, samplers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglDeleteSamplers__IJ(JNIEnv *__env, jclass clazz, jint count, jlong samplersAddress) { - glDeleteSamplersPROC glDeleteSamplers = (glDeleteSamplersPROC)tlsGetFunction(669); - uintptr_t samplers = (uintptr_t)samplersAddress; - UNUSED_PARAM(clazz) - glDeleteSamplers(count, samplers); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL33C_glIsSampler(JNIEnv *__env, jclass clazz, jint sampler) { - glIsSamplerPROC glIsSampler = (glIsSamplerPROC)tlsGetFunction(670); - UNUSED_PARAM(clazz) - return glIsSampler(sampler); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glBindSampler(JNIEnv *__env, jclass clazz, jint unit, jint sampler) { - glBindSamplerPROC glBindSampler = (glBindSamplerPROC)tlsGetFunction(671); - UNUSED_PARAM(clazz) - glBindSampler(unit, sampler); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glSamplerParameteri(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jint param) { - glSamplerParameteriPROC glSamplerParameteri = (glSamplerParameteriPROC)tlsGetFunction(672); - UNUSED_PARAM(clazz) - glSamplerParameteri(sampler, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glSamplerParameterf(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jfloat param) { - glSamplerParameterfPROC glSamplerParameterf = (glSamplerParameterfPROC)tlsGetFunction(673); - UNUSED_PARAM(clazz) - glSamplerParameterf(sampler, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglSamplerParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jlong paramsAddress) { - glSamplerParameterivPROC glSamplerParameteriv = (glSamplerParameterivPROC)tlsGetFunction(674); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glSamplerParameteriv(sampler, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglSamplerParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jlong paramsAddress) { - glSamplerParameterfvPROC glSamplerParameterfv = (glSamplerParameterfvPROC)tlsGetFunction(675); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glSamplerParameterfv(sampler, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglSamplerParameterIiv__IIJ(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jlong paramsAddress) { - glSamplerParameterIivPROC glSamplerParameterIiv = (glSamplerParameterIivPROC)tlsGetFunction(676); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glSamplerParameterIiv(sampler, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglSamplerParameterIuiv__IIJ(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jlong paramsAddress) { - glSamplerParameterIuivPROC glSamplerParameterIuiv = (glSamplerParameterIuivPROC)tlsGetFunction(677); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glSamplerParameterIuiv(sampler, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglGetSamplerParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jlong paramsAddress) { - glGetSamplerParameterivPROC glGetSamplerParameteriv = (glGetSamplerParameterivPROC)tlsGetFunction(678); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetSamplerParameteriv(sampler, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglGetSamplerParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jlong paramsAddress) { - glGetSamplerParameterfvPROC glGetSamplerParameterfv = (glGetSamplerParameterfvPROC)tlsGetFunction(679); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetSamplerParameterfv(sampler, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglGetSamplerParameterIiv__IIJ(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jlong paramsAddress) { - glGetSamplerParameterIivPROC glGetSamplerParameterIiv = (glGetSamplerParameterIivPROC)tlsGetFunction(680); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetSamplerParameterIiv(sampler, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglGetSamplerParameterIuiv__IIJ(JNIEnv *__env, jclass clazz, jint sampler, jint pname, jlong paramsAddress) { - glGetSamplerParameterIuivPROC glGetSamplerParameterIuiv = (glGetSamplerParameterIuivPROC)tlsGetFunction(681); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetSamplerParameterIuiv(sampler, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glQueryCounter(JNIEnv *__env, jclass clazz, jint id, jint target) { - glQueryCounterPROC glQueryCounter = (glQueryCounterPROC)tlsGetFunction(682); - UNUSED_PARAM(clazz) - glQueryCounter(id, target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglGetQueryObjecti64v__IIJ(JNIEnv *__env, jclass clazz, jint id, jint pname, jlong paramsAddress) { - glGetQueryObjecti64vPROC glGetQueryObjecti64v = (glGetQueryObjecti64vPROC)tlsGetFunction(683); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryObjecti64v(id, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglGetQueryObjectui64v__IIJ(JNIEnv *__env, jclass clazz, jint id, jint pname, jlong paramsAddress) { - glGetQueryObjectui64vPROC glGetQueryObjectui64v = (glGetQueryObjectui64vPROC)tlsGetFunction(684); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryObjectui64v(id, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glVertexAttribDivisor(JNIEnv *__env, jclass clazz, jint index, jint divisor) { - glVertexAttribDivisorPROC glVertexAttribDivisor = (glVertexAttribDivisorPROC)tlsGetFunction(685); - UNUSED_PARAM(clazz) - glVertexAttribDivisor(index, divisor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glVertexAttribP1ui(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jint value) { - glVertexAttribP1uiPROC glVertexAttribP1ui = (glVertexAttribP1uiPROC)tlsGetFunction(716); - UNUSED_PARAM(clazz) - glVertexAttribP1ui(index, type, normalized, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glVertexAttribP2ui(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jint value) { - glVertexAttribP2uiPROC glVertexAttribP2ui = (glVertexAttribP2uiPROC)tlsGetFunction(717); - UNUSED_PARAM(clazz) - glVertexAttribP2ui(index, type, normalized, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glVertexAttribP3ui(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jint value) { - glVertexAttribP3uiPROC glVertexAttribP3ui = (glVertexAttribP3uiPROC)tlsGetFunction(718); - UNUSED_PARAM(clazz) - glVertexAttribP3ui(index, type, normalized, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_glVertexAttribP4ui(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jint value) { - glVertexAttribP4uiPROC glVertexAttribP4ui = (glVertexAttribP4uiPROC)tlsGetFunction(719); - UNUSED_PARAM(clazz) - glVertexAttribP4ui(index, type, normalized, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglVertexAttribP1uiv__IIZJ(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jlong valueAddress) { - glVertexAttribP1uivPROC glVertexAttribP1uiv = (glVertexAttribP1uivPROC)tlsGetFunction(720); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glVertexAttribP1uiv(index, type, normalized, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglVertexAttribP2uiv__IIZJ(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jlong valueAddress) { - glVertexAttribP2uivPROC glVertexAttribP2uiv = (glVertexAttribP2uivPROC)tlsGetFunction(721); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glVertexAttribP2uiv(index, type, normalized, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglVertexAttribP3uiv__IIZJ(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jlong valueAddress) { - glVertexAttribP3uivPROC glVertexAttribP3uiv = (glVertexAttribP3uivPROC)tlsGetFunction(722); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glVertexAttribP3uiv(index, type, normalized, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL33C_nglVertexAttribP4uiv__IIZJ(JNIEnv *__env, jclass clazz, jint index, jint type, jboolean normalized, jlong valueAddress) { - glVertexAttribP4uivPROC glVertexAttribP4uiv = (glVertexAttribP4uivPROC)tlsGetFunction(723); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glVertexAttribP4uiv(index, type, normalized, value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL40C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL40C.c deleted file mode 100644 index 0e9a550d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL40C.c +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendEquationiPROC) (jint, jint); -typedef void (APIENTRY *glBlendEquationSeparateiPROC) (jint, jint, jint); -typedef void (APIENTRY *glBlendFunciPROC) (jint, jint, jint); -typedef void (APIENTRY *glBlendFuncSeparateiPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glDrawArraysIndirectPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDrawElementsIndirectPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform1dPROC) (jint, jdouble); -typedef void (APIENTRY *glUniform2dPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glUniform3dPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glUniform4dPROC) (jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glUniform1dvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2dvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3dvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4dvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniformMatrix2dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix3dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix4dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix2x3dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix2x4dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix3x2dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix3x4dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix4x2dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glUniformMatrix4x3dvPROC) (jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glGetUniformdvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glMinSampleShadingPROC) (jfloat); -typedef jint (APIENTRY *glGetSubroutineUniformLocationPROC) (jint, jint, uintptr_t); -typedef jint (APIENTRY *glGetSubroutineIndexPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetActiveSubroutineUniformivPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetActiveSubroutineUniformNamePROC) (jint, jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetActiveSubroutineNamePROC) (jint, jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glUniformSubroutinesuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformSubroutineuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramStageivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPatchParameteriPROC) (jint, jint); -typedef void (APIENTRY *glPatchParameterfvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glBindTransformFeedbackPROC) (jint, jint); -typedef void (APIENTRY *glDeleteTransformFeedbacksPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenTransformFeedbacksPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsTransformFeedbackPROC) (jint); -typedef void (APIENTRY *glPauseTransformFeedbackPROC) (void); -typedef void (APIENTRY *glResumeTransformFeedbackPROC) (void); -typedef void (APIENTRY *glDrawTransformFeedbackPROC) (jint, jint); -typedef void (APIENTRY *glDrawTransformFeedbackStreamPROC) (jint, jint, jint); -typedef void (APIENTRY *glBeginQueryIndexedPROC) (jint, jint, jint); -typedef void (APIENTRY *glEndQueryIndexedPROC) (jint, jint); -typedef void (APIENTRY *glGetQueryIndexedivPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glBlendEquationi(JNIEnv *__env, jclass clazz, jint buf, jint mode) { - glBlendEquationiPROC glBlendEquationi = (glBlendEquationiPROC)tlsGetFunction(724); - UNUSED_PARAM(clazz) - glBlendEquationi(buf, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glBlendEquationSeparatei(JNIEnv *__env, jclass clazz, jint buf, jint modeRGB, jint modeAlpha) { - glBlendEquationSeparateiPROC glBlendEquationSeparatei = (glBlendEquationSeparateiPROC)tlsGetFunction(725); - UNUSED_PARAM(clazz) - glBlendEquationSeparatei(buf, modeRGB, modeAlpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glBlendFunci(JNIEnv *__env, jclass clazz, jint buf, jint sfactor, jint dfactor) { - glBlendFunciPROC glBlendFunci = (glBlendFunciPROC)tlsGetFunction(726); - UNUSED_PARAM(clazz) - glBlendFunci(buf, sfactor, dfactor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glBlendFuncSeparatei(JNIEnv *__env, jclass clazz, jint buf, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { - glBlendFuncSeparateiPROC glBlendFuncSeparatei = (glBlendFuncSeparateiPROC)tlsGetFunction(727); - UNUSED_PARAM(clazz) - glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglDrawArraysIndirect__IJ(JNIEnv *__env, jclass clazz, jint mode, jlong indirectAddress) { - glDrawArraysIndirectPROC glDrawArraysIndirect = (glDrawArraysIndirectPROC)tlsGetFunction(728); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glDrawArraysIndirect(mode, indirect); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglDrawElementsIndirect__IIJ(JNIEnv *__env, jclass clazz, jint mode, jint type, jlong indirectAddress) { - glDrawElementsIndirectPROC glDrawElementsIndirect = (glDrawElementsIndirectPROC)tlsGetFunction(729); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glDrawElementsIndirect(mode, type, indirect); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glUniform1d(JNIEnv *__env, jclass clazz, jint location, jdouble x) { - glUniform1dPROC glUniform1d = (glUniform1dPROC)tlsGetFunction(730); - UNUSED_PARAM(clazz) - glUniform1d(location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glUniform2d(JNIEnv *__env, jclass clazz, jint location, jdouble x, jdouble y) { - glUniform2dPROC glUniform2d = (glUniform2dPROC)tlsGetFunction(731); - UNUSED_PARAM(clazz) - glUniform2d(location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glUniform3d(JNIEnv *__env, jclass clazz, jint location, jdouble x, jdouble y, jdouble z) { - glUniform3dPROC glUniform3d = (glUniform3dPROC)tlsGetFunction(732); - UNUSED_PARAM(clazz) - glUniform3d(location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glUniform4d(JNIEnv *__env, jclass clazz, jint location, jdouble x, jdouble y, jdouble z, jdouble w) { - glUniform4dPROC glUniform4d = (glUniform4dPROC)tlsGetFunction(733); - UNUSED_PARAM(clazz) - glUniform4d(location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniform1dv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1dvPROC glUniform1dv = (glUniform1dvPROC)tlsGetFunction(734); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1dv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniform2dv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2dvPROC glUniform2dv = (glUniform2dvPROC)tlsGetFunction(735); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2dv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniform3dv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3dvPROC glUniform3dv = (glUniform3dvPROC)tlsGetFunction(736); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3dv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniform4dv__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4dvPROC glUniform4dv = (glUniform4dvPROC)tlsGetFunction(737); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4dv(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix2dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix2dvPROC glUniformMatrix2dv = (glUniformMatrix2dvPROC)tlsGetFunction(738); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix2dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix3dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix3dvPROC glUniformMatrix3dv = (glUniformMatrix3dvPROC)tlsGetFunction(739); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix3dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix4dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix4dvPROC glUniformMatrix4dv = (glUniformMatrix4dvPROC)tlsGetFunction(740); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix4dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix2x3dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix2x3dvPROC glUniformMatrix2x3dv = (glUniformMatrix2x3dvPROC)tlsGetFunction(741); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix2x3dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix2x4dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix2x4dvPROC glUniformMatrix2x4dv = (glUniformMatrix2x4dvPROC)tlsGetFunction(742); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix2x4dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix3x2dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix3x2dvPROC glUniformMatrix3x2dv = (glUniformMatrix3x2dvPROC)tlsGetFunction(743); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix3x2dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix3x4dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix3x4dvPROC glUniformMatrix3x4dv = (glUniformMatrix3x4dvPROC)tlsGetFunction(744); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix3x4dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix4x2dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix4x2dvPROC glUniformMatrix4x2dv = (glUniformMatrix4x2dvPROC)tlsGetFunction(745); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix4x2dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformMatrix4x3dv__IIZJ(JNIEnv *__env, jclass clazz, jint location, jint count, jboolean transpose, jlong valueAddress) { - glUniformMatrix4x3dvPROC glUniformMatrix4x3dv = (glUniformMatrix4x3dvPROC)tlsGetFunction(746); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformMatrix4x3dv(location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglGetUniformdv__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformdvPROC glGetUniformdv = (glGetUniformdvPROC)tlsGetFunction(747); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformdv(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glMinSampleShading(JNIEnv *__env, jclass clazz, jfloat value) { - glMinSampleShadingPROC glMinSampleShading = (glMinSampleShadingPROC)tlsGetFunction(748); - UNUSED_PARAM(clazz) - glMinSampleShading(value); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL40C_nglGetSubroutineUniformLocation(JNIEnv *__env, jclass clazz, jint program, jint shadertype, jlong nameAddress) { - glGetSubroutineUniformLocationPROC glGetSubroutineUniformLocation = (glGetSubroutineUniformLocationPROC)tlsGetFunction(749); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetSubroutineUniformLocation(program, shadertype, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL40C_nglGetSubroutineIndex(JNIEnv *__env, jclass clazz, jint program, jint shadertype, jlong nameAddress) { - glGetSubroutineIndexPROC glGetSubroutineIndex = (glGetSubroutineIndexPROC)tlsGetFunction(750); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetSubroutineIndex(program, shadertype, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglGetActiveSubroutineUniformiv__IIIIJ(JNIEnv *__env, jclass clazz, jint program, jint shadertype, jint index, jint pname, jlong valuesAddress) { - glGetActiveSubroutineUniformivPROC glGetActiveSubroutineUniformiv = (glGetActiveSubroutineUniformivPROC)tlsGetFunction(751); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetActiveSubroutineUniformiv(program, shadertype, index, pname, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglGetActiveSubroutineUniformName__IIIIJJ(JNIEnv *__env, jclass clazz, jint program, jint shadertype, jint index, jint bufsize, jlong lengthAddress, jlong nameAddress) { - glGetActiveSubroutineUniformNamePROC glGetActiveSubroutineUniformName = (glGetActiveSubroutineUniformNamePROC)tlsGetFunction(752); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetActiveSubroutineUniformName(program, shadertype, index, bufsize, length, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglGetActiveSubroutineName__IIIIJJ(JNIEnv *__env, jclass clazz, jint program, jint shadertype, jint index, jint bufsize, jlong lengthAddress, jlong nameAddress) { - glGetActiveSubroutineNamePROC glGetActiveSubroutineName = (glGetActiveSubroutineNamePROC)tlsGetFunction(753); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetActiveSubroutineName(program, shadertype, index, bufsize, length, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglUniformSubroutinesuiv__IIJ(JNIEnv *__env, jclass clazz, jint shadertype, jint count, jlong indicesAddress) { - glUniformSubroutinesuivPROC glUniformSubroutinesuiv = (glUniformSubroutinesuivPROC)tlsGetFunction(754); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glUniformSubroutinesuiv(shadertype, count, indices); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglGetUniformSubroutineuiv__IIJ(JNIEnv *__env, jclass clazz, jint shadertype, jint location, jlong paramsAddress) { - glGetUniformSubroutineuivPROC glGetUniformSubroutineuiv = (glGetUniformSubroutineuivPROC)tlsGetFunction(755); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformSubroutineuiv(shadertype, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglGetProgramStageiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint shadertype, jint pname, jlong valuesAddress) { - glGetProgramStageivPROC glGetProgramStageiv = (glGetProgramStageivPROC)tlsGetFunction(756); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetProgramStageiv(program, shadertype, pname, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glPatchParameteri(JNIEnv *__env, jclass clazz, jint pname, jint value) { - glPatchParameteriPROC glPatchParameteri = (glPatchParameteriPROC)tlsGetFunction(757); - UNUSED_PARAM(clazz) - glPatchParameteri(pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglPatchParameterfv__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong valuesAddress) { - glPatchParameterfvPROC glPatchParameterfv = (glPatchParameterfvPROC)tlsGetFunction(758); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glPatchParameterfv(pname, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glBindTransformFeedback(JNIEnv *__env, jclass clazz, jint target, jint id) { - glBindTransformFeedbackPROC glBindTransformFeedback = (glBindTransformFeedbackPROC)tlsGetFunction(759); - UNUSED_PARAM(clazz) - glBindTransformFeedback(target, id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglDeleteTransformFeedbacks__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glDeleteTransformFeedbacksPROC glDeleteTransformFeedbacks = (glDeleteTransformFeedbacksPROC)tlsGetFunction(760); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glDeleteTransformFeedbacks(n, ids); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglGenTransformFeedbacks__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glGenTransformFeedbacksPROC glGenTransformFeedbacks = (glGenTransformFeedbacksPROC)tlsGetFunction(761); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glGenTransformFeedbacks(n, ids); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL40C_glIsTransformFeedback(JNIEnv *__env, jclass clazz, jint id) { - glIsTransformFeedbackPROC glIsTransformFeedback = (glIsTransformFeedbackPROC)tlsGetFunction(762); - UNUSED_PARAM(clazz) - return glIsTransformFeedback(id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glPauseTransformFeedback(JNIEnv *__env, jclass clazz) { - glPauseTransformFeedbackPROC glPauseTransformFeedback = (glPauseTransformFeedbackPROC)tlsGetFunction(763); - UNUSED_PARAM(clazz) - glPauseTransformFeedback(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glResumeTransformFeedback(JNIEnv *__env, jclass clazz) { - glResumeTransformFeedbackPROC glResumeTransformFeedback = (glResumeTransformFeedbackPROC)tlsGetFunction(764); - UNUSED_PARAM(clazz) - glResumeTransformFeedback(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glDrawTransformFeedback(JNIEnv *__env, jclass clazz, jint mode, jint id) { - glDrawTransformFeedbackPROC glDrawTransformFeedback = (glDrawTransformFeedbackPROC)tlsGetFunction(765); - UNUSED_PARAM(clazz) - glDrawTransformFeedback(mode, id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glDrawTransformFeedbackStream(JNIEnv *__env, jclass clazz, jint mode, jint id, jint stream) { - glDrawTransformFeedbackStreamPROC glDrawTransformFeedbackStream = (glDrawTransformFeedbackStreamPROC)tlsGetFunction(766); - UNUSED_PARAM(clazz) - glDrawTransformFeedbackStream(mode, id, stream); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glBeginQueryIndexed(JNIEnv *__env, jclass clazz, jint target, jint index, jint id) { - glBeginQueryIndexedPROC glBeginQueryIndexed = (glBeginQueryIndexedPROC)tlsGetFunction(767); - UNUSED_PARAM(clazz) - glBeginQueryIndexed(target, index, id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_glEndQueryIndexed(JNIEnv *__env, jclass clazz, jint target, jint index) { - glEndQueryIndexedPROC glEndQueryIndexed = (glEndQueryIndexedPROC)tlsGetFunction(768); - UNUSED_PARAM(clazz) - glEndQueryIndexed(target, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL40C_nglGetQueryIndexediv__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jint pname, jlong paramsAddress) { - glGetQueryIndexedivPROC glGetQueryIndexediv = (glGetQueryIndexedivPROC)tlsGetFunction(769); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetQueryIndexediv(target, index, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL41C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL41C.c deleted file mode 100644 index 443afe45..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL41C.c +++ /dev/null @@ -1,689 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glReleaseShaderCompilerPROC) (void); -typedef void (APIENTRY *glShaderBinaryPROC) (jint, uintptr_t, jint, uintptr_t, jint); -typedef void (APIENTRY *glGetShaderPrecisionFormatPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glDepthRangefPROC) (jfloat, jfloat); -typedef void (APIENTRY *glClearDepthfPROC) (jfloat); -typedef void (APIENTRY *glGetProgramBinaryPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glProgramBinaryPROC) (jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glProgramParameteriPROC) (jint, jint, jint); -typedef void (APIENTRY *glUseProgramStagesPROC) (jint, jint, jint); -typedef void (APIENTRY *glActiveShaderProgramPROC) (jint, jint); -typedef jint (APIENTRY *glCreateShaderProgramvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glBindProgramPipelinePROC) (jint); -typedef void (APIENTRY *glDeleteProgramPipelinesPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenProgramPipelinesPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsProgramPipelinePROC) (jint); -typedef void (APIENTRY *glGetProgramPipelineivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1iPROC) (jint, jint, jint); -typedef void (APIENTRY *glProgramUniform2iPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform3iPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform4iPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform1uiPROC) (jint, jint, jint); -typedef void (APIENTRY *glProgramUniform2uiPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform3uiPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform4uiPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glProgramUniform1fPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glProgramUniform2fPROC) (jint, jint, jfloat, jfloat); -typedef void (APIENTRY *glProgramUniform3fPROC) (jint, jint, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glProgramUniform4fPROC) (jint, jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glProgramUniform1dPROC) (jint, jint, jdouble); -typedef void (APIENTRY *glProgramUniform2dPROC) (jint, jint, jdouble, jdouble); -typedef void (APIENTRY *glProgramUniform3dPROC) (jint, jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glProgramUniform4dPROC) (jint, jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glProgramUniform1ivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2ivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3ivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4ivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1uivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2uivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3uivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4uivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1fvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2fvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3fvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4fvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1dvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2dvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3dvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4dvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2x3fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3x2fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2x4fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4x2fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3x4fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4x3fvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2x3dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3x2dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix2x4dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4x2dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix3x4dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glProgramUniformMatrix4x3dvPROC) (jint, jint, jint, jboolean, uintptr_t); -typedef void (APIENTRY *glValidateProgramPipelinePROC) (jint); -typedef void (APIENTRY *glGetProgramPipelineInfoLogPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glVertexAttribL1dPROC) (jint, jdouble); -typedef void (APIENTRY *glVertexAttribL2dPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttribL3dPROC) (jint, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttribL4dPROC) (jint, jdouble, jdouble, jdouble, jdouble); -typedef void (APIENTRY *glVertexAttribL1dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL2dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL3dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL4dvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribLPointerPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribLdvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glViewportArrayvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glViewportIndexedfPROC) (jint, jfloat, jfloat, jfloat, jfloat); -typedef void (APIENTRY *glViewportIndexedfvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glScissorArrayvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glScissorIndexedPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glScissorIndexedvPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDepthRangeArrayvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glDepthRangeIndexedPROC) (jint, jdouble, jdouble); -typedef void (APIENTRY *glGetFloati_vPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetDoublei_vPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glReleaseShaderCompiler(JNIEnv *__env, jclass clazz) { - glReleaseShaderCompilerPROC glReleaseShaderCompiler = (glReleaseShaderCompilerPROC)tlsGetFunction(770); - UNUSED_PARAM(clazz) - glReleaseShaderCompiler(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglShaderBinary__IJIJI(JNIEnv *__env, jclass clazz, jint count, jlong shadersAddress, jint binaryformat, jlong binaryAddress, jint length) { - glShaderBinaryPROC glShaderBinary = (glShaderBinaryPROC)tlsGetFunction(771); - uintptr_t shaders = (uintptr_t)shadersAddress; - uintptr_t binary = (uintptr_t)binaryAddress; - UNUSED_PARAM(clazz) - glShaderBinary(count, shaders, binaryformat, binary, length); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglGetShaderPrecisionFormat__IIJJ(JNIEnv *__env, jclass clazz, jint shadertype, jint precisiontype, jlong rangeAddress, jlong precisionAddress) { - glGetShaderPrecisionFormatPROC glGetShaderPrecisionFormat = (glGetShaderPrecisionFormatPROC)tlsGetFunction(772); - uintptr_t range = (uintptr_t)rangeAddress; - uintptr_t precision = (uintptr_t)precisionAddress; - UNUSED_PARAM(clazz) - glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glDepthRangef(JNIEnv *__env, jclass clazz, jfloat zNear, jfloat zFar) { - glDepthRangefPROC glDepthRangef = (glDepthRangefPROC)tlsGetFunction(773); - UNUSED_PARAM(clazz) - glDepthRangef(zNear, zFar); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glClearDepthf(JNIEnv *__env, jclass clazz, jfloat depth) { - glClearDepthfPROC glClearDepthf = (glClearDepthfPROC)tlsGetFunction(774); - UNUSED_PARAM(clazz) - glClearDepthf(depth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglGetProgramBinary__IIJJJ(JNIEnv *__env, jclass clazz, jint program, jint bufSize, jlong lengthAddress, jlong binaryFormatAddress, jlong binaryAddress) { - glGetProgramBinaryPROC glGetProgramBinary = (glGetProgramBinaryPROC)tlsGetFunction(775); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t binaryFormat = (uintptr_t)binaryFormatAddress; - uintptr_t binary = (uintptr_t)binaryAddress; - UNUSED_PARAM(clazz) - glGetProgramBinary(program, bufSize, length, binaryFormat, binary); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramBinary(JNIEnv *__env, jclass clazz, jint program, jint binaryFormat, jlong binaryAddress, jint length) { - glProgramBinaryPROC glProgramBinary = (glProgramBinaryPROC)tlsGetFunction(776); - uintptr_t binary = (uintptr_t)binaryAddress; - UNUSED_PARAM(clazz) - glProgramBinary(program, binaryFormat, binary, length); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramParameteri(JNIEnv *__env, jclass clazz, jint program, jint pname, jint value) { - glProgramParameteriPROC glProgramParameteri = (glProgramParameteriPROC)tlsGetFunction(777); - UNUSED_PARAM(clazz) - glProgramParameteri(program, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glUseProgramStages(JNIEnv *__env, jclass clazz, jint pipeline, jint stages, jint program) { - glUseProgramStagesPROC glUseProgramStages = (glUseProgramStagesPROC)tlsGetFunction(778); - UNUSED_PARAM(clazz) - glUseProgramStages(pipeline, stages, program); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glActiveShaderProgram(JNIEnv *__env, jclass clazz, jint pipeline, jint program) { - glActiveShaderProgramPROC glActiveShaderProgram = (glActiveShaderProgramPROC)tlsGetFunction(779); - UNUSED_PARAM(clazz) - glActiveShaderProgram(pipeline, program); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL41C_nglCreateShaderProgramv(JNIEnv *__env, jclass clazz, jint type, jint count, jlong stringsAddress) { - glCreateShaderProgramvPROC glCreateShaderProgramv = (glCreateShaderProgramvPROC)tlsGetFunction(780); - uintptr_t strings = (uintptr_t)stringsAddress; - UNUSED_PARAM(clazz) - return glCreateShaderProgramv(type, count, strings); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glBindProgramPipeline(JNIEnv *__env, jclass clazz, jint pipeline) { - glBindProgramPipelinePROC glBindProgramPipeline = (glBindProgramPipelinePROC)tlsGetFunction(781); - UNUSED_PARAM(clazz) - glBindProgramPipeline(pipeline); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglDeleteProgramPipelines__IJ(JNIEnv *__env, jclass clazz, jint n, jlong pipelinesAddress) { - glDeleteProgramPipelinesPROC glDeleteProgramPipelines = (glDeleteProgramPipelinesPROC)tlsGetFunction(782); - uintptr_t pipelines = (uintptr_t)pipelinesAddress; - UNUSED_PARAM(clazz) - glDeleteProgramPipelines(n, pipelines); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglGenProgramPipelines__IJ(JNIEnv *__env, jclass clazz, jint n, jlong pipelinesAddress) { - glGenProgramPipelinesPROC glGenProgramPipelines = (glGenProgramPipelinesPROC)tlsGetFunction(783); - uintptr_t pipelines = (uintptr_t)pipelinesAddress; - UNUSED_PARAM(clazz) - glGenProgramPipelines(n, pipelines); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL41C_glIsProgramPipeline(JNIEnv *__env, jclass clazz, jint pipeline) { - glIsProgramPipelinePROC glIsProgramPipeline = (glIsProgramPipelinePROC)tlsGetFunction(784); - UNUSED_PARAM(clazz) - return glIsProgramPipeline(pipeline); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglGetProgramPipelineiv__IIJ(JNIEnv *__env, jclass clazz, jint pipeline, jint pname, jlong paramsAddress) { - glGetProgramPipelineivPROC glGetProgramPipelineiv = (glGetProgramPipelineivPROC)tlsGetFunction(785); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramPipelineiv(pipeline, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform1i(JNIEnv *__env, jclass clazz, jint program, jint location, jint x) { - glProgramUniform1iPROC glProgramUniform1i = (glProgramUniform1iPROC)tlsGetFunction(786); - UNUSED_PARAM(clazz) - glProgramUniform1i(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform2i(JNIEnv *__env, jclass clazz, jint program, jint location, jint x, jint y) { - glProgramUniform2iPROC glProgramUniform2i = (glProgramUniform2iPROC)tlsGetFunction(787); - UNUSED_PARAM(clazz) - glProgramUniform2i(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform3i(JNIEnv *__env, jclass clazz, jint program, jint location, jint x, jint y, jint z) { - glProgramUniform3iPROC glProgramUniform3i = (glProgramUniform3iPROC)tlsGetFunction(788); - UNUSED_PARAM(clazz) - glProgramUniform3i(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform4i(JNIEnv *__env, jclass clazz, jint program, jint location, jint x, jint y, jint z, jint w) { - glProgramUniform4iPROC glProgramUniform4i = (glProgramUniform4iPROC)tlsGetFunction(789); - UNUSED_PARAM(clazz) - glProgramUniform4i(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform1ui(JNIEnv *__env, jclass clazz, jint program, jint location, jint x) { - glProgramUniform1uiPROC glProgramUniform1ui = (glProgramUniform1uiPROC)tlsGetFunction(790); - UNUSED_PARAM(clazz) - glProgramUniform1ui(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform2ui(JNIEnv *__env, jclass clazz, jint program, jint location, jint x, jint y) { - glProgramUniform2uiPROC glProgramUniform2ui = (glProgramUniform2uiPROC)tlsGetFunction(791); - UNUSED_PARAM(clazz) - glProgramUniform2ui(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform3ui(JNIEnv *__env, jclass clazz, jint program, jint location, jint x, jint y, jint z) { - glProgramUniform3uiPROC glProgramUniform3ui = (glProgramUniform3uiPROC)tlsGetFunction(792); - UNUSED_PARAM(clazz) - glProgramUniform3ui(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform4ui(JNIEnv *__env, jclass clazz, jint program, jint location, jint x, jint y, jint z, jint w) { - glProgramUniform4uiPROC glProgramUniform4ui = (glProgramUniform4uiPROC)tlsGetFunction(793); - UNUSED_PARAM(clazz) - glProgramUniform4ui(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform1f(JNIEnv *__env, jclass clazz, jint program, jint location, jfloat x) { - glProgramUniform1fPROC glProgramUniform1f = (glProgramUniform1fPROC)tlsGetFunction(794); - UNUSED_PARAM(clazz) - glProgramUniform1f(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform2f(JNIEnv *__env, jclass clazz, jint program, jint location, jfloat x, jfloat y) { - glProgramUniform2fPROC glProgramUniform2f = (glProgramUniform2fPROC)tlsGetFunction(795); - UNUSED_PARAM(clazz) - glProgramUniform2f(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform3f(JNIEnv *__env, jclass clazz, jint program, jint location, jfloat x, jfloat y, jfloat z) { - glProgramUniform3fPROC glProgramUniform3f = (glProgramUniform3fPROC)tlsGetFunction(796); - UNUSED_PARAM(clazz) - glProgramUniform3f(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform4f(JNIEnv *__env, jclass clazz, jint program, jint location, jfloat x, jfloat y, jfloat z, jfloat w) { - glProgramUniform4fPROC glProgramUniform4f = (glProgramUniform4fPROC)tlsGetFunction(797); - UNUSED_PARAM(clazz) - glProgramUniform4f(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform1d(JNIEnv *__env, jclass clazz, jint program, jint location, jdouble x) { - glProgramUniform1dPROC glProgramUniform1d = (glProgramUniform1dPROC)tlsGetFunction(798); - UNUSED_PARAM(clazz) - glProgramUniform1d(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform2d(JNIEnv *__env, jclass clazz, jint program, jint location, jdouble x, jdouble y) { - glProgramUniform2dPROC glProgramUniform2d = (glProgramUniform2dPROC)tlsGetFunction(799); - UNUSED_PARAM(clazz) - glProgramUniform2d(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform3d(JNIEnv *__env, jclass clazz, jint program, jint location, jdouble x, jdouble y, jdouble z) { - glProgramUniform3dPROC glProgramUniform3d = (glProgramUniform3dPROC)tlsGetFunction(800); - UNUSED_PARAM(clazz) - glProgramUniform3d(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glProgramUniform4d(JNIEnv *__env, jclass clazz, jint program, jint location, jdouble x, jdouble y, jdouble z, jdouble w) { - glProgramUniform4dPROC glProgramUniform4d = (glProgramUniform4dPROC)tlsGetFunction(801); - UNUSED_PARAM(clazz) - glProgramUniform4d(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform1iv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1ivPROC glProgramUniform1iv = (glProgramUniform1ivPROC)tlsGetFunction(802); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1iv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform2iv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2ivPROC glProgramUniform2iv = (glProgramUniform2ivPROC)tlsGetFunction(803); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2iv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform3iv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3ivPROC glProgramUniform3iv = (glProgramUniform3ivPROC)tlsGetFunction(804); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3iv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform4iv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4ivPROC glProgramUniform4iv = (glProgramUniform4ivPROC)tlsGetFunction(805); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4iv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform1uiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1uivPROC glProgramUniform1uiv = (glProgramUniform1uivPROC)tlsGetFunction(806); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1uiv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform2uiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2uivPROC glProgramUniform2uiv = (glProgramUniform2uivPROC)tlsGetFunction(807); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2uiv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform3uiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3uivPROC glProgramUniform3uiv = (glProgramUniform3uivPROC)tlsGetFunction(808); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3uiv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform4uiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4uivPROC glProgramUniform4uiv = (glProgramUniform4uivPROC)tlsGetFunction(809); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4uiv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform1fv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1fvPROC glProgramUniform1fv = (glProgramUniform1fvPROC)tlsGetFunction(810); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1fv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform2fv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2fvPROC glProgramUniform2fv = (glProgramUniform2fvPROC)tlsGetFunction(811); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2fv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform3fv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3fvPROC glProgramUniform3fv = (glProgramUniform3fvPROC)tlsGetFunction(812); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3fv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform4fv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4fvPROC glProgramUniform4fv = (glProgramUniform4fvPROC)tlsGetFunction(813); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4fv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform1dv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1dvPROC glProgramUniform1dv = (glProgramUniform1dvPROC)tlsGetFunction(814); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1dv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform2dv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2dvPROC glProgramUniform2dv = (glProgramUniform2dvPROC)tlsGetFunction(815); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2dv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform3dv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3dvPROC glProgramUniform3dv = (glProgramUniform3dvPROC)tlsGetFunction(816); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3dv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniform4dv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4dvPROC glProgramUniform4dv = (glProgramUniform4dvPROC)tlsGetFunction(817); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4dv(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix2fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2fvPROC glProgramUniformMatrix2fv = (glProgramUniformMatrix2fvPROC)tlsGetFunction(818); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix3fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3fvPROC glProgramUniformMatrix3fv = (glProgramUniformMatrix3fvPROC)tlsGetFunction(819); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix4fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4fvPROC glProgramUniformMatrix4fv = (glProgramUniformMatrix4fvPROC)tlsGetFunction(820); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix2dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2dvPROC glProgramUniformMatrix2dv = (glProgramUniformMatrix2dvPROC)tlsGetFunction(821); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix3dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3dvPROC glProgramUniformMatrix3dv = (glProgramUniformMatrix3dvPROC)tlsGetFunction(822); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix4dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4dvPROC glProgramUniformMatrix4dv = (glProgramUniformMatrix4dvPROC)tlsGetFunction(823); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix2x3fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2x3fvPROC glProgramUniformMatrix2x3fv = (glProgramUniformMatrix2x3fvPROC)tlsGetFunction(824); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2x3fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix3x2fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3x2fvPROC glProgramUniformMatrix3x2fv = (glProgramUniformMatrix3x2fvPROC)tlsGetFunction(825); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3x2fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix2x4fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2x4fvPROC glProgramUniformMatrix2x4fv = (glProgramUniformMatrix2x4fvPROC)tlsGetFunction(826); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2x4fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix4x2fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4x2fvPROC glProgramUniformMatrix4x2fv = (glProgramUniformMatrix4x2fvPROC)tlsGetFunction(827); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4x2fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix3x4fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3x4fvPROC glProgramUniformMatrix3x4fv = (glProgramUniformMatrix3x4fvPROC)tlsGetFunction(828); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3x4fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix4x3fv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4x3fvPROC glProgramUniformMatrix4x3fv = (glProgramUniformMatrix4x3fvPROC)tlsGetFunction(829); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4x3fv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix2x3dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2x3dvPROC glProgramUniformMatrix2x3dv = (glProgramUniformMatrix2x3dvPROC)tlsGetFunction(830); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2x3dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix3x2dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3x2dvPROC glProgramUniformMatrix3x2dv = (glProgramUniformMatrix3x2dvPROC)tlsGetFunction(831); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3x2dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix2x4dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix2x4dvPROC glProgramUniformMatrix2x4dv = (glProgramUniformMatrix2x4dvPROC)tlsGetFunction(832); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix2x4dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix4x2dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4x2dvPROC glProgramUniformMatrix4x2dv = (glProgramUniformMatrix4x2dvPROC)tlsGetFunction(833); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4x2dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix3x4dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix3x4dvPROC glProgramUniformMatrix3x4dv = (glProgramUniformMatrix3x4dvPROC)tlsGetFunction(834); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix3x4dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglProgramUniformMatrix4x3dv__IIIZJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jboolean transpose, jlong valueAddress) { - glProgramUniformMatrix4x3dvPROC glProgramUniformMatrix4x3dv = (glProgramUniformMatrix4x3dvPROC)tlsGetFunction(835); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformMatrix4x3dv(program, location, count, transpose, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glValidateProgramPipeline(JNIEnv *__env, jclass clazz, jint pipeline) { - glValidateProgramPipelinePROC glValidateProgramPipeline = (glValidateProgramPipelinePROC)tlsGetFunction(836); - UNUSED_PARAM(clazz) - glValidateProgramPipeline(pipeline); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglGetProgramPipelineInfoLog__IIJJ(JNIEnv *__env, jclass clazz, jint pipeline, jint bufSize, jlong lengthAddress, jlong infoLogAddress) { - glGetProgramPipelineInfoLogPROC glGetProgramPipelineInfoLog = (glGetProgramPipelineInfoLogPROC)tlsGetFunction(837); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t infoLog = (uintptr_t)infoLogAddress; - UNUSED_PARAM(clazz) - glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glVertexAttribL1d(JNIEnv *__env, jclass clazz, jint index, jdouble x) { - glVertexAttribL1dPROC glVertexAttribL1d = (glVertexAttribL1dPROC)tlsGetFunction(838); - UNUSED_PARAM(clazz) - glVertexAttribL1d(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glVertexAttribL2d(JNIEnv *__env, jclass clazz, jint index, jdouble x, jdouble y) { - glVertexAttribL2dPROC glVertexAttribL2d = (glVertexAttribL2dPROC)tlsGetFunction(839); - UNUSED_PARAM(clazz) - glVertexAttribL2d(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glVertexAttribL3d(JNIEnv *__env, jclass clazz, jint index, jdouble x, jdouble y, jdouble z) { - glVertexAttribL3dPROC glVertexAttribL3d = (glVertexAttribL3dPROC)tlsGetFunction(840); - UNUSED_PARAM(clazz) - glVertexAttribL3d(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glVertexAttribL4d(JNIEnv *__env, jclass clazz, jint index, jdouble x, jdouble y, jdouble z, jdouble w) { - glVertexAttribL4dPROC glVertexAttribL4d = (glVertexAttribL4dPROC)tlsGetFunction(841); - UNUSED_PARAM(clazz) - glVertexAttribL4d(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglVertexAttribL1dv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL1dvPROC glVertexAttribL1dv = (glVertexAttribL1dvPROC)tlsGetFunction(842); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL1dv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglVertexAttribL2dv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL2dvPROC glVertexAttribL2dv = (glVertexAttribL2dvPROC)tlsGetFunction(843); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL2dv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglVertexAttribL3dv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL3dvPROC glVertexAttribL3dv = (glVertexAttribL3dvPROC)tlsGetFunction(844); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL3dv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglVertexAttribL4dv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL4dvPROC glVertexAttribL4dv = (glVertexAttribL4dvPROC)tlsGetFunction(845); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL4dv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglVertexAttribLPointer(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jint stride, jlong pointerAddress) { - glVertexAttribLPointerPROC glVertexAttribLPointer = (glVertexAttribLPointerPROC)tlsGetFunction(846); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glVertexAttribLPointer(index, size, type, stride, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglGetVertexAttribLdv__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribLdvPROC glGetVertexAttribLdv = (glGetVertexAttribLdvPROC)tlsGetFunction(847); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribLdv(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglViewportArrayv__IIJ(JNIEnv *__env, jclass clazz, jint first, jint count, jlong vAddress) { - glViewportArrayvPROC glViewportArrayv = (glViewportArrayvPROC)tlsGetFunction(848); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glViewportArrayv(first, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glViewportIndexedf(JNIEnv *__env, jclass clazz, jint index, jfloat x, jfloat y, jfloat w, jfloat h) { - glViewportIndexedfPROC glViewportIndexedf = (glViewportIndexedfPROC)tlsGetFunction(849); - UNUSED_PARAM(clazz) - glViewportIndexedf(index, x, y, w, h); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglViewportIndexedfv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glViewportIndexedfvPROC glViewportIndexedfv = (glViewportIndexedfvPROC)tlsGetFunction(850); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glViewportIndexedfv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglScissorArrayv__IIJ(JNIEnv *__env, jclass clazz, jint first, jint count, jlong vAddress) { - glScissorArrayvPROC glScissorArrayv = (glScissorArrayvPROC)tlsGetFunction(851); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glScissorArrayv(first, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glScissorIndexed(JNIEnv *__env, jclass clazz, jint index, jint left, jint bottom, jint width, jint height) { - glScissorIndexedPROC glScissorIndexed = (glScissorIndexedPROC)tlsGetFunction(852); - UNUSED_PARAM(clazz) - glScissorIndexed(index, left, bottom, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglScissorIndexedv__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glScissorIndexedvPROC glScissorIndexedv = (glScissorIndexedvPROC)tlsGetFunction(853); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glScissorIndexedv(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglDepthRangeArrayv__IIJ(JNIEnv *__env, jclass clazz, jint first, jint count, jlong vAddress) { - glDepthRangeArrayvPROC glDepthRangeArrayv = (glDepthRangeArrayvPROC)tlsGetFunction(854); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glDepthRangeArrayv(first, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_glDepthRangeIndexed(JNIEnv *__env, jclass clazz, jint index, jdouble zNear, jdouble zFar) { - glDepthRangeIndexedPROC glDepthRangeIndexed = (glDepthRangeIndexedPROC)tlsGetFunction(855); - UNUSED_PARAM(clazz) - glDepthRangeIndexed(index, zNear, zFar); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglGetFloati_1v__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong dataAddress) { - glGetFloati_vPROC glGetFloati_v = (glGetFloati_vPROC)tlsGetFunction(856); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetFloati_v(target, index, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL41C_nglGetDoublei_1v__IIJ(JNIEnv *__env, jclass clazz, jint target, jint index, jlong dataAddress) { - glGetDoublei_vPROC glGetDoublei_v = (glGetDoublei_vPROC)tlsGetFunction(857); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetDoublei_v(target, index, data); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL42C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL42C.c deleted file mode 100644 index 55e57c0e..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL42C.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetActiveAtomicCounterBufferivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTexStorage1DPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glTexStorage2DPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTexStorage3DPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glDrawTransformFeedbackInstancedPROC) (jint, jint, jint); -typedef void (APIENTRY *glDrawTransformFeedbackStreamInstancedPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glDrawArraysInstancedBaseInstancePROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glDrawElementsInstancedBaseInstancePROC) (jint, jint, jint, uintptr_t, jint, jint); -typedef void (APIENTRY *glDrawElementsInstancedBaseVertexBaseInstancePROC) (jint, jint, jint, uintptr_t, jint, jint, jint); -typedef void (APIENTRY *glBindImageTexturePROC) (jint, jint, jint, jboolean, jint, jint, jint); -typedef void (APIENTRY *glMemoryBarrierPROC) (jint); -typedef void (APIENTRY *glGetInternalformativPROC) (jint, jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_nglGetActiveAtomicCounterBufferiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint bufferIndex, jint pname, jlong paramsAddress) { - glGetActiveAtomicCounterBufferivPROC glGetActiveAtomicCounterBufferiv = (glGetActiveAtomicCounterBufferivPROC)tlsGetFunction(858); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_glTexStorage1D(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalformat, jint width) { - glTexStorage1DPROC glTexStorage1D = (glTexStorage1DPROC)tlsGetFunction(859); - UNUSED_PARAM(clazz) - glTexStorage1D(target, levels, internalformat, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_glTexStorage2D(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalformat, jint width, jint height) { - glTexStorage2DPROC glTexStorage2D = (glTexStorage2DPROC)tlsGetFunction(860); - UNUSED_PARAM(clazz) - glTexStorage2D(target, levels, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_glTexStorage3D(JNIEnv *__env, jclass clazz, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) { - glTexStorage3DPROC glTexStorage3D = (glTexStorage3DPROC)tlsGetFunction(861); - UNUSED_PARAM(clazz) - glTexStorage3D(target, levels, internalformat, width, height, depth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_glDrawTransformFeedbackInstanced(JNIEnv *__env, jclass clazz, jint mode, jint id, jint primcount) { - glDrawTransformFeedbackInstancedPROC glDrawTransformFeedbackInstanced = (glDrawTransformFeedbackInstancedPROC)tlsGetFunction(862); - UNUSED_PARAM(clazz) - glDrawTransformFeedbackInstanced(mode, id, primcount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_glDrawTransformFeedbackStreamInstanced(JNIEnv *__env, jclass clazz, jint mode, jint id, jint stream, jint primcount) { - glDrawTransformFeedbackStreamInstancedPROC glDrawTransformFeedbackStreamInstanced = (glDrawTransformFeedbackStreamInstancedPROC)tlsGetFunction(863); - UNUSED_PARAM(clazz) - glDrawTransformFeedbackStreamInstanced(mode, id, stream, primcount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_glDrawArraysInstancedBaseInstance(JNIEnv *__env, jclass clazz, jint mode, jint first, jint count, jint primcount, jint baseinstance) { - glDrawArraysInstancedBaseInstancePROC glDrawArraysInstancedBaseInstance = (glDrawArraysInstancedBaseInstancePROC)tlsGetFunction(864); - UNUSED_PARAM(clazz) - glDrawArraysInstancedBaseInstance(mode, first, count, primcount, baseinstance); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_nglDrawElementsInstancedBaseInstance(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress, jint primcount, jint baseinstance) { - glDrawElementsInstancedBaseInstancePROC glDrawElementsInstancedBaseInstance = (glDrawElementsInstancedBaseInstancePROC)tlsGetFunction(865); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawElementsInstancedBaseInstance(mode, count, type, indices, primcount, baseinstance); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_nglDrawElementsInstancedBaseVertexBaseInstance(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress, jint primcount, jint basevertex, jint baseinstance) { - glDrawElementsInstancedBaseVertexBaseInstancePROC glDrawElementsInstancedBaseVertexBaseInstance = (glDrawElementsInstancedBaseVertexBaseInstancePROC)tlsGetFunction(866); - uintptr_t indices = (uintptr_t)indicesAddress; - UNUSED_PARAM(clazz) - glDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, primcount, basevertex, baseinstance); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_glBindImageTexture(JNIEnv *__env, jclass clazz, jint unit, jint texture, jint level, jboolean layered, jint layer, jint access, jint format) { - glBindImageTexturePROC glBindImageTexture = (glBindImageTexturePROC)tlsGetFunction(867); - UNUSED_PARAM(clazz) - glBindImageTexture(unit, texture, level, layered, layer, access, format); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_glMemoryBarrier(JNIEnv *__env, jclass clazz, jint barriers) { - glMemoryBarrierPROC glMemoryBarrier = (glMemoryBarrierPROC)tlsGetFunction(868); - UNUSED_PARAM(clazz) - glMemoryBarrier(barriers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL42C_nglGetInternalformativ__IIIIJ(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint pname, jint bufSize, jlong paramsAddress) { - glGetInternalformativPROC glGetInternalformativ = (glGetInternalformativPROC)tlsGetFunction(869); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetInternalformativ(target, internalformat, pname, bufSize, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL43C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL43C.c deleted file mode 100644 index eb4a367b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL43C.c +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glClearBufferDataPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glClearBufferSubDataPROC) (jint, jint, uintptr_t, uintptr_t, jint, jint, uintptr_t); -typedef void (APIENTRY *glDispatchComputePROC) (jint, jint, jint); -typedef void (APIENTRY *glDispatchComputeIndirectPROC) (uintptr_t); -typedef void (APIENTRY *glCopyImageSubDataPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glDebugMessageControlPROC) (jint, jint, jint, jint, uintptr_t, jboolean); -typedef void (APIENTRY *glDebugMessageInsertPROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glDebugMessageCallbackPROC) (uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetDebugMessageLogPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glPushDebugGroupPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPopDebugGroupPROC) (void); -typedef void (APIENTRY *glObjectLabelPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetObjectLabelPROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glObjectPtrLabelPROC) (uintptr_t, jint, uintptr_t); -typedef void (APIENTRY *glGetObjectPtrLabelPROC) (uintptr_t, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glFramebufferParameteriPROC) (jint, jint, jint); -typedef void (APIENTRY *glGetFramebufferParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetInternalformati64vPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glInvalidateTexSubImagePROC) (jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glInvalidateTexImagePROC) (jint, jint); -typedef void (APIENTRY *glInvalidateBufferSubDataPROC) (jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glInvalidateBufferDataPROC) (jint); -typedef void (APIENTRY *glInvalidateFramebufferPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glInvalidateSubFramebufferPROC) (jint, jint, uintptr_t, jint, jint, jint, jint); -typedef void (APIENTRY *glMultiDrawArraysIndirectPROC) (jint, uintptr_t, jint, jint); -typedef void (APIENTRY *glMultiDrawElementsIndirectPROC) (jint, jint, uintptr_t, jint, jint); -typedef void (APIENTRY *glGetProgramInterfaceivPROC) (jint, jint, jint, uintptr_t); -typedef jint (APIENTRY *glGetProgramResourceIndexPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetProgramResourceNamePROC) (jint, jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetProgramResourceivPROC) (jint, jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t); -typedef jint (APIENTRY *glGetProgramResourceLocationPROC) (jint, jint, uintptr_t); -typedef jint (APIENTRY *glGetProgramResourceLocationIndexPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glShaderStorageBlockBindingPROC) (jint, jint, jint); -typedef void (APIENTRY *glTexBufferRangePROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glTexStorage2DMultisamplePROC) (jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTexStorage3DMultisamplePROC) (jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTextureViewPROC) (jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glBindVertexBufferPROC) (jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glVertexAttribFormatPROC) (jint, jint, jint, jboolean, jint); -typedef void (APIENTRY *glVertexAttribIFormatPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribLFormatPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glVertexAttribBindingPROC) (jint, jint); -typedef void (APIENTRY *glVertexBindingDivisorPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglClearBufferData__IIIIJ(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint format, jint type, jlong dataAddress) { - glClearBufferDataPROC glClearBufferData = (glClearBufferDataPROC)tlsGetFunction(870); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glClearBufferData(target, internalformat, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglClearBufferSubData__IIJJIIJ(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jlong offset, jlong size, jint format, jint type, jlong dataAddress) { - glClearBufferSubDataPROC glClearBufferSubData = (glClearBufferSubDataPROC)tlsGetFunction(871); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glClearBufferSubData(target, internalformat, (uintptr_t)offset, (uintptr_t)size, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glDispatchCompute(JNIEnv *__env, jclass clazz, jint num_groups_x, jint num_groups_y, jint num_groups_z) { - glDispatchComputePROC glDispatchCompute = (glDispatchComputePROC)tlsGetFunction(872); - UNUSED_PARAM(clazz) - glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glDispatchComputeIndirect(JNIEnv *__env, jclass clazz, jlong indirect) { - glDispatchComputeIndirectPROC glDispatchComputeIndirect = (glDispatchComputeIndirectPROC)tlsGetFunction(873); - UNUSED_PARAM(clazz) - glDispatchComputeIndirect((uintptr_t)indirect); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glCopyImageSubData(JNIEnv *__env, jclass clazz, jint srcName, jint srcTarget, jint srcLevel, jint srcX, jint srcY, jint srcZ, jint dstName, jint dstTarget, jint dstLevel, jint dstX, jint dstY, jint dstZ, jint srcWidth, jint srcHeight, jint srcDepth) { - glCopyImageSubDataPROC glCopyImageSubData = (glCopyImageSubDataPROC)tlsGetFunction(874); - UNUSED_PARAM(clazz) - glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglDebugMessageControl__IIIIJZ(JNIEnv *__env, jclass clazz, jint source, jint type, jint severity, jint count, jlong idsAddress, jboolean enabled) { - glDebugMessageControlPROC glDebugMessageControl = (glDebugMessageControlPROC)tlsGetFunction(875); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glDebugMessageControl(source, type, severity, count, ids, enabled); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglDebugMessageInsert(JNIEnv *__env, jclass clazz, jint source, jint type, jint id, jint severity, jint length, jlong messageAddress) { - glDebugMessageInsertPROC glDebugMessageInsert = (glDebugMessageInsertPROC)tlsGetFunction(876); - uintptr_t message = (uintptr_t)messageAddress; - UNUSED_PARAM(clazz) - glDebugMessageInsert(source, type, id, severity, length, message); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglDebugMessageCallback(JNIEnv *__env, jclass clazz, jlong callbackAddress, jlong userParamAddress) { - glDebugMessageCallbackPROC glDebugMessageCallback = (glDebugMessageCallbackPROC)tlsGetFunction(877); - uintptr_t callback = (uintptr_t)callbackAddress; - uintptr_t userParam = (uintptr_t)userParamAddress; - UNUSED_PARAM(clazz) - glDebugMessageCallback(callback, userParam); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL43C_nglGetDebugMessageLog__IIJJJJJJ(JNIEnv *__env, jclass clazz, jint count, jint bufsize, jlong sourcesAddress, jlong typesAddress, jlong idsAddress, jlong severitiesAddress, jlong lengthsAddress, jlong messageLogAddress) { - glGetDebugMessageLogPROC glGetDebugMessageLog = (glGetDebugMessageLogPROC)tlsGetFunction(878); - uintptr_t sources = (uintptr_t)sourcesAddress; - uintptr_t types = (uintptr_t)typesAddress; - uintptr_t ids = (uintptr_t)idsAddress; - uintptr_t severities = (uintptr_t)severitiesAddress; - uintptr_t lengths = (uintptr_t)lengthsAddress; - uintptr_t messageLog = (uintptr_t)messageLogAddress; - UNUSED_PARAM(clazz) - return glGetDebugMessageLog(count, bufsize, sources, types, ids, severities, lengths, messageLog); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglPushDebugGroup(JNIEnv *__env, jclass clazz, jint source, jint id, jint length, jlong messageAddress) { - glPushDebugGroupPROC glPushDebugGroup = (glPushDebugGroupPROC)tlsGetFunction(879); - uintptr_t message = (uintptr_t)messageAddress; - UNUSED_PARAM(clazz) - glPushDebugGroup(source, id, length, message); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glPopDebugGroup(JNIEnv *__env, jclass clazz) { - glPopDebugGroupPROC glPopDebugGroup = (glPopDebugGroupPROC)tlsGetFunction(880); - UNUSED_PARAM(clazz) - glPopDebugGroup(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglObjectLabel(JNIEnv *__env, jclass clazz, jint identifier, jint name, jint length, jlong labelAddress) { - glObjectLabelPROC glObjectLabel = (glObjectLabelPROC)tlsGetFunction(881); - uintptr_t label = (uintptr_t)labelAddress; - UNUSED_PARAM(clazz) - glObjectLabel(identifier, name, length, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglGetObjectLabel__IIIJJ(JNIEnv *__env, jclass clazz, jint identifier, jint name, jint bufSize, jlong lengthAddress, jlong labelAddress) { - glGetObjectLabelPROC glGetObjectLabel = (glGetObjectLabelPROC)tlsGetFunction(882); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t label = (uintptr_t)labelAddress; - UNUSED_PARAM(clazz) - glGetObjectLabel(identifier, name, bufSize, length, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglObjectPtrLabel(JNIEnv *__env, jclass clazz, jlong ptrAddress, jint length, jlong labelAddress) { - glObjectPtrLabelPROC glObjectPtrLabel = (glObjectPtrLabelPROC)tlsGetFunction(883); - uintptr_t ptr = (uintptr_t)ptrAddress; - uintptr_t label = (uintptr_t)labelAddress; - UNUSED_PARAM(clazz) - glObjectPtrLabel(ptr, length, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglGetObjectPtrLabel__JIJJ(JNIEnv *__env, jclass clazz, jlong ptrAddress, jint bufSize, jlong lengthAddress, jlong labelAddress) { - glGetObjectPtrLabelPROC glGetObjectPtrLabel = (glGetObjectPtrLabelPROC)tlsGetFunction(884); - uintptr_t ptr = (uintptr_t)ptrAddress; - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t label = (uintptr_t)labelAddress; - UNUSED_PARAM(clazz) - glGetObjectPtrLabel(ptr, bufSize, length, label); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glFramebufferParameteri(JNIEnv *__env, jclass clazz, jint target, jint pname, jint param) { - glFramebufferParameteriPROC glFramebufferParameteri = (glFramebufferParameteriPROC)tlsGetFunction(885); - UNUSED_PARAM(clazz) - glFramebufferParameteri(target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglGetFramebufferParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetFramebufferParameterivPROC glGetFramebufferParameteriv = (glGetFramebufferParameterivPROC)tlsGetFunction(886); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetFramebufferParameteriv(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglGetInternalformati64v__IIIIJ(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint pname, jint bufSize, jlong paramsAddress) { - glGetInternalformati64vPROC glGetInternalformati64v = (glGetInternalformati64vPROC)tlsGetFunction(887); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetInternalformati64v(target, internalformat, pname, bufSize, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glInvalidateTexSubImage(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth) { - glInvalidateTexSubImagePROC glInvalidateTexSubImage = (glInvalidateTexSubImagePROC)tlsGetFunction(888); - UNUSED_PARAM(clazz) - glInvalidateTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glInvalidateTexImage(JNIEnv *__env, jclass clazz, jint texture, jint level) { - glInvalidateTexImagePROC glInvalidateTexImage = (glInvalidateTexImagePROC)tlsGetFunction(889); - UNUSED_PARAM(clazz) - glInvalidateTexImage(texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glInvalidateBufferSubData(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong length) { - glInvalidateBufferSubDataPROC glInvalidateBufferSubData = (glInvalidateBufferSubDataPROC)tlsGetFunction(890); - UNUSED_PARAM(clazz) - glInvalidateBufferSubData(buffer, (uintptr_t)offset, (uintptr_t)length); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glInvalidateBufferData(JNIEnv *__env, jclass clazz, jint buffer) { - glInvalidateBufferDataPROC glInvalidateBufferData = (glInvalidateBufferDataPROC)tlsGetFunction(891); - UNUSED_PARAM(clazz) - glInvalidateBufferData(buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglInvalidateFramebuffer__IIJ(JNIEnv *__env, jclass clazz, jint target, jint numAttachments, jlong attachmentsAddress) { - glInvalidateFramebufferPROC glInvalidateFramebuffer = (glInvalidateFramebufferPROC)tlsGetFunction(892); - uintptr_t attachments = (uintptr_t)attachmentsAddress; - UNUSED_PARAM(clazz) - glInvalidateFramebuffer(target, numAttachments, attachments); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglInvalidateSubFramebuffer__IIJIIII(JNIEnv *__env, jclass clazz, jint target, jint numAttachments, jlong attachmentsAddress, jint x, jint y, jint width, jint height) { - glInvalidateSubFramebufferPROC glInvalidateSubFramebuffer = (glInvalidateSubFramebufferPROC)tlsGetFunction(893); - uintptr_t attachments = (uintptr_t)attachmentsAddress; - UNUSED_PARAM(clazz) - glInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglMultiDrawArraysIndirect__IJII(JNIEnv *__env, jclass clazz, jint mode, jlong indirectAddress, jint drawcount, jint stride) { - glMultiDrawArraysIndirectPROC glMultiDrawArraysIndirect = (glMultiDrawArraysIndirectPROC)tlsGetFunction(894); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglMultiDrawElementsIndirect__IIJII(JNIEnv *__env, jclass clazz, jint mode, jint type, jlong indirectAddress, jint drawcount, jint stride) { - glMultiDrawElementsIndirectPROC glMultiDrawElementsIndirect = (glMultiDrawElementsIndirectPROC)tlsGetFunction(895); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglGetProgramInterfaceiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint programInterface, jint pname, jlong paramsAddress) { - glGetProgramInterfaceivPROC glGetProgramInterfaceiv = (glGetProgramInterfaceivPROC)tlsGetFunction(896); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramInterfaceiv(program, programInterface, pname, params); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL43C_nglGetProgramResourceIndex(JNIEnv *__env, jclass clazz, jint program, jint programInterface, jlong nameAddress) { - glGetProgramResourceIndexPROC glGetProgramResourceIndex = (glGetProgramResourceIndexPROC)tlsGetFunction(897); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetProgramResourceIndex(program, programInterface, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglGetProgramResourceName__IIIIJJ(JNIEnv *__env, jclass clazz, jint program, jint programInterface, jint index, jint bufSize, jlong lengthAddress, jlong nameAddress) { - glGetProgramResourceNamePROC glGetProgramResourceName = (glGetProgramResourceNamePROC)tlsGetFunction(898); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetProgramResourceName(program, programInterface, index, bufSize, length, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_nglGetProgramResourceiv__IIIIJIJJ(JNIEnv *__env, jclass clazz, jint program, jint programInterface, jint index, jint propCount, jlong propsAddress, jint bufSize, jlong lengthAddress, jlong paramsAddress) { - glGetProgramResourceivPROC glGetProgramResourceiv = (glGetProgramResourceivPROC)tlsGetFunction(899); - uintptr_t props = (uintptr_t)propsAddress; - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL43C_nglGetProgramResourceLocation(JNIEnv *__env, jclass clazz, jint program, jint programInterface, jlong nameAddress) { - glGetProgramResourceLocationPROC glGetProgramResourceLocation = (glGetProgramResourceLocationPROC)tlsGetFunction(900); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetProgramResourceLocation(program, programInterface, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL43C_nglGetProgramResourceLocationIndex(JNIEnv *__env, jclass clazz, jint program, jint programInterface, jlong nameAddress) { - glGetProgramResourceLocationIndexPROC glGetProgramResourceLocationIndex = (glGetProgramResourceLocationIndexPROC)tlsGetFunction(901); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetProgramResourceLocationIndex(program, programInterface, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glShaderStorageBlockBinding(JNIEnv *__env, jclass clazz, jint program, jint storageBlockIndex, jint storageBlockBinding) { - glShaderStorageBlockBindingPROC glShaderStorageBlockBinding = (glShaderStorageBlockBindingPROC)tlsGetFunction(902); - UNUSED_PARAM(clazz) - glShaderStorageBlockBinding(program, storageBlockIndex, storageBlockBinding); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glTexBufferRange(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint buffer, jlong offset, jlong size) { - glTexBufferRangePROC glTexBufferRange = (glTexBufferRangePROC)tlsGetFunction(903); - UNUSED_PARAM(clazz) - glTexBufferRange(target, internalformat, buffer, (uintptr_t)offset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glTexStorage2DMultisample(JNIEnv *__env, jclass clazz, jint target, jint samples, jint internalformat, jint width, jint height, jboolean fixedsamplelocations) { - glTexStorage2DMultisamplePROC glTexStorage2DMultisample = (glTexStorage2DMultisamplePROC)tlsGetFunction(904); - UNUSED_PARAM(clazz) - glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glTexStorage3DMultisample(JNIEnv *__env, jclass clazz, jint target, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) { - glTexStorage3DMultisamplePROC glTexStorage3DMultisample = (glTexStorage3DMultisamplePROC)tlsGetFunction(905); - UNUSED_PARAM(clazz) - glTexStorage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glTextureView(JNIEnv *__env, jclass clazz, jint texture, jint target, jint origtexture, jint internalformat, jint minlevel, jint numlevels, jint minlayer, jint numlayers) { - glTextureViewPROC glTextureView = (glTextureViewPROC)tlsGetFunction(906); - UNUSED_PARAM(clazz) - glTextureView(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glBindVertexBuffer(JNIEnv *__env, jclass clazz, jint bindingindex, jint buffer, jlong offset, jint stride) { - glBindVertexBufferPROC glBindVertexBuffer = (glBindVertexBufferPROC)tlsGetFunction(907); - UNUSED_PARAM(clazz) - glBindVertexBuffer(bindingindex, buffer, (uintptr_t)offset, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glVertexAttribFormat(JNIEnv *__env, jclass clazz, jint attribindex, jint size, jint type, jboolean normalized, jint relativeoffset) { - glVertexAttribFormatPROC glVertexAttribFormat = (glVertexAttribFormatPROC)tlsGetFunction(908); - UNUSED_PARAM(clazz) - glVertexAttribFormat(attribindex, size, type, normalized, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glVertexAttribIFormat(JNIEnv *__env, jclass clazz, jint attribindex, jint size, jint type, jint relativeoffset) { - glVertexAttribIFormatPROC glVertexAttribIFormat = (glVertexAttribIFormatPROC)tlsGetFunction(909); - UNUSED_PARAM(clazz) - glVertexAttribIFormat(attribindex, size, type, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glVertexAttribLFormat(JNIEnv *__env, jclass clazz, jint attribindex, jint size, jint type, jint relativeoffset) { - glVertexAttribLFormatPROC glVertexAttribLFormat = (glVertexAttribLFormatPROC)tlsGetFunction(910); - UNUSED_PARAM(clazz) - glVertexAttribLFormat(attribindex, size, type, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glVertexAttribBinding(JNIEnv *__env, jclass clazz, jint attribindex, jint bindingindex) { - glVertexAttribBindingPROC glVertexAttribBinding = (glVertexAttribBindingPROC)tlsGetFunction(911); - UNUSED_PARAM(clazz) - glVertexAttribBinding(attribindex, bindingindex); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL43C_glVertexBindingDivisor(JNIEnv *__env, jclass clazz, jint bindingindex, jint divisor) { - glVertexBindingDivisorPROC glVertexBindingDivisor = (glVertexBindingDivisorPROC)tlsGetFunction(912); - UNUSED_PARAM(clazz) - glVertexBindingDivisor(bindingindex, divisor); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL44C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL44C.c deleted file mode 100644 index c94f20a1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL44C.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBufferStoragePROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glClearTexSubImagePROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glClearTexImagePROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glBindBuffersBasePROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glBindBuffersRangePROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glBindTexturesPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glBindSamplersPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glBindImageTexturesPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glBindVertexBuffersPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglBufferStorage__IJJI(JNIEnv *__env, jclass clazz, jint target, jlong size, jlong dataAddress, jint flags) { - glBufferStoragePROC glBufferStorage = (glBufferStoragePROC)tlsGetFunction(913); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glBufferStorage(target, (uintptr_t)size, data, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglClearTexSubImage__IIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jlong dataAddress) { - glClearTexSubImagePROC glClearTexSubImage = (glClearTexSubImagePROC)tlsGetFunction(914); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglClearTexImage__IIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint format, jint type, jlong dataAddress) { - glClearTexImagePROC glClearTexImage = (glClearTexImagePROC)tlsGetFunction(915); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glClearTexImage(texture, level, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglBindBuffersBase__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint first, jint count, jlong buffersAddress) { - glBindBuffersBasePROC glBindBuffersBase = (glBindBuffersBasePROC)tlsGetFunction(916); - uintptr_t buffers = (uintptr_t)buffersAddress; - UNUSED_PARAM(clazz) - glBindBuffersBase(target, first, count, buffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglBindBuffersRange__IIIJJJ(JNIEnv *__env, jclass clazz, jint target, jint first, jint count, jlong buffersAddress, jlong offsetsAddress, jlong sizesAddress) { - glBindBuffersRangePROC glBindBuffersRange = (glBindBuffersRangePROC)tlsGetFunction(917); - uintptr_t buffers = (uintptr_t)buffersAddress; - uintptr_t offsets = (uintptr_t)offsetsAddress; - uintptr_t sizes = (uintptr_t)sizesAddress; - UNUSED_PARAM(clazz) - glBindBuffersRange(target, first, count, buffers, offsets, sizes); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglBindTextures__IIJ(JNIEnv *__env, jclass clazz, jint first, jint count, jlong texturesAddress) { - glBindTexturesPROC glBindTextures = (glBindTexturesPROC)tlsGetFunction(918); - uintptr_t textures = (uintptr_t)texturesAddress; - UNUSED_PARAM(clazz) - glBindTextures(first, count, textures); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglBindSamplers__IIJ(JNIEnv *__env, jclass clazz, jint first, jint count, jlong samplersAddress) { - glBindSamplersPROC glBindSamplers = (glBindSamplersPROC)tlsGetFunction(919); - uintptr_t samplers = (uintptr_t)samplersAddress; - UNUSED_PARAM(clazz) - glBindSamplers(first, count, samplers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglBindImageTextures__IIJ(JNIEnv *__env, jclass clazz, jint first, jint count, jlong texturesAddress) { - glBindImageTexturesPROC glBindImageTextures = (glBindImageTexturesPROC)tlsGetFunction(920); - uintptr_t textures = (uintptr_t)texturesAddress; - UNUSED_PARAM(clazz) - glBindImageTextures(first, count, textures); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL44C_nglBindVertexBuffers__IIJJJ(JNIEnv *__env, jclass clazz, jint first, jint count, jlong buffersAddress, jlong offsetsAddress, jlong stridesAddress) { - glBindVertexBuffersPROC glBindVertexBuffers = (glBindVertexBuffersPROC)tlsGetFunction(921); - uintptr_t buffers = (uintptr_t)buffersAddress; - uintptr_t offsets = (uintptr_t)offsetsAddress; - uintptr_t strides = (uintptr_t)stridesAddress; - UNUSED_PARAM(clazz) - glBindVertexBuffers(first, count, buffers, offsets, strides); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL45.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL45.c deleted file mode 100644 index 02d1c6ca..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL45.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetnMapdvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnMapfvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnMapivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnPixelMapfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnPixelMapuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnPixelMapusvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnPolygonStipplePROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetnColorTablePROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnConvolutionFilterPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnSeparableFilterPROC) (jint, jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetnHistogramPROC) (jint, jboolean, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnMinmaxPROC) (jint, jboolean, jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnMapdv__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jint bufSize, jlong dataAddress) { - glGetnMapdvPROC glGetnMapdv = (glGetnMapdvPROC)tlsGetFunction(1025); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnMapdv(target, query, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnMapfv__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jint bufSize, jlong dataAddress) { - glGetnMapfvPROC glGetnMapfv = (glGetnMapfvPROC)tlsGetFunction(1026); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnMapfv(target, query, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnMapiv__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint query, jint bufSize, jlong dataAddress) { - glGetnMapivPROC glGetnMapiv = (glGetnMapivPROC)tlsGetFunction(1027); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnMapiv(target, query, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnPixelMapfv__IIJ(JNIEnv *__env, jclass clazz, jint map, jint bufSize, jlong dataAddress) { - glGetnPixelMapfvPROC glGetnPixelMapfv = (glGetnPixelMapfvPROC)tlsGetFunction(1028); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnPixelMapfv(map, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnPixelMapuiv__IIJ(JNIEnv *__env, jclass clazz, jint map, jint bufSize, jlong dataAddress) { - glGetnPixelMapuivPROC glGetnPixelMapuiv = (glGetnPixelMapuivPROC)tlsGetFunction(1029); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnPixelMapuiv(map, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnPixelMapusv__IIJ(JNIEnv *__env, jclass clazz, jint map, jint bufSize, jlong dataAddress) { - glGetnPixelMapusvPROC glGetnPixelMapusv = (glGetnPixelMapusvPROC)tlsGetFunction(1030); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetnPixelMapusv(map, bufSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnPolygonStipple(JNIEnv *__env, jclass clazz, jint bufSize, jlong patternAddress) { - glGetnPolygonStipplePROC glGetnPolygonStipple = (glGetnPolygonStipplePROC)tlsGetFunction(1031); - uintptr_t pattern = (uintptr_t)patternAddress; - UNUSED_PARAM(clazz) - glGetnPolygonStipple(bufSize, pattern); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnColorTable__IIIIJ(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jint bufSize, jlong tableAddress) { - glGetnColorTablePROC glGetnColorTable = (glGetnColorTablePROC)tlsGetFunction(1034); - uintptr_t table = (uintptr_t)tableAddress; - UNUSED_PARAM(clazz) - glGetnColorTable(target, format, type, bufSize, table); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnConvolutionFilter(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jint bufSize, jlong imageAddress) { - glGetnConvolutionFilterPROC glGetnConvolutionFilter = (glGetnConvolutionFilterPROC)tlsGetFunction(1035); - uintptr_t image = (uintptr_t)imageAddress; - UNUSED_PARAM(clazz) - glGetnConvolutionFilter(target, format, type, bufSize, image); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnSeparableFilter(JNIEnv *__env, jclass clazz, jint target, jint format, jint type, jint rowBufSize, jlong rowAddress, jint columnBufSize, jlong columnAddress, jlong spanAddress) { - glGetnSeparableFilterPROC glGetnSeparableFilter = (glGetnSeparableFilterPROC)tlsGetFunction(1036); - uintptr_t row = (uintptr_t)rowAddress; - uintptr_t column = (uintptr_t)columnAddress; - uintptr_t span = (uintptr_t)spanAddress; - UNUSED_PARAM(clazz) - glGetnSeparableFilter(target, format, type, rowBufSize, row, columnBufSize, column, span); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnHistogram(JNIEnv *__env, jclass clazz, jint target, jboolean reset, jint format, jint type, jint bufSize, jlong valuesAddress) { - glGetnHistogramPROC glGetnHistogram = (glGetnHistogramPROC)tlsGetFunction(1037); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetnHistogram(target, reset, format, type, bufSize, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45_nglGetnMinmax(JNIEnv *__env, jclass clazz, jint target, jboolean reset, jint format, jint type, jint bufSize, jlong valuesAddress) { - glGetnMinmaxPROC glGetnMinmax = (glGetnMinmaxPROC)tlsGetFunction(1038); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glGetnMinmax(target, reset, format, type, bufSize, values); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL45C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL45C.c deleted file mode 100644 index 2cfe92f4..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL45C.c +++ /dev/null @@ -1,845 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glClipControlPROC) (jint, jint); -typedef void (APIENTRY *glCreateTransformFeedbacksPROC) (jint, uintptr_t); -typedef void (APIENTRY *glTransformFeedbackBufferBasePROC) (jint, jint, jint); -typedef void (APIENTRY *glTransformFeedbackBufferRangePROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetTransformFeedbackivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTransformFeedbacki_vPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTransformFeedbacki64_vPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCreateBuffersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glNamedBufferStoragePROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glNamedBufferDataPROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glNamedBufferSubDataPROC) (jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glCopyNamedBufferSubDataPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glClearNamedBufferDataPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glClearNamedBufferSubDataPROC) (jint, jint, uintptr_t, uintptr_t, jint, jint, uintptr_t); -typedef uintptr_t (APIENTRY *glMapNamedBufferPROC) (jint, jint); -typedef uintptr_t (APIENTRY *glMapNamedBufferRangePROC) (jint, uintptr_t, uintptr_t, jint); -typedef jboolean (APIENTRY *glUnmapNamedBufferPROC) (jint); -typedef void (APIENTRY *glFlushMappedNamedBufferRangePROC) (jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetNamedBufferParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedBufferParameteri64vPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedBufferPointervPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedBufferSubDataPROC) (jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glCreateFramebuffersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glNamedFramebufferRenderbufferPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferParameteriPROC) (jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferTexturePROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferTextureLayerPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferDrawBufferPROC) (jint, jint); -typedef void (APIENTRY *glNamedFramebufferDrawBuffersPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedFramebufferReadBufferPROC) (jint, jint); -typedef void (APIENTRY *glInvalidateNamedFramebufferDataPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glInvalidateNamedFramebufferSubDataPROC) (jint, jint, uintptr_t, jint, jint, jint, jint); -typedef void (APIENTRY *glClearNamedFramebufferivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glClearNamedFramebufferuivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glClearNamedFramebufferfvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glClearNamedFramebufferfiPROC) (jint, jint, jint, jfloat, jint); -typedef void (APIENTRY *glBlitNamedFramebufferPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef jint (APIENTRY *glCheckNamedFramebufferStatusPROC) (jint, jint); -typedef void (APIENTRY *glGetNamedFramebufferParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedFramebufferAttachmentParameterivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCreateRenderbuffersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glNamedRenderbufferStoragePROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glNamedRenderbufferStorageMultisamplePROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glGetNamedRenderbufferParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glCreateTexturesPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureBufferPROC) (jint, jint, jint); -typedef void (APIENTRY *glTextureBufferRangePROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glTextureStorage1DPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorage2DPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorage3DPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureStorage2DMultisamplePROC) (jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTextureStorage3DMultisamplePROC) (jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTextureSubImage1DPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureSubImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureSubImage3DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureSubImage1DPROC) (jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureSubImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCompressedTextureSubImage3DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCopyTextureSubImage1DPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyTextureSubImage2DPROC) (jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glCopyTextureSubImage3DPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glTextureParameterfPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glTextureParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureParameteriPROC) (jint, jint, jint); -typedef void (APIENTRY *glTextureParameterIivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureParameterIuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGenerateTextureMipmapPROC) (jint); -typedef void (APIENTRY *glBindTextureUnitPROC) (jint, jint); -typedef void (APIENTRY *glGetTextureImagePROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetCompressedTextureImagePROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureLevelParameterfvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureLevelParameterivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureParameterfvPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureParameterIivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureParameterIuivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetTextureParameterivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glCreateVertexArraysPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDisableVertexArrayAttribPROC) (jint, jint); -typedef void (APIENTRY *glEnableVertexArrayAttribPROC) (jint, jint); -typedef void (APIENTRY *glVertexArrayElementBufferPROC) (jint, jint); -typedef void (APIENTRY *glVertexArrayVertexBufferPROC) (jint, jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glVertexArrayVertexBuffersPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glVertexArrayAttribFormatPROC) (jint, jint, jint, jint, jboolean, jint); -typedef void (APIENTRY *glVertexArrayAttribIFormatPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glVertexArrayAttribLFormatPROC) (jint, jint, jint, jint, jint); -typedef void (APIENTRY *glVertexArrayAttribBindingPROC) (jint, jint, jint); -typedef void (APIENTRY *glVertexArrayBindingDivisorPROC) (jint, jint, jint); -typedef void (APIENTRY *glGetVertexArrayivPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexArrayIndexedivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexArrayIndexed64ivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCreateSamplersPROC) (jint, uintptr_t); -typedef void (APIENTRY *glCreateProgramPipelinesPROC) (jint, uintptr_t); -typedef void (APIENTRY *glCreateQueriesPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryBufferObjectivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryBufferObjectuivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryBufferObjecti64vPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetQueryBufferObjectui64vPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMemoryBarrierByRegionPROC) (jint); -typedef void (APIENTRY *glGetTextureSubImagePROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetCompressedTextureSubImagePROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glTextureBarrierPROC) (void); -typedef jint (APIENTRY *glGetGraphicsResetStatusPROC) (void); -typedef void (APIENTRY *glGetnTexImagePROC) (jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glReadnPixelsPROC) (jint, jint, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnCompressedTexImagePROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformfvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformdvPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformivPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetnUniformuivPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glClipControl(JNIEnv *__env, jclass clazz, jint origin, jint depth) { - glClipControlPROC glClipControl = (glClipControlPROC)tlsGetFunction(922); - UNUSED_PARAM(clazz) - glClipControl(origin, depth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateTransformFeedbacks__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glCreateTransformFeedbacksPROC glCreateTransformFeedbacks = (glCreateTransformFeedbacksPROC)tlsGetFunction(923); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glCreateTransformFeedbacks(n, ids); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTransformFeedbackBufferBase(JNIEnv *__env, jclass clazz, jint xfb, jint index, jint buffer) { - glTransformFeedbackBufferBasePROC glTransformFeedbackBufferBase = (glTransformFeedbackBufferBasePROC)tlsGetFunction(924); - UNUSED_PARAM(clazz) - glTransformFeedbackBufferBase(xfb, index, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTransformFeedbackBufferRange(JNIEnv *__env, jclass clazz, jint xfb, jint index, jint buffer, jlong offset, jlong size) { - glTransformFeedbackBufferRangePROC glTransformFeedbackBufferRange = (glTransformFeedbackBufferRangePROC)tlsGetFunction(925); - UNUSED_PARAM(clazz) - glTransformFeedbackBufferRange(xfb, index, buffer, (uintptr_t)offset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTransformFeedbackiv__IIJ(JNIEnv *__env, jclass clazz, jint xfb, jint pname, jlong paramAddress) { - glGetTransformFeedbackivPROC glGetTransformFeedbackiv = (glGetTransformFeedbackivPROC)tlsGetFunction(926); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetTransformFeedbackiv(xfb, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTransformFeedbacki_1v__IIIJ(JNIEnv *__env, jclass clazz, jint xfb, jint pname, jint index, jlong paramAddress) { - glGetTransformFeedbacki_vPROC glGetTransformFeedbacki_v = (glGetTransformFeedbacki_vPROC)tlsGetFunction(927); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetTransformFeedbacki_v(xfb, pname, index, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTransformFeedbacki64_1v__IIIJ(JNIEnv *__env, jclass clazz, jint xfb, jint pname, jint index, jlong paramAddress) { - glGetTransformFeedbacki64_vPROC glGetTransformFeedbacki64_v = (glGetTransformFeedbacki64_vPROC)tlsGetFunction(928); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetTransformFeedbacki64_v(xfb, pname, index, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateBuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong buffersAddress) { - glCreateBuffersPROC glCreateBuffers = (glCreateBuffersPROC)tlsGetFunction(929); - uintptr_t buffers = (uintptr_t)buffersAddress; - UNUSED_PARAM(clazz) - glCreateBuffers(n, buffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglNamedBufferStorage__IJJI(JNIEnv *__env, jclass clazz, jint buffer, jlong size, jlong dataAddress, jint flags) { - glNamedBufferStoragePROC glNamedBufferStorage = (glNamedBufferStoragePROC)tlsGetFunction(930); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glNamedBufferStorage(buffer, (uintptr_t)size, data, flags); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglNamedBufferData__IJJI(JNIEnv *__env, jclass clazz, jint buffer, jlong size, jlong dataAddress, jint usage) { - glNamedBufferDataPROC glNamedBufferData = (glNamedBufferDataPROC)tlsGetFunction(931); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glNamedBufferData(buffer, (uintptr_t)size, data, usage); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglNamedBufferSubData__IJJJ(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong size, jlong dataAddress) { - glNamedBufferSubDataPROC glNamedBufferSubData = (glNamedBufferSubDataPROC)tlsGetFunction(932); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glNamedBufferSubData(buffer, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glCopyNamedBufferSubData(JNIEnv *__env, jclass clazz, jint readBuffer, jint writeBuffer, jlong readOffset, jlong writeOffset, jlong size) { - glCopyNamedBufferSubDataPROC glCopyNamedBufferSubData = (glCopyNamedBufferSubDataPROC)tlsGetFunction(933); - UNUSED_PARAM(clazz) - glCopyNamedBufferSubData(readBuffer, writeBuffer, (uintptr_t)readOffset, (uintptr_t)writeOffset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglClearNamedBufferData__IIIIJ(JNIEnv *__env, jclass clazz, jint buffer, jint internalformat, jint format, jint type, jlong dataAddress) { - glClearNamedBufferDataPROC glClearNamedBufferData = (glClearNamedBufferDataPROC)tlsGetFunction(934); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glClearNamedBufferData(buffer, internalformat, format, type, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglClearNamedBufferSubData__IIJJIIJ(JNIEnv *__env, jclass clazz, jint buffer, jint internalformat, jlong offset, jlong size, jint format, jint type, jlong dataAddress) { - glClearNamedBufferSubDataPROC glClearNamedBufferSubData = (glClearNamedBufferSubDataPROC)tlsGetFunction(935); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glClearNamedBufferSubData(buffer, internalformat, (uintptr_t)offset, (uintptr_t)size, format, type, data); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GL45C_nglMapNamedBuffer(JNIEnv *__env, jclass clazz, jint buffer, jint access) { - glMapNamedBufferPROC glMapNamedBuffer = (glMapNamedBufferPROC)tlsGetFunction(936); - UNUSED_PARAM(clazz) - return (jlong)glMapNamedBuffer(buffer, access); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_GL45C_nglMapNamedBufferRange(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong length, jint access) { - glMapNamedBufferRangePROC glMapNamedBufferRange = (glMapNamedBufferRangePROC)tlsGetFunction(937); - UNUSED_PARAM(clazz) - return (jlong)glMapNamedBufferRange(buffer, (uintptr_t)offset, (uintptr_t)length, access); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_GL45C_glUnmapNamedBuffer(JNIEnv *__env, jclass clazz, jint buffer) { - glUnmapNamedBufferPROC glUnmapNamedBuffer = (glUnmapNamedBufferPROC)tlsGetFunction(938); - UNUSED_PARAM(clazz) - return glUnmapNamedBuffer(buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glFlushMappedNamedBufferRange(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong length) { - glFlushMappedNamedBufferRangePROC glFlushMappedNamedBufferRange = (glFlushMappedNamedBufferRangePROC)tlsGetFunction(939); - UNUSED_PARAM(clazz) - glFlushMappedNamedBufferRange(buffer, (uintptr_t)offset, (uintptr_t)length); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetNamedBufferParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint buffer, jint pname, jlong paramsAddress) { - glGetNamedBufferParameterivPROC glGetNamedBufferParameteriv = (glGetNamedBufferParameterivPROC)tlsGetFunction(940); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedBufferParameteriv(buffer, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetNamedBufferParameteri64v__IIJ(JNIEnv *__env, jclass clazz, jint buffer, jint pname, jlong paramsAddress) { - glGetNamedBufferParameteri64vPROC glGetNamedBufferParameteri64v = (glGetNamedBufferParameteri64vPROC)tlsGetFunction(941); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedBufferParameteri64v(buffer, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetNamedBufferPointerv(JNIEnv *__env, jclass clazz, jint buffer, jint pname, jlong paramsAddress) { - glGetNamedBufferPointervPROC glGetNamedBufferPointerv = (glGetNamedBufferPointervPROC)tlsGetFunction(942); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedBufferPointerv(buffer, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetNamedBufferSubData__IJJJ(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong size, jlong dataAddress) { - glGetNamedBufferSubDataPROC glGetNamedBufferSubData = (glGetNamedBufferSubDataPROC)tlsGetFunction(943); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glGetNamedBufferSubData(buffer, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateFramebuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong framebuffersAddress) { - glCreateFramebuffersPROC glCreateFramebuffers = (glCreateFramebuffersPROC)tlsGetFunction(944); - uintptr_t framebuffers = (uintptr_t)framebuffersAddress; - UNUSED_PARAM(clazz) - glCreateFramebuffers(n, framebuffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glNamedFramebufferRenderbuffer(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint renderbuffertarget, jint renderbuffer) { - glNamedFramebufferRenderbufferPROC glNamedFramebufferRenderbuffer = (glNamedFramebufferRenderbufferPROC)tlsGetFunction(945); - UNUSED_PARAM(clazz) - glNamedFramebufferRenderbuffer(framebuffer, attachment, renderbuffertarget, renderbuffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glNamedFramebufferParameteri(JNIEnv *__env, jclass clazz, jint framebuffer, jint pname, jint param) { - glNamedFramebufferParameteriPROC glNamedFramebufferParameteri = (glNamedFramebufferParameteriPROC)tlsGetFunction(946); - UNUSED_PARAM(clazz) - glNamedFramebufferParameteri(framebuffer, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glNamedFramebufferTexture(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint texture, jint level) { - glNamedFramebufferTexturePROC glNamedFramebufferTexture = (glNamedFramebufferTexturePROC)tlsGetFunction(947); - UNUSED_PARAM(clazz) - glNamedFramebufferTexture(framebuffer, attachment, texture, level); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glNamedFramebufferTextureLayer(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint texture, jint level, jint layer) { - glNamedFramebufferTextureLayerPROC glNamedFramebufferTextureLayer = (glNamedFramebufferTextureLayerPROC)tlsGetFunction(948); - UNUSED_PARAM(clazz) - glNamedFramebufferTextureLayer(framebuffer, attachment, texture, level, layer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glNamedFramebufferDrawBuffer(JNIEnv *__env, jclass clazz, jint framebuffer, jint buf) { - glNamedFramebufferDrawBufferPROC glNamedFramebufferDrawBuffer = (glNamedFramebufferDrawBufferPROC)tlsGetFunction(949); - UNUSED_PARAM(clazz) - glNamedFramebufferDrawBuffer(framebuffer, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglNamedFramebufferDrawBuffers__IIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint n, jlong bufsAddress) { - glNamedFramebufferDrawBuffersPROC glNamedFramebufferDrawBuffers = (glNamedFramebufferDrawBuffersPROC)tlsGetFunction(950); - uintptr_t bufs = (uintptr_t)bufsAddress; - UNUSED_PARAM(clazz) - glNamedFramebufferDrawBuffers(framebuffer, n, bufs); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glNamedFramebufferReadBuffer(JNIEnv *__env, jclass clazz, jint framebuffer, jint src) { - glNamedFramebufferReadBufferPROC glNamedFramebufferReadBuffer = (glNamedFramebufferReadBufferPROC)tlsGetFunction(951); - UNUSED_PARAM(clazz) - glNamedFramebufferReadBuffer(framebuffer, src); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglInvalidateNamedFramebufferData__IIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint numAttachments, jlong attachmentsAddress) { - glInvalidateNamedFramebufferDataPROC glInvalidateNamedFramebufferData = (glInvalidateNamedFramebufferDataPROC)tlsGetFunction(952); - uintptr_t attachments = (uintptr_t)attachmentsAddress; - UNUSED_PARAM(clazz) - glInvalidateNamedFramebufferData(framebuffer, numAttachments, attachments); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglInvalidateNamedFramebufferSubData__IIJIIII(JNIEnv *__env, jclass clazz, jint framebuffer, jint numAttachments, jlong attachmentsAddress, jint x, jint y, jint width, jint height) { - glInvalidateNamedFramebufferSubDataPROC glInvalidateNamedFramebufferSubData = (glInvalidateNamedFramebufferSubDataPROC)tlsGetFunction(953); - uintptr_t attachments = (uintptr_t)attachmentsAddress; - UNUSED_PARAM(clazz) - glInvalidateNamedFramebufferSubData(framebuffer, numAttachments, attachments, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglClearNamedFramebufferiv__IIIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint buffer, jint drawbuffer, jlong valueAddress) { - glClearNamedFramebufferivPROC glClearNamedFramebufferiv = (glClearNamedFramebufferivPROC)tlsGetFunction(954); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glClearNamedFramebufferiv(framebuffer, buffer, drawbuffer, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglClearNamedFramebufferuiv__IIIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint buffer, jint drawbuffer, jlong valueAddress) { - glClearNamedFramebufferuivPROC glClearNamedFramebufferuiv = (glClearNamedFramebufferuivPROC)tlsGetFunction(955); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glClearNamedFramebufferuiv(framebuffer, buffer, drawbuffer, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglClearNamedFramebufferfv__IIIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint buffer, jint drawbuffer, jlong valueAddress) { - glClearNamedFramebufferfvPROC glClearNamedFramebufferfv = (glClearNamedFramebufferfvPROC)tlsGetFunction(956); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glClearNamedFramebufferfv(framebuffer, buffer, drawbuffer, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glClearNamedFramebufferfi(JNIEnv *__env, jclass clazz, jint framebuffer, jint buffer, jint drawbuffer, jfloat depth, jint stencil) { - glClearNamedFramebufferfiPROC glClearNamedFramebufferfi = (glClearNamedFramebufferfiPROC)tlsGetFunction(957); - UNUSED_PARAM(clazz) - glClearNamedFramebufferfi(framebuffer, buffer, drawbuffer, depth, stencil); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glBlitNamedFramebuffer(JNIEnv *__env, jclass clazz, jint readFramebuffer, jint drawFramebuffer, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) { - glBlitNamedFramebufferPROC glBlitNamedFramebuffer = (glBlitNamedFramebufferPROC)tlsGetFunction(958); - UNUSED_PARAM(clazz) - glBlitNamedFramebuffer(readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL45C_glCheckNamedFramebufferStatus(JNIEnv *__env, jclass clazz, jint framebuffer, jint target) { - glCheckNamedFramebufferStatusPROC glCheckNamedFramebufferStatus = (glCheckNamedFramebufferStatusPROC)tlsGetFunction(959); - UNUSED_PARAM(clazz) - return glCheckNamedFramebufferStatus(framebuffer, target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetNamedFramebufferParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint pname, jlong paramsAddress) { - glGetNamedFramebufferParameterivPROC glGetNamedFramebufferParameteriv = (glGetNamedFramebufferParameterivPROC)tlsGetFunction(960); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedFramebufferParameteriv(framebuffer, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetNamedFramebufferAttachmentParameteriv__IIIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint pname, jlong paramsAddress) { - glGetNamedFramebufferAttachmentParameterivPROC glGetNamedFramebufferAttachmentParameteriv = (glGetNamedFramebufferAttachmentParameterivPROC)tlsGetFunction(961); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateRenderbuffers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong renderbuffersAddress) { - glCreateRenderbuffersPROC glCreateRenderbuffers = (glCreateRenderbuffersPROC)tlsGetFunction(962); - uintptr_t renderbuffers = (uintptr_t)renderbuffersAddress; - UNUSED_PARAM(clazz) - glCreateRenderbuffers(n, renderbuffers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glNamedRenderbufferStorage(JNIEnv *__env, jclass clazz, jint renderbuffer, jint internalformat, jint width, jint height) { - glNamedRenderbufferStoragePROC glNamedRenderbufferStorage = (glNamedRenderbufferStoragePROC)tlsGetFunction(963); - UNUSED_PARAM(clazz) - glNamedRenderbufferStorage(renderbuffer, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glNamedRenderbufferStorageMultisample(JNIEnv *__env, jclass clazz, jint renderbuffer, jint samples, jint internalformat, jint width, jint height) { - glNamedRenderbufferStorageMultisamplePROC glNamedRenderbufferStorageMultisample = (glNamedRenderbufferStorageMultisamplePROC)tlsGetFunction(964); - UNUSED_PARAM(clazz) - glNamedRenderbufferStorageMultisample(renderbuffer, samples, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetNamedRenderbufferParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint renderbuffer, jint pname, jlong paramsAddress) { - glGetNamedRenderbufferParameterivPROC glGetNamedRenderbufferParameteriv = (glGetNamedRenderbufferParameterivPROC)tlsGetFunction(965); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedRenderbufferParameteriv(renderbuffer, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateTextures__IIJ(JNIEnv *__env, jclass clazz, jint target, jint n, jlong texturesAddress) { - glCreateTexturesPROC glCreateTextures = (glCreateTexturesPROC)tlsGetFunction(966); - uintptr_t textures = (uintptr_t)texturesAddress; - UNUSED_PARAM(clazz) - glCreateTextures(target, n, textures); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureBuffer(JNIEnv *__env, jclass clazz, jint texture, jint internalformat, jint buffer) { - glTextureBufferPROC glTextureBuffer = (glTextureBufferPROC)tlsGetFunction(967); - UNUSED_PARAM(clazz) - glTextureBuffer(texture, internalformat, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureBufferRange(JNIEnv *__env, jclass clazz, jint texture, jint internalformat, jint buffer, jlong offset, jlong size) { - glTextureBufferRangePROC glTextureBufferRange = (glTextureBufferRangePROC)tlsGetFunction(968); - UNUSED_PARAM(clazz) - glTextureBufferRange(texture, internalformat, buffer, (uintptr_t)offset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureStorage1D(JNIEnv *__env, jclass clazz, jint texture, jint levels, jint internalformat, jint width) { - glTextureStorage1DPROC glTextureStorage1D = (glTextureStorage1DPROC)tlsGetFunction(969); - UNUSED_PARAM(clazz) - glTextureStorage1D(texture, levels, internalformat, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureStorage2D(JNIEnv *__env, jclass clazz, jint texture, jint levels, jint internalformat, jint width, jint height) { - glTextureStorage2DPROC glTextureStorage2D = (glTextureStorage2DPROC)tlsGetFunction(970); - UNUSED_PARAM(clazz) - glTextureStorage2D(texture, levels, internalformat, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureStorage3D(JNIEnv *__env, jclass clazz, jint texture, jint levels, jint internalformat, jint width, jint height, jint depth) { - glTextureStorage3DPROC glTextureStorage3D = (glTextureStorage3DPROC)tlsGetFunction(971); - UNUSED_PARAM(clazz) - glTextureStorage3D(texture, levels, internalformat, width, height, depth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureStorage2DMultisample(JNIEnv *__env, jclass clazz, jint texture, jint samples, jint internalformat, jint width, jint height, jboolean fixedsamplelocations) { - glTextureStorage2DMultisamplePROC glTextureStorage2DMultisample = (glTextureStorage2DMultisamplePROC)tlsGetFunction(972); - UNUSED_PARAM(clazz) - glTextureStorage2DMultisample(texture, samples, internalformat, width, height, fixedsamplelocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureStorage3DMultisample(JNIEnv *__env, jclass clazz, jint texture, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) { - glTextureStorage3DMultisamplePROC glTextureStorage3DMultisample = (glTextureStorage3DMultisamplePROC)tlsGetFunction(973); - UNUSED_PARAM(clazz) - glTextureStorage3DMultisample(texture, samples, internalformat, width, height, depth, fixedsamplelocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglTextureSubImage1D__IIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint width, jint format, jint type, jlong pixelsAddress) { - glTextureSubImage1DPROC glTextureSubImage1D = (glTextureSubImage1DPROC)tlsGetFunction(974); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglTextureSubImage2D__IIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jlong pixelsAddress) { - glTextureSubImage2DPROC glTextureSubImage2D = (glTextureSubImage2DPROC)tlsGetFunction(975); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglTextureSubImage3D__IIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jlong pixelsAddress) { - glTextureSubImage3DPROC glTextureSubImage3D = (glTextureSubImage3DPROC)tlsGetFunction(976); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCompressedTextureSubImage1D(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint width, jint format, jint imageSize, jlong dataAddress) { - glCompressedTextureSubImage1DPROC glCompressedTextureSubImage1D = (glCompressedTextureSubImage1DPROC)tlsGetFunction(977); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureSubImage1D(texture, level, xoffset, width, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCompressedTextureSubImage2D(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jlong dataAddress) { - glCompressedTextureSubImage2DPROC glCompressedTextureSubImage2D = (glCompressedTextureSubImage2DPROC)tlsGetFunction(978); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCompressedTextureSubImage3D(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jlong dataAddress) { - glCompressedTextureSubImage3DPROC glCompressedTextureSubImage3D = (glCompressedTextureSubImage3DPROC)tlsGetFunction(979); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glCopyTextureSubImage1D(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint x, jint y, jint width) { - glCopyTextureSubImage1DPROC glCopyTextureSubImage1D = (glCopyTextureSubImage1DPROC)tlsGetFunction(980); - UNUSED_PARAM(clazz) - glCopyTextureSubImage1D(texture, level, xoffset, x, y, width); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glCopyTextureSubImage2D(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { - glCopyTextureSubImage2DPROC glCopyTextureSubImage2D = (glCopyTextureSubImage2DPROC)tlsGetFunction(981); - UNUSED_PARAM(clazz) - glCopyTextureSubImage2D(texture, level, xoffset, yoffset, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glCopyTextureSubImage3D(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) { - glCopyTextureSubImage3DPROC glCopyTextureSubImage3D = (glCopyTextureSubImage3DPROC)tlsGetFunction(982); - UNUSED_PARAM(clazz) - glCopyTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, x, y, width, height); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureParameterf(JNIEnv *__env, jclass clazz, jint texture, jint pname, jfloat param) { - glTextureParameterfPROC glTextureParameterf = (glTextureParameterfPROC)tlsGetFunction(983); - UNUSED_PARAM(clazz) - glTextureParameterf(texture, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglTextureParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint pname, jlong paramsAddress) { - glTextureParameterfvPROC glTextureParameterfv = (glTextureParameterfvPROC)tlsGetFunction(984); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTextureParameterfv(texture, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureParameteri(JNIEnv *__env, jclass clazz, jint texture, jint pname, jint param) { - glTextureParameteriPROC glTextureParameteri = (glTextureParameteriPROC)tlsGetFunction(985); - UNUSED_PARAM(clazz) - glTextureParameteri(texture, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglTextureParameterIiv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint pname, jlong paramsAddress) { - glTextureParameterIivPROC glTextureParameterIiv = (glTextureParameterIivPROC)tlsGetFunction(986); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTextureParameterIiv(texture, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglTextureParameterIuiv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint pname, jlong paramsAddress) { - glTextureParameterIuivPROC glTextureParameterIuiv = (glTextureParameterIuivPROC)tlsGetFunction(987); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTextureParameterIuiv(texture, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglTextureParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint pname, jlong paramsAddress) { - glTextureParameterivPROC glTextureParameteriv = (glTextureParameterivPROC)tlsGetFunction(988); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glTextureParameteriv(texture, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glGenerateTextureMipmap(JNIEnv *__env, jclass clazz, jint texture) { - glGenerateTextureMipmapPROC glGenerateTextureMipmap = (glGenerateTextureMipmapPROC)tlsGetFunction(989); - UNUSED_PARAM(clazz) - glGenerateTextureMipmap(texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glBindTextureUnit(JNIEnv *__env, jclass clazz, jint unit, jint texture) { - glBindTextureUnitPROC glBindTextureUnit = (glBindTextureUnitPROC)tlsGetFunction(990); - UNUSED_PARAM(clazz) - glBindTextureUnit(unit, texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTextureImage__IIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint format, jint type, jint bufSize, jlong pixelsAddress) { - glGetTextureImagePROC glGetTextureImage = (glGetTextureImagePROC)tlsGetFunction(991); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetTextureImage(texture, level, format, type, bufSize, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetCompressedTextureImage(JNIEnv *__env, jclass clazz, jint texture, jint level, jint bufSize, jlong pixelsAddress) { - glGetCompressedTextureImagePROC glGetCompressedTextureImage = (glGetCompressedTextureImagePROC)tlsGetFunction(992); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetCompressedTextureImage(texture, level, bufSize, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTextureLevelParameterfv__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint pname, jlong paramsAddress) { - glGetTextureLevelParameterfvPROC glGetTextureLevelParameterfv = (glGetTextureLevelParameterfvPROC)tlsGetFunction(993); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureLevelParameterfv(texture, level, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTextureLevelParameteriv__IIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint pname, jlong paramsAddress) { - glGetTextureLevelParameterivPROC glGetTextureLevelParameteriv = (glGetTextureLevelParameterivPROC)tlsGetFunction(994); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureLevelParameteriv(texture, level, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTextureParameterfv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint pname, jlong paramsAddress) { - glGetTextureParameterfvPROC glGetTextureParameterfv = (glGetTextureParameterfvPROC)tlsGetFunction(995); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureParameterfv(texture, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTextureParameterIiv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint pname, jlong paramsAddress) { - glGetTextureParameterIivPROC glGetTextureParameterIiv = (glGetTextureParameterIivPROC)tlsGetFunction(996); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureParameterIiv(texture, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTextureParameterIuiv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint pname, jlong paramsAddress) { - glGetTextureParameterIuivPROC glGetTextureParameterIuiv = (glGetTextureParameterIuivPROC)tlsGetFunction(997); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureParameterIuiv(texture, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTextureParameteriv__IIJ(JNIEnv *__env, jclass clazz, jint texture, jint pname, jlong paramsAddress) { - glGetTextureParameterivPROC glGetTextureParameteriv = (glGetTextureParameterivPROC)tlsGetFunction(998); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetTextureParameteriv(texture, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateVertexArrays__IJ(JNIEnv *__env, jclass clazz, jint n, jlong arraysAddress) { - glCreateVertexArraysPROC glCreateVertexArrays = (glCreateVertexArraysPROC)tlsGetFunction(999); - uintptr_t arrays = (uintptr_t)arraysAddress; - UNUSED_PARAM(clazz) - glCreateVertexArrays(n, arrays); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glDisableVertexArrayAttrib(JNIEnv *__env, jclass clazz, jint vaobj, jint index) { - glDisableVertexArrayAttribPROC glDisableVertexArrayAttrib = (glDisableVertexArrayAttribPROC)tlsGetFunction(1000); - UNUSED_PARAM(clazz) - glDisableVertexArrayAttrib(vaobj, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glEnableVertexArrayAttrib(JNIEnv *__env, jclass clazz, jint vaobj, jint index) { - glEnableVertexArrayAttribPROC glEnableVertexArrayAttrib = (glEnableVertexArrayAttribPROC)tlsGetFunction(1001); - UNUSED_PARAM(clazz) - glEnableVertexArrayAttrib(vaobj, index); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glVertexArrayElementBuffer(JNIEnv *__env, jclass clazz, jint vaobj, jint buffer) { - glVertexArrayElementBufferPROC glVertexArrayElementBuffer = (glVertexArrayElementBufferPROC)tlsGetFunction(1002); - UNUSED_PARAM(clazz) - glVertexArrayElementBuffer(vaobj, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glVertexArrayVertexBuffer(JNIEnv *__env, jclass clazz, jint vaobj, jint bindingindex, jint buffer, jlong offset, jint stride) { - glVertexArrayVertexBufferPROC glVertexArrayVertexBuffer = (glVertexArrayVertexBufferPROC)tlsGetFunction(1003); - UNUSED_PARAM(clazz) - glVertexArrayVertexBuffer(vaobj, bindingindex, buffer, (uintptr_t)offset, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglVertexArrayVertexBuffers__IIIJJJ(JNIEnv *__env, jclass clazz, jint vaobj, jint first, jint count, jlong buffersAddress, jlong offsetsAddress, jlong stridesAddress) { - glVertexArrayVertexBuffersPROC glVertexArrayVertexBuffers = (glVertexArrayVertexBuffersPROC)tlsGetFunction(1004); - uintptr_t buffers = (uintptr_t)buffersAddress; - uintptr_t offsets = (uintptr_t)offsetsAddress; - uintptr_t strides = (uintptr_t)stridesAddress; - UNUSED_PARAM(clazz) - glVertexArrayVertexBuffers(vaobj, first, count, buffers, offsets, strides); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glVertexArrayAttribFormat(JNIEnv *__env, jclass clazz, jint vaobj, jint attribindex, jint size, jint type, jboolean normalized, jint relativeoffset) { - glVertexArrayAttribFormatPROC glVertexArrayAttribFormat = (glVertexArrayAttribFormatPROC)tlsGetFunction(1005); - UNUSED_PARAM(clazz) - glVertexArrayAttribFormat(vaobj, attribindex, size, type, normalized, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glVertexArrayAttribIFormat(JNIEnv *__env, jclass clazz, jint vaobj, jint attribindex, jint size, jint type, jint relativeoffset) { - glVertexArrayAttribIFormatPROC glVertexArrayAttribIFormat = (glVertexArrayAttribIFormatPROC)tlsGetFunction(1006); - UNUSED_PARAM(clazz) - glVertexArrayAttribIFormat(vaobj, attribindex, size, type, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glVertexArrayAttribLFormat(JNIEnv *__env, jclass clazz, jint vaobj, jint attribindex, jint size, jint type, jint relativeoffset) { - glVertexArrayAttribLFormatPROC glVertexArrayAttribLFormat = (glVertexArrayAttribLFormatPROC)tlsGetFunction(1007); - UNUSED_PARAM(clazz) - glVertexArrayAttribLFormat(vaobj, attribindex, size, type, relativeoffset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glVertexArrayAttribBinding(JNIEnv *__env, jclass clazz, jint vaobj, jint attribindex, jint bindingindex) { - glVertexArrayAttribBindingPROC glVertexArrayAttribBinding = (glVertexArrayAttribBindingPROC)tlsGetFunction(1008); - UNUSED_PARAM(clazz) - glVertexArrayAttribBinding(vaobj, attribindex, bindingindex); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glVertexArrayBindingDivisor(JNIEnv *__env, jclass clazz, jint vaobj, jint bindingindex, jint divisor) { - glVertexArrayBindingDivisorPROC glVertexArrayBindingDivisor = (glVertexArrayBindingDivisorPROC)tlsGetFunction(1009); - UNUSED_PARAM(clazz) - glVertexArrayBindingDivisor(vaobj, bindingindex, divisor); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetVertexArrayiv__IIJ(JNIEnv *__env, jclass clazz, jint vaobj, jint pname, jlong paramAddress) { - glGetVertexArrayivPROC glGetVertexArrayiv = (glGetVertexArrayivPROC)tlsGetFunction(1010); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetVertexArrayiv(vaobj, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetVertexArrayIndexediv__IIIJ(JNIEnv *__env, jclass clazz, jint vaobj, jint index, jint pname, jlong paramAddress) { - glGetVertexArrayIndexedivPROC glGetVertexArrayIndexediv = (glGetVertexArrayIndexedivPROC)tlsGetFunction(1011); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetVertexArrayIndexediv(vaobj, index, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetVertexArrayIndexed64iv__IIIJ(JNIEnv *__env, jclass clazz, jint vaobj, jint index, jint pname, jlong paramAddress) { - glGetVertexArrayIndexed64ivPROC glGetVertexArrayIndexed64iv = (glGetVertexArrayIndexed64ivPROC)tlsGetFunction(1012); - uintptr_t param = (uintptr_t)paramAddress; - UNUSED_PARAM(clazz) - glGetVertexArrayIndexed64iv(vaobj, index, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateSamplers__IJ(JNIEnv *__env, jclass clazz, jint n, jlong samplersAddress) { - glCreateSamplersPROC glCreateSamplers = (glCreateSamplersPROC)tlsGetFunction(1013); - uintptr_t samplers = (uintptr_t)samplersAddress; - UNUSED_PARAM(clazz) - glCreateSamplers(n, samplers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateProgramPipelines__IJ(JNIEnv *__env, jclass clazz, jint n, jlong pipelinesAddress) { - glCreateProgramPipelinesPROC glCreateProgramPipelines = (glCreateProgramPipelinesPROC)tlsGetFunction(1014); - uintptr_t pipelines = (uintptr_t)pipelinesAddress; - UNUSED_PARAM(clazz) - glCreateProgramPipelines(n, pipelines); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglCreateQueries__IIJ(JNIEnv *__env, jclass clazz, jint target, jint n, jlong idsAddress) { - glCreateQueriesPROC glCreateQueries = (glCreateQueriesPROC)tlsGetFunction(1015); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glCreateQueries(target, n, ids); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glGetQueryBufferObjectiv(JNIEnv *__env, jclass clazz, jint id, jint buffer, jint pname, jlong offset) { - glGetQueryBufferObjectivPROC glGetQueryBufferObjectiv = (glGetQueryBufferObjectivPROC)tlsGetFunction(1016); - UNUSED_PARAM(clazz) - glGetQueryBufferObjectiv(id, buffer, pname, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glGetQueryBufferObjectuiv(JNIEnv *__env, jclass clazz, jint id, jint buffer, jint pname, jlong offset) { - glGetQueryBufferObjectuivPROC glGetQueryBufferObjectuiv = (glGetQueryBufferObjectuivPROC)tlsGetFunction(1017); - UNUSED_PARAM(clazz) - glGetQueryBufferObjectuiv(id, buffer, pname, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glGetQueryBufferObjecti64v(JNIEnv *__env, jclass clazz, jint id, jint buffer, jint pname, jlong offset) { - glGetQueryBufferObjecti64vPROC glGetQueryBufferObjecti64v = (glGetQueryBufferObjecti64vPROC)tlsGetFunction(1018); - UNUSED_PARAM(clazz) - glGetQueryBufferObjecti64v(id, buffer, pname, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glGetQueryBufferObjectui64v(JNIEnv *__env, jclass clazz, jint id, jint buffer, jint pname, jlong offset) { - glGetQueryBufferObjectui64vPROC glGetQueryBufferObjectui64v = (glGetQueryBufferObjectui64vPROC)tlsGetFunction(1019); - UNUSED_PARAM(clazz) - glGetQueryBufferObjectui64v(id, buffer, pname, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glMemoryBarrierByRegion(JNIEnv *__env, jclass clazz, jint barriers) { - glMemoryBarrierByRegionPROC glMemoryBarrierByRegion = (glMemoryBarrierByRegionPROC)tlsGetFunction(1020); - UNUSED_PARAM(clazz) - glMemoryBarrierByRegion(barriers); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetTextureSubImage__IIIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jint bufSize, jlong pixelsAddress) { - glGetTextureSubImagePROC glGetTextureSubImage = (glGetTextureSubImagePROC)tlsGetFunction(1021); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetCompressedTextureSubImage__IIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint bufSize, jlong pixelsAddress) { - glGetCompressedTextureSubImagePROC glGetCompressedTextureSubImage = (glGetCompressedTextureSubImagePROC)tlsGetFunction(1022); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_glTextureBarrier(JNIEnv *__env, jclass clazz) { - glTextureBarrierPROC glTextureBarrier = (glTextureBarrierPROC)tlsGetFunction(1023); - UNUSED_PARAM(clazz) - glTextureBarrier(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GL45C_glGetGraphicsResetStatus(JNIEnv *__env, jclass clazz) { - glGetGraphicsResetStatusPROC glGetGraphicsResetStatus = (glGetGraphicsResetStatusPROC)tlsGetFunction(1024); - UNUSED_PARAM(clazz) - return glGetGraphicsResetStatus(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetnTexImage__IIIIIJ(JNIEnv *__env, jclass clazz, jint tex, jint level, jint format, jint type, jint bufSize, jlong imgAddress) { - glGetnTexImagePROC glGetnTexImage = (glGetnTexImagePROC)tlsGetFunction(1032); - uintptr_t img = (uintptr_t)imgAddress; - UNUSED_PARAM(clazz) - glGetnTexImage(tex, level, format, type, bufSize, img); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglReadnPixels__IIIIIIIJ(JNIEnv *__env, jclass clazz, jint x, jint y, jint width, jint height, jint format, jint type, jint bufSize, jlong pixelsAddress) { - glReadnPixelsPROC glReadnPixels = (glReadnPixelsPROC)tlsGetFunction(1033); - uintptr_t pixels = (uintptr_t)pixelsAddress; - UNUSED_PARAM(clazz) - glReadnPixels(x, y, width, height, format, type, bufSize, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetnCompressedTexImage(JNIEnv *__env, jclass clazz, jint target, jint level, jint bufSize, jlong imgAddress) { - glGetnCompressedTexImagePROC glGetnCompressedTexImage = (glGetnCompressedTexImagePROC)tlsGetFunction(1039); - uintptr_t img = (uintptr_t)imgAddress; - UNUSED_PARAM(clazz) - glGetnCompressedTexImage(target, level, bufSize, img); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetnUniformfv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformfvPROC glGetnUniformfv = (glGetnUniformfvPROC)tlsGetFunction(1040); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformfv(program, location, bufSize, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetnUniformdv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformdvPROC glGetnUniformdv = (glGetnUniformdvPROC)tlsGetFunction(1041); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformdv(program, location, bufSize, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetnUniformiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformivPROC glGetnUniformiv = (glGetnUniformivPROC)tlsGetFunction(1042); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformiv(program, location, bufSize, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL45C_nglGetnUniformuiv__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint bufSize, jlong paramsAddress) { - glGetnUniformuivPROC glGetnUniformuiv = (glGetnUniformuivPROC)tlsGetFunction(1043); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetnUniformuiv(program, location, bufSize, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL46C.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL46C.c deleted file mode 100644 index 7e41fa6a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GL46C.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glMultiDrawArraysIndirectCountPROC) (jint, uintptr_t, uintptr_t, jint, jint); -typedef void (APIENTRY *glMultiDrawElementsIndirectCountPROC) (jint, jint, uintptr_t, uintptr_t, jint, jint); -typedef void (APIENTRY *glPolygonOffsetClampPROC) (jfloat, jfloat, jfloat); -typedef void (APIENTRY *glSpecializeShaderPROC) (jint, uintptr_t, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL46C_nglMultiDrawArraysIndirectCount__IJJII(JNIEnv *__env, jclass clazz, jint mode, jlong indirectAddress, jlong drawcount, jint maxdrawcount, jint stride) { - glMultiDrawArraysIndirectCountPROC glMultiDrawArraysIndirectCount = (glMultiDrawArraysIndirectCountPROC)tlsGetFunction(1044); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawArraysIndirectCount(mode, indirect, (uintptr_t)drawcount, maxdrawcount, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL46C_nglMultiDrawElementsIndirectCount__IIJJII(JNIEnv *__env, jclass clazz, jint mode, jint type, jlong indirectAddress, jlong drawcount, jint maxdrawcount, jint stride) { - glMultiDrawElementsIndirectCountPROC glMultiDrawElementsIndirectCount = (glMultiDrawElementsIndirectCountPROC)tlsGetFunction(1045); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawElementsIndirectCount(mode, type, indirect, (uintptr_t)drawcount, maxdrawcount, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL46C_glPolygonOffsetClamp(JNIEnv *__env, jclass clazz, jfloat factor, jfloat units, jfloat clamp) { - glPolygonOffsetClampPROC glPolygonOffsetClamp = (glPolygonOffsetClampPROC)tlsGetFunction(1046); - UNUSED_PARAM(clazz) - glPolygonOffsetClamp(factor, units, clamp); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL46C_nglSpecializeShader__IJIJJ(JNIEnv *__env, jclass clazz, jint shader, jlong pEntryPointAddress, jint numSpecializationConstants, jlong pConstantIndexAddress, jlong pConstantValueAddress) { - glSpecializeShaderPROC glSpecializeShader = (glSpecializeShaderPROC)tlsGetFunction(1047); - uintptr_t pEntryPoint = (uintptr_t)pEntryPointAddress; - uintptr_t pConstantIndex = (uintptr_t)pConstantIndexAddress; - uintptr_t pConstantValue = (uintptr_t)pConstantValueAddress; - UNUSED_PARAM(clazz) - glSpecializeShader(shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GREMEDYFrameTerminator.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GREMEDYFrameTerminator.c deleted file mode 100644 index 02142618..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GREMEDYFrameTerminator.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFrameTerminatorGREMEDYPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GREMEDYFrameTerminator_glFrameTerminatorGREMEDY(JNIEnv *__env, jclass clazz) { - glFrameTerminatorGREMEDYPROC glFrameTerminatorGREMEDY = (glFrameTerminatorGREMEDYPROC)tlsGetFunction(1887); - UNUSED_PARAM(clazz) - glFrameTerminatorGREMEDY(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GREMEDYStringMarker.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GREMEDYStringMarker.c deleted file mode 100644 index c4d12a7f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_GREMEDYStringMarker.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glStringMarkerGREMEDYPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GREMEDYStringMarker_nglStringMarkerGREMEDY(JNIEnv *__env, jclass clazz, jint len, jlong stringAddress) { - glStringMarkerGREMEDYPROC glStringMarkerGREMEDY = (glStringMarkerGREMEDYPROC)tlsGetFunction(1888); - uintptr_t string = (uintptr_t)stringAddress; - UNUSED_PARAM(clazz) - glStringMarkerGREMEDY(len, string); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELFramebufferCMAA.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELFramebufferCMAA.c deleted file mode 100644 index dce2a791..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELFramebufferCMAA.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glApplyFramebufferAttachmentCMAAINTELPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELFramebufferCMAA_glApplyFramebufferAttachmentCMAAINTEL(JNIEnv *__env, jclass clazz) { - glApplyFramebufferAttachmentCMAAINTELPROC glApplyFramebufferAttachmentCMAAINTEL = (glApplyFramebufferAttachmentCMAAINTELPROC)tlsGetFunction(1889); - UNUSED_PARAM(clazz) - glApplyFramebufferAttachmentCMAAINTEL(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELMapTexture.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELMapTexture.c deleted file mode 100644 index a37668db..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELMapTexture.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glSyncTextureINTELPROC) (jint); -typedef void (APIENTRY *glUnmapTexture2DINTELPROC) (jint, jint); -typedef uintptr_t (APIENTRY *glMapTexture2DINTELPROC) (jint, jint, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELMapTexture_glSyncTextureINTEL(JNIEnv *__env, jclass clazz, jint texture) { - glSyncTextureINTELPROC glSyncTextureINTEL = (glSyncTextureINTELPROC)tlsGetFunction(1890); - UNUSED_PARAM(clazz) - glSyncTextureINTEL(texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELMapTexture_glUnmapTexture2DINTEL(JNIEnv *__env, jclass clazz, jint texture, jint level) { - glUnmapTexture2DINTELPROC glUnmapTexture2DINTEL = (glUnmapTexture2DINTELPROC)tlsGetFunction(1891); - UNUSED_PARAM(clazz) - glUnmapTexture2DINTEL(texture, level); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_INTELMapTexture_nglMapTexture2DINTEL__IIIJJ(JNIEnv *__env, jclass clazz, jint texture, jint level, jint access, jlong strideAddress, jlong layoutAddress) { - glMapTexture2DINTELPROC glMapTexture2DINTEL = (glMapTexture2DINTELPROC)tlsGetFunction(1892); - uintptr_t stride = (uintptr_t)strideAddress; - uintptr_t layout = (uintptr_t)layoutAddress; - UNUSED_PARAM(clazz) - return (jlong)glMapTexture2DINTEL(texture, level, access, stride, layout); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELPerformanceQuery.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELPerformanceQuery.c deleted file mode 100644 index 96d39c18..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_INTELPerformanceQuery.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBeginPerfQueryINTELPROC) (jint); -typedef void (APIENTRY *glCreatePerfQueryINTELPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeletePerfQueryINTELPROC) (jint); -typedef void (APIENTRY *glEndPerfQueryINTELPROC) (jint); -typedef void (APIENTRY *glGetFirstPerfQueryIdINTELPROC) (uintptr_t); -typedef void (APIENTRY *glGetNextPerfQueryIdINTELPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetPerfCounterInfoINTELPROC) (jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetPerfQueryDataINTELPROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetPerfQueryIdByNameINTELPROC) (uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetPerfQueryInfoINTELPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_glBeginPerfQueryINTEL(JNIEnv *__env, jclass clazz, jint queryHandle) { - glBeginPerfQueryINTELPROC glBeginPerfQueryINTEL = (glBeginPerfQueryINTELPROC)tlsGetFunction(1893); - UNUSED_PARAM(clazz) - glBeginPerfQueryINTEL(queryHandle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_nglCreatePerfQueryINTEL__IJ(JNIEnv *__env, jclass clazz, jint queryId, jlong queryHandleAddress) { - glCreatePerfQueryINTELPROC glCreatePerfQueryINTEL = (glCreatePerfQueryINTELPROC)tlsGetFunction(1894); - uintptr_t queryHandle = (uintptr_t)queryHandleAddress; - UNUSED_PARAM(clazz) - glCreatePerfQueryINTEL(queryId, queryHandle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_glDeletePerfQueryINTEL(JNIEnv *__env, jclass clazz, jint queryHandle) { - glDeletePerfQueryINTELPROC glDeletePerfQueryINTEL = (glDeletePerfQueryINTELPROC)tlsGetFunction(1895); - UNUSED_PARAM(clazz) - glDeletePerfQueryINTEL(queryHandle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_glEndPerfQueryINTEL(JNIEnv *__env, jclass clazz, jint queryHandle) { - glEndPerfQueryINTELPROC glEndPerfQueryINTEL = (glEndPerfQueryINTELPROC)tlsGetFunction(1896); - UNUSED_PARAM(clazz) - glEndPerfQueryINTEL(queryHandle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_nglGetFirstPerfQueryIdINTEL__J(JNIEnv *__env, jclass clazz, jlong queryIdAddress) { - glGetFirstPerfQueryIdINTELPROC glGetFirstPerfQueryIdINTEL = (glGetFirstPerfQueryIdINTELPROC)tlsGetFunction(1897); - uintptr_t queryId = (uintptr_t)queryIdAddress; - UNUSED_PARAM(clazz) - glGetFirstPerfQueryIdINTEL(queryId); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_nglGetNextPerfQueryIdINTEL__IJ(JNIEnv *__env, jclass clazz, jint queryId, jlong nextQueryIdAddress) { - glGetNextPerfQueryIdINTELPROC glGetNextPerfQueryIdINTEL = (glGetNextPerfQueryIdINTELPROC)tlsGetFunction(1898); - uintptr_t nextQueryId = (uintptr_t)nextQueryIdAddress; - UNUSED_PARAM(clazz) - glGetNextPerfQueryIdINTEL(queryId, nextQueryId); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_nglGetPerfCounterInfoINTEL__IIIJIJJJJJJ(JNIEnv *__env, jclass clazz, jint queryId, jint counterId, jint counterNameLength, jlong counterNameAddress, jint counterDescLength, jlong counterDescAddress, jlong counterOffsetAddress, jlong counterDataSizeAddress, jlong counterTypeEnumAddress, jlong counterDataTypeEnumAddress, jlong rawCounterMaxValueAddress) { - glGetPerfCounterInfoINTELPROC glGetPerfCounterInfoINTEL = (glGetPerfCounterInfoINTELPROC)tlsGetFunction(1899); - uintptr_t counterName = (uintptr_t)counterNameAddress; - uintptr_t counterDesc = (uintptr_t)counterDescAddress; - uintptr_t counterOffset = (uintptr_t)counterOffsetAddress; - uintptr_t counterDataSize = (uintptr_t)counterDataSizeAddress; - uintptr_t counterTypeEnum = (uintptr_t)counterTypeEnumAddress; - uintptr_t counterDataTypeEnum = (uintptr_t)counterDataTypeEnumAddress; - uintptr_t rawCounterMaxValue = (uintptr_t)rawCounterMaxValueAddress; - UNUSED_PARAM(clazz) - glGetPerfCounterInfoINTEL(queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_nglGetPerfQueryDataINTEL__IIIJJ(JNIEnv *__env, jclass clazz, jint queryHandle, jint flags, jint dataSize, jlong dataAddress, jlong bytesWrittenAddress) { - glGetPerfQueryDataINTELPROC glGetPerfQueryDataINTEL = (glGetPerfQueryDataINTELPROC)tlsGetFunction(1900); - uintptr_t data = (uintptr_t)dataAddress; - uintptr_t bytesWritten = (uintptr_t)bytesWrittenAddress; - UNUSED_PARAM(clazz) - glGetPerfQueryDataINTEL(queryHandle, flags, dataSize, data, bytesWritten); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_nglGetPerfQueryIdByNameINTEL__JJ(JNIEnv *__env, jclass clazz, jlong queryNameAddress, jlong queryIdAddress) { - glGetPerfQueryIdByNameINTELPROC glGetPerfQueryIdByNameINTEL = (glGetPerfQueryIdByNameINTELPROC)tlsGetFunction(1901); - uintptr_t queryName = (uintptr_t)queryNameAddress; - uintptr_t queryId = (uintptr_t)queryIdAddress; - UNUSED_PARAM(clazz) - glGetPerfQueryIdByNameINTEL(queryName, queryId); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_INTELPerformanceQuery_nglGetPerfQueryInfoINTEL__IIJJJJJ(JNIEnv *__env, jclass clazz, jint queryId, jint queryNameLength, jlong queryNameAddress, jlong dataSizeAddress, jlong noCountersAddress, jlong noInstancesAddress, jlong capsMaskAddress) { - glGetPerfQueryInfoINTELPROC glGetPerfQueryInfoINTEL = (glGetPerfQueryInfoINTELPROC)tlsGetFunction(1902); - uintptr_t queryName = (uintptr_t)queryNameAddress; - uintptr_t dataSize = (uintptr_t)dataSizeAddress; - uintptr_t noCounters = (uintptr_t)noCountersAddress; - uintptr_t noInstances = (uintptr_t)noInstancesAddress; - uintptr_t capsMask = (uintptr_t)capsMaskAddress; - UNUSED_PARAM(clazz) - glGetPerfQueryInfoINTEL(queryId, queryNameLength, queryName, dataSize, noCounters, noInstances, capsMask); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_KHRBlendEquationAdvanced.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_KHRBlendEquationAdvanced.c deleted file mode 100644 index 876d85d8..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_KHRBlendEquationAdvanced.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendBarrierKHRPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_KHRBlendEquationAdvanced_glBlendBarrierKHR(JNIEnv *__env, jclass clazz) { - glBlendBarrierKHRPROC glBlendBarrierKHR = (glBlendBarrierKHRPROC)tlsGetFunction(1903); - UNUSED_PARAM(clazz) - glBlendBarrierKHR(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_KHRParallelShaderCompile.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_KHRParallelShaderCompile.c deleted file mode 100644 index 4a9f1458..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_KHRParallelShaderCompile.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glMaxShaderCompilerThreadsKHRPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_KHRParallelShaderCompile_glMaxShaderCompilerThreadsKHR(JNIEnv *__env, jclass clazz, jint count) { - glMaxShaderCompilerThreadsKHRPROC glMaxShaderCompilerThreadsKHR = (glMaxShaderCompilerThreadsKHRPROC)tlsGetFunction(1904); - UNUSED_PARAM(clazz) - glMaxShaderCompilerThreadsKHR(count); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_MESAFramebufferFlipY.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_MESAFramebufferFlipY.c deleted file mode 100644 index 7ebfbf7f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_MESAFramebufferFlipY.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFramebufferParameteriMESAPROC) (jint, jint, jint); -typedef void (APIENTRY *glGetFramebufferParameterivMESAPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MESAFramebufferFlipY_glFramebufferParameteriMESA(JNIEnv *__env, jclass clazz, jint target, jint pname, jint param) { - glFramebufferParameteriMESAPROC glFramebufferParameteriMESA = (glFramebufferParameteriMESAPROC)tlsGetFunction(1905); - UNUSED_PARAM(clazz) - glFramebufferParameteriMESA(target, pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MESAFramebufferFlipY_nglGetFramebufferParameterivMESA__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetFramebufferParameterivMESAPROC glGetFramebufferParameterivMESA = (glGetFramebufferParameterivMESAPROC)tlsGetFunction(1906); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetFramebufferParameterivMESA(target, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVAlphaToCoverageDitherControl.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVAlphaToCoverageDitherControl.c deleted file mode 100644 index 26f4a7e3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVAlphaToCoverageDitherControl.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glAlphaToCoverageDitherControlNVPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVAlphaToCoverageDitherControl_glAlphaToCoverageDitherControlNV(JNIEnv *__env, jclass clazz, jint mode) { - glAlphaToCoverageDitherControlNVPROC glAlphaToCoverageDitherControlNV = (glAlphaToCoverageDitherControlNVPROC)tlsGetFunction(1907); - UNUSED_PARAM(clazz) - glAlphaToCoverageDitherControlNV(mode); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirect.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirect.c deleted file mode 100644 index 180c1f00..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirect.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glMultiDrawArraysIndirectBindlessNVPROC) (jint, uintptr_t, jint, jint, jint); -typedef void (APIENTRY *glMultiDrawElementsIndirectBindlessNVPROC) (jint, jint, uintptr_t, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessMultiDrawIndirect_nglMultiDrawArraysIndirectBindlessNV(JNIEnv *__env, jclass clazz, jint mode, jlong indirectAddress, jint drawCount, jint stride, jint vertexBufferCount) { - glMultiDrawArraysIndirectBindlessNVPROC glMultiDrawArraysIndirectBindlessNV = (glMultiDrawArraysIndirectBindlessNVPROC)tlsGetFunction(1908); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawArraysIndirectBindlessNV(mode, indirect, drawCount, stride, vertexBufferCount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessMultiDrawIndirect_nglMultiDrawElementsIndirectBindlessNV(JNIEnv *__env, jclass clazz, jint mode, jint type, jlong indirectAddress, jint drawCount, jint stride, jint vertexBufferCount) { - glMultiDrawElementsIndirectBindlessNVPROC glMultiDrawElementsIndirectBindlessNV = (glMultiDrawElementsIndirectBindlessNVPROC)tlsGetFunction(1909); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawElementsIndirectBindlessNV(mode, type, indirect, drawCount, stride, vertexBufferCount); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirectCount.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirectCount.c deleted file mode 100644 index 5a554ac3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessMultiDrawIndirectCount.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glMultiDrawArraysIndirectBindlessCountNVPROC) (jint, uintptr_t, uintptr_t, jint, jint, jint); -typedef void (APIENTRY *glMultiDrawElementsIndirectBindlessCountNVPROC) (jint, jint, uintptr_t, uintptr_t, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessMultiDrawIndirectCount_nglMultiDrawArraysIndirectBindlessCountNV(JNIEnv *__env, jclass clazz, jint mode, jlong indirectAddress, jlong drawCount, jint maxDrawCount, jint stride, jint vertexBufferCount) { - glMultiDrawArraysIndirectBindlessCountNVPROC glMultiDrawArraysIndirectBindlessCountNV = (glMultiDrawArraysIndirectBindlessCountNVPROC)tlsGetFunction(1910); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawArraysIndirectBindlessCountNV(mode, indirect, (uintptr_t)drawCount, maxDrawCount, stride, vertexBufferCount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessMultiDrawIndirectCount_nglMultiDrawElementsIndirectBindlessCountNV(JNIEnv *__env, jclass clazz, jint mode, jint type, jlong indirectAddress, jlong drawCount, jint maxDrawCount, jint stride, jint vertexBufferCount) { - glMultiDrawElementsIndirectBindlessCountNVPROC glMultiDrawElementsIndirectBindlessCountNV = (glMultiDrawElementsIndirectBindlessCountNVPROC)tlsGetFunction(1911); - uintptr_t indirect = (uintptr_t)indirectAddress; - UNUSED_PARAM(clazz) - glMultiDrawElementsIndirectBindlessCountNV(mode, type, indirect, (uintptr_t)drawCount, maxDrawCount, stride, vertexBufferCount); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessTexture.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessTexture.c deleted file mode 100644 index d3257672..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBindlessTexture.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jlong (APIENTRY *glGetTextureHandleNVPROC) (jint); -typedef jlong (APIENTRY *glGetTextureSamplerHandleNVPROC) (jint, jint); -typedef void (APIENTRY *glMakeTextureHandleResidentNVPROC) (jlong); -typedef void (APIENTRY *glMakeTextureHandleNonResidentNVPROC) (jlong); -typedef jlong (APIENTRY *glGetImageHandleNVPROC) (jint, jint, jboolean, jint, jint); -typedef void (APIENTRY *glMakeImageHandleResidentNVPROC) (jlong, jint); -typedef void (APIENTRY *glMakeImageHandleNonResidentNVPROC) (jlong); -typedef void (APIENTRY *glUniformHandleui64NVPROC) (jint, jlong); -typedef void (APIENTRY *glUniformHandleui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniformHandleui64NVPROC) (jint, jint, jlong); -typedef void (APIENTRY *glProgramUniformHandleui64vNVPROC) (jint, jint, jint, uintptr_t); -typedef jboolean (APIENTRY *glIsTextureHandleResidentNVPROC) (jlong); -typedef jboolean (APIENTRY *glIsImageHandleResidentNVPROC) (jlong); - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glGetTextureHandleNV(JNIEnv *__env, jclass clazz, jint texture) { - glGetTextureHandleNVPROC glGetTextureHandleNV = (glGetTextureHandleNVPROC)tlsGetFunction(1912); - UNUSED_PARAM(clazz) - return glGetTextureHandleNV(texture); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glGetTextureSamplerHandleNV(JNIEnv *__env, jclass clazz, jint texture, jint sampler) { - glGetTextureSamplerHandleNVPROC glGetTextureSamplerHandleNV = (glGetTextureSamplerHandleNVPROC)tlsGetFunction(1913); - UNUSED_PARAM(clazz) - return glGetTextureSamplerHandleNV(texture, sampler); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glMakeTextureHandleResidentNV(JNIEnv *__env, jclass clazz, jlong handle) { - glMakeTextureHandleResidentNVPROC glMakeTextureHandleResidentNV = (glMakeTextureHandleResidentNVPROC)tlsGetFunction(1914); - UNUSED_PARAM(clazz) - glMakeTextureHandleResidentNV(handle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glMakeTextureHandleNonResidentNV(JNIEnv *__env, jclass clazz, jlong handle) { - glMakeTextureHandleNonResidentNVPROC glMakeTextureHandleNonResidentNV = (glMakeTextureHandleNonResidentNVPROC)tlsGetFunction(1915); - UNUSED_PARAM(clazz) - glMakeTextureHandleNonResidentNV(handle); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glGetImageHandleNV(JNIEnv *__env, jclass clazz, jint texture, jint level, jboolean layered, jint layer, jint format) { - glGetImageHandleNVPROC glGetImageHandleNV = (glGetImageHandleNVPROC)tlsGetFunction(1916); - UNUSED_PARAM(clazz) - return glGetImageHandleNV(texture, level, layered, layer, format); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glMakeImageHandleResidentNV(JNIEnv *__env, jclass clazz, jlong handle, jint access) { - glMakeImageHandleResidentNVPROC glMakeImageHandleResidentNV = (glMakeImageHandleResidentNVPROC)tlsGetFunction(1917); - UNUSED_PARAM(clazz) - glMakeImageHandleResidentNV(handle, access); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glMakeImageHandleNonResidentNV(JNIEnv *__env, jclass clazz, jlong handle) { - glMakeImageHandleNonResidentNVPROC glMakeImageHandleNonResidentNV = (glMakeImageHandleNonResidentNVPROC)tlsGetFunction(1918); - UNUSED_PARAM(clazz) - glMakeImageHandleNonResidentNV(handle); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glUniformHandleui64NV(JNIEnv *__env, jclass clazz, jint location, jlong value) { - glUniformHandleui64NVPROC glUniformHandleui64NV = (glUniformHandleui64NVPROC)tlsGetFunction(1919); - UNUSED_PARAM(clazz) - glUniformHandleui64NV(location, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_nglUniformHandleui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valuesAddress) { - glUniformHandleui64vNVPROC glUniformHandleui64vNV = (glUniformHandleui64vNVPROC)tlsGetFunction(1920); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glUniformHandleui64vNV(location, count, values); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glProgramUniformHandleui64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong value) { - glProgramUniformHandleui64NVPROC glProgramUniformHandleui64NV = (glProgramUniformHandleui64NVPROC)tlsGetFunction(1921); - UNUSED_PARAM(clazz) - glProgramUniformHandleui64NV(program, location, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_nglProgramUniformHandleui64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valuesAddress) { - glProgramUniformHandleui64vNVPROC glProgramUniformHandleui64vNV = (glProgramUniformHandleui64vNVPROC)tlsGetFunction(1922); - uintptr_t values = (uintptr_t)valuesAddress; - UNUSED_PARAM(clazz) - glProgramUniformHandleui64vNV(program, location, count, values); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glIsTextureHandleResidentNV(JNIEnv *__env, jclass clazz, jlong handle) { - glIsTextureHandleResidentNVPROC glIsTextureHandleResidentNV = (glIsTextureHandleResidentNVPROC)tlsGetFunction(1923); - UNUSED_PARAM(clazz) - return glIsTextureHandleResidentNV(handle); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVBindlessTexture_glIsImageHandleResidentNV(JNIEnv *__env, jclass clazz, jlong handle) { - glIsImageHandleResidentNVPROC glIsImageHandleResidentNV = (glIsImageHandleResidentNVPROC)tlsGetFunction(1924); - UNUSED_PARAM(clazz) - return glIsImageHandleResidentNV(handle); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBlendEquationAdvanced.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBlendEquationAdvanced.c deleted file mode 100644 index 2e50e23f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVBlendEquationAdvanced.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBlendParameteriNVPROC) (jint, jint); -typedef void (APIENTRY *glBlendBarrierNVPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBlendEquationAdvanced_glBlendParameteriNV(JNIEnv *__env, jclass clazz, jint pname, jint value) { - glBlendParameteriNVPROC glBlendParameteriNV = (glBlendParameteriNVPROC)tlsGetFunction(1925); - UNUSED_PARAM(clazz) - glBlendParameteriNV(pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVBlendEquationAdvanced_glBlendBarrierNV(JNIEnv *__env, jclass clazz) { - glBlendBarrierNVPROC glBlendBarrierNV = (glBlendBarrierNVPROC)tlsGetFunction(1926); - UNUSED_PARAM(clazz) - glBlendBarrierNV(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVClipSpaceWScaling.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVClipSpaceWScaling.c deleted file mode 100644 index 93938d20..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVClipSpaceWScaling.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glViewportPositionWScaleNVPROC) (jint, jfloat, jfloat); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVClipSpaceWScaling_glViewportPositionWScaleNV(JNIEnv *__env, jclass clazz, jint index, jfloat xcoeff, jfloat ycoeff) { - glViewportPositionWScaleNVPROC glViewportPositionWScaleNV = (glViewportPositionWScaleNVPROC)tlsGetFunction(1927); - UNUSED_PARAM(clazz) - glViewportPositionWScaleNV(index, xcoeff, ycoeff); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVCommandList.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVCommandList.c deleted file mode 100644 index b06f0957..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVCommandList.c +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glCreateStatesNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeleteStatesNVPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsStateNVPROC) (jint); -typedef void (APIENTRY *glStateCaptureNVPROC) (jint, jint); -typedef jint (APIENTRY *glGetCommandHeaderNVPROC) (jint, jint); -typedef uint16_t (APIENTRY *glGetStageIndexNVPROC) (jint); -typedef void (APIENTRY *glDrawCommandsNVPROC) (jint, jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glDrawCommandsAddressNVPROC) (jint, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glDrawCommandsStatesNVPROC) (jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glDrawCommandsStatesAddressNVPROC) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glCreateCommandListsNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeleteCommandListsNVPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsCommandListNVPROC) (jint); -typedef void (APIENTRY *glListDrawCommandsStatesClientNVPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint); -typedef void (APIENTRY *glCommandListSegmentsNVPROC) (jint, jint); -typedef void (APIENTRY *glCompileCommandListNVPROC) (jint); -typedef void (APIENTRY *glCallCommandListNVPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglCreateStatesNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong statesAddress) { - glCreateStatesNVPROC glCreateStatesNV = (glCreateStatesNVPROC)tlsGetFunction(1928); - uintptr_t states = (uintptr_t)statesAddress; - UNUSED_PARAM(clazz) - glCreateStatesNV(n, states); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglDeleteStatesNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong statesAddress) { - glDeleteStatesNVPROC glDeleteStatesNV = (glDeleteStatesNVPROC)tlsGetFunction(1929); - uintptr_t states = (uintptr_t)statesAddress; - UNUSED_PARAM(clazz) - glDeleteStatesNV(n, states); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVCommandList_glIsStateNV(JNIEnv *__env, jclass clazz, jint state) { - glIsStateNVPROC glIsStateNV = (glIsStateNVPROC)tlsGetFunction(1930); - UNUSED_PARAM(clazz) - return glIsStateNV(state); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_glStateCaptureNV(JNIEnv *__env, jclass clazz, jint state, jint mode) { - glStateCaptureNVPROC glStateCaptureNV = (glStateCaptureNVPROC)tlsGetFunction(1931); - UNUSED_PARAM(clazz) - glStateCaptureNV(state, mode); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVCommandList_glGetCommandHeaderNV(JNIEnv *__env, jclass clazz, jint tokenID, jint size) { - glGetCommandHeaderNVPROC glGetCommandHeaderNV = (glGetCommandHeaderNVPROC)tlsGetFunction(1932); - UNUSED_PARAM(clazz) - return glGetCommandHeaderNV(tokenID, size); -} - -JNIEXPORT jshort JNICALL Java_org_lwjgl_opengl_NVCommandList_glGetStageIndexNV(JNIEnv *__env, jclass clazz, jint shadertype) { - glGetStageIndexNVPROC glGetStageIndexNV = (glGetStageIndexNVPROC)tlsGetFunction(1933); - UNUSED_PARAM(clazz) - return (jshort)glGetStageIndexNV(shadertype); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglDrawCommandsNV__IIJJI(JNIEnv *__env, jclass clazz, jint primitiveMode, jint buffer, jlong indirectsAddress, jlong sizesAddress, jint count) { - glDrawCommandsNVPROC glDrawCommandsNV = (glDrawCommandsNVPROC)tlsGetFunction(1934); - uintptr_t indirects = (uintptr_t)indirectsAddress; - uintptr_t sizes = (uintptr_t)sizesAddress; - UNUSED_PARAM(clazz) - glDrawCommandsNV(primitiveMode, buffer, indirects, sizes, count); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglDrawCommandsAddressNV__IJJI(JNIEnv *__env, jclass clazz, jint primitiveMode, jlong indirectsAddress, jlong sizesAddress, jint count) { - glDrawCommandsAddressNVPROC glDrawCommandsAddressNV = (glDrawCommandsAddressNVPROC)tlsGetFunction(1935); - uintptr_t indirects = (uintptr_t)indirectsAddress; - uintptr_t sizes = (uintptr_t)sizesAddress; - UNUSED_PARAM(clazz) - glDrawCommandsAddressNV(primitiveMode, indirects, sizes, count); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglDrawCommandsStatesNV__IJJJJI(JNIEnv *__env, jclass clazz, jint buffer, jlong indirectsAddress, jlong sizesAddress, jlong statesAddress, jlong fbosAddress, jint count) { - glDrawCommandsStatesNVPROC glDrawCommandsStatesNV = (glDrawCommandsStatesNVPROC)tlsGetFunction(1936); - uintptr_t indirects = (uintptr_t)indirectsAddress; - uintptr_t sizes = (uintptr_t)sizesAddress; - uintptr_t states = (uintptr_t)statesAddress; - uintptr_t fbos = (uintptr_t)fbosAddress; - UNUSED_PARAM(clazz) - glDrawCommandsStatesNV(buffer, indirects, sizes, states, fbos, count); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglDrawCommandsStatesAddressNV__JJJJI(JNIEnv *__env, jclass clazz, jlong indirectsAddress, jlong sizesAddress, jlong statesAddress, jlong fbosAddress, jint count) { - glDrawCommandsStatesAddressNVPROC glDrawCommandsStatesAddressNV = (glDrawCommandsStatesAddressNVPROC)tlsGetFunction(1937); - uintptr_t indirects = (uintptr_t)indirectsAddress; - uintptr_t sizes = (uintptr_t)sizesAddress; - uintptr_t states = (uintptr_t)statesAddress; - uintptr_t fbos = (uintptr_t)fbosAddress; - UNUSED_PARAM(clazz) - glDrawCommandsStatesAddressNV(indirects, sizes, states, fbos, count); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglCreateCommandListsNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong listsAddress) { - glCreateCommandListsNVPROC glCreateCommandListsNV = (glCreateCommandListsNVPROC)tlsGetFunction(1938); - uintptr_t lists = (uintptr_t)listsAddress; - UNUSED_PARAM(clazz) - glCreateCommandListsNV(n, lists); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglDeleteCommandListsNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong listsAddress) { - glDeleteCommandListsNVPROC glDeleteCommandListsNV = (glDeleteCommandListsNVPROC)tlsGetFunction(1939); - uintptr_t lists = (uintptr_t)listsAddress; - UNUSED_PARAM(clazz) - glDeleteCommandListsNV(n, lists); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVCommandList_glIsCommandListNV(JNIEnv *__env, jclass clazz, jint list) { - glIsCommandListNVPROC glIsCommandListNV = (glIsCommandListNVPROC)tlsGetFunction(1940); - UNUSED_PARAM(clazz) - return glIsCommandListNV(list); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_nglListDrawCommandsStatesClientNV__IIJJJJI(JNIEnv *__env, jclass clazz, jint list, jint segment, jlong indirectsAddress, jlong sizesAddress, jlong statesAddress, jlong fbosAddress, jint count) { - glListDrawCommandsStatesClientNVPROC glListDrawCommandsStatesClientNV = (glListDrawCommandsStatesClientNVPROC)tlsGetFunction(1941); - uintptr_t indirects = (uintptr_t)indirectsAddress; - uintptr_t sizes = (uintptr_t)sizesAddress; - uintptr_t states = (uintptr_t)statesAddress; - uintptr_t fbos = (uintptr_t)fbosAddress; - UNUSED_PARAM(clazz) - glListDrawCommandsStatesClientNV(list, segment, indirects, sizes, states, fbos, count); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_glCommandListSegmentsNV(JNIEnv *__env, jclass clazz, jint list, jint segments) { - glCommandListSegmentsNVPROC glCommandListSegmentsNV = (glCommandListSegmentsNVPROC)tlsGetFunction(1942); - UNUSED_PARAM(clazz) - glCommandListSegmentsNV(list, segments); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_glCompileCommandListNV(JNIEnv *__env, jclass clazz, jint list) { - glCompileCommandListNVPROC glCompileCommandListNV = (glCompileCommandListNVPROC)tlsGetFunction(1943); - UNUSED_PARAM(clazz) - glCompileCommandListNV(list); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCommandList_glCallCommandListNV(JNIEnv *__env, jclass clazz, jint list) { - glCallCommandListNVPROC glCallCommandListNV = (glCallCommandListNVPROC)tlsGetFunction(1944); - UNUSED_PARAM(clazz) - glCallCommandListNV(list); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConditionalRender.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConditionalRender.c deleted file mode 100644 index 01e3549d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConditionalRender.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBeginConditionalRenderNVPROC) (jint, jint); -typedef void (APIENTRY *glEndConditionalRenderNVPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVConditionalRender_glBeginConditionalRenderNV(JNIEnv *__env, jclass clazz, jint id, jint mode) { - glBeginConditionalRenderNVPROC glBeginConditionalRenderNV = (glBeginConditionalRenderNVPROC)tlsGetFunction(1945); - UNUSED_PARAM(clazz) - glBeginConditionalRenderNV(id, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVConditionalRender_glEndConditionalRenderNV(JNIEnv *__env, jclass clazz) { - glEndConditionalRenderNVPROC glEndConditionalRenderNV = (glEndConditionalRenderNVPROC)tlsGetFunction(1946); - UNUSED_PARAM(clazz) - glEndConditionalRenderNV(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRaster.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRaster.c deleted file mode 100644 index e52912be..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRaster.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glSubpixelPrecisionBiasNVPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVConservativeRaster_glSubpixelPrecisionBiasNV(JNIEnv *__env, jclass clazz, jint xbits, jint ybits) { - glSubpixelPrecisionBiasNVPROC glSubpixelPrecisionBiasNV = (glSubpixelPrecisionBiasNVPROC)tlsGetFunction(1947); - UNUSED_PARAM(clazz) - glSubpixelPrecisionBiasNV(xbits, ybits); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRasterDilate.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRasterDilate.c deleted file mode 100644 index 2faa93cc..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRasterDilate.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glConservativeRasterParameterfNVPROC) (jint, jfloat); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVConservativeRasterDilate_glConservativeRasterParameterfNV(JNIEnv *__env, jclass clazz, jint pname, jfloat value) { - glConservativeRasterParameterfNVPROC glConservativeRasterParameterfNV = (glConservativeRasterParameterfNVPROC)tlsGetFunction(1948); - UNUSED_PARAM(clazz) - glConservativeRasterParameterfNV(pname, value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRasterPreSnapTriangles.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRasterPreSnapTriangles.c deleted file mode 100644 index 2d7253dc..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVConservativeRasterPreSnapTriangles.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glConservativeRasterParameteriNVPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVConservativeRasterPreSnapTriangles_glConservativeRasterParameteriNV(JNIEnv *__env, jclass clazz, jint pname, jint param) { - glConservativeRasterParameteriNVPROC glConservativeRasterParameteriNV = (glConservativeRasterParameteriNVPROC)tlsGetFunction(1949); - UNUSED_PARAM(clazz) - glConservativeRasterParameteriNV(pname, param); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVCopyImage.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVCopyImage.c deleted file mode 100644 index 9e1324e1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVCopyImage.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glCopyImageSubDataNVPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVCopyImage_glCopyImageSubDataNV(JNIEnv *__env, jclass clazz, jint srcName, jint srcTarget, jint srcLevel, jint srcX, jint srcY, jint srcZ, jint dstName, jint dstTarget, jint dstLevel, jint dstX, jint dstY, jint dstZ, jint width, jint height, jint depth) { - glCopyImageSubDataNVPROC glCopyImageSubDataNV = (glCopyImageSubDataNVPROC)tlsGetFunction(1950); - UNUSED_PARAM(clazz) - glCopyImageSubDataNV(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDepthBufferFloat.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDepthBufferFloat.c deleted file mode 100644 index 0bfaca58..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDepthBufferFloat.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDepthRangedNVPROC) (jdouble, jdouble); -typedef void (APIENTRY *glClearDepthdNVPROC) (jdouble); -typedef void (APIENTRY *glDepthBoundsdNVPROC) (jdouble, jdouble); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVDepthBufferFloat_glDepthRangedNV(JNIEnv *__env, jclass clazz, jdouble zNear, jdouble zFar) { - glDepthRangedNVPROC glDepthRangedNV = (glDepthRangedNVPROC)tlsGetFunction(1951); - UNUSED_PARAM(clazz) - glDepthRangedNV(zNear, zFar); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVDepthBufferFloat_glClearDepthdNV(JNIEnv *__env, jclass clazz, jdouble depth) { - glClearDepthdNVPROC glClearDepthdNV = (glClearDepthdNVPROC)tlsGetFunction(1952); - UNUSED_PARAM(clazz) - glClearDepthdNV(depth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVDepthBufferFloat_glDepthBoundsdNV(JNIEnv *__env, jclass clazz, jdouble zmin, jdouble zmax) { - glDepthBoundsdNVPROC glDepthBoundsdNV = (glDepthBoundsdNVPROC)tlsGetFunction(1953); - UNUSED_PARAM(clazz) - glDepthBoundsdNV(zmin, zmax); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDrawTexture.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDrawTexture.c deleted file mode 100644 index 1f8cfa6b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDrawTexture.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDrawTextureNVPROC) (jint, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVDrawTexture_glDrawTextureNV(JNIEnv *__env, jclass clazz, jint texture, jint sampler, jfloat x0, jfloat y0, jfloat x1, jfloat y1, jfloat z, jfloat s0, jfloat t0, jfloat s1, jfloat t1) { - glDrawTextureNVPROC glDrawTextureNV = (glDrawTextureNVPROC)tlsGetFunction(1954); - UNUSED_PARAM(clazz) - glDrawTextureNV(texture, sampler, x0, y0, x1, y1, z, s0, t0, s1, t1); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDrawVulkanImage.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDrawVulkanImage.c deleted file mode 100644 index 4137ff84..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVDrawVulkanImage.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDrawVkImageNVPROC) (jlong, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat); -typedef uintptr_t (APIENTRY *glGetVkProcAddrNVPROC) (uintptr_t); -typedef void (APIENTRY *glWaitVkSemaphoreNVPROC) (jlong); -typedef void (APIENTRY *glSignalVkSemaphoreNVPROC) (jlong); -typedef void (APIENTRY *glSignalVkFenceNVPROC) (jlong); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVDrawVulkanImage_glDrawVkImageNV(JNIEnv *__env, jclass clazz, jlong vkImage, jint sampler, jfloat x0, jfloat y0, jfloat x1, jfloat y1, jfloat z, jfloat s0, jfloat t0, jfloat s1, jfloat t1) { - glDrawVkImageNVPROC glDrawVkImageNV = (glDrawVkImageNVPROC)tlsGetFunction(1955); - UNUSED_PARAM(clazz) - glDrawVkImageNV(vkImage, sampler, x0, y0, x1, y1, z, s0, t0, s1, t1); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_NVDrawVulkanImage_nglGetVkProcAddrNV(JNIEnv *__env, jclass clazz, jlong nameAddress) { - glGetVkProcAddrNVPROC glGetVkProcAddrNV = (glGetVkProcAddrNVPROC)tlsGetFunction(1956); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return (jlong)glGetVkProcAddrNV(name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVDrawVulkanImage_glWaitVkSemaphoreNV(JNIEnv *__env, jclass clazz, jlong vkSemaphore) { - glWaitVkSemaphoreNVPROC glWaitVkSemaphoreNV = (glWaitVkSemaphoreNVPROC)tlsGetFunction(1957); - UNUSED_PARAM(clazz) - glWaitVkSemaphoreNV(vkSemaphore); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVDrawVulkanImage_glSignalVkSemaphoreNV(JNIEnv *__env, jclass clazz, jlong vkSemaphore) { - glSignalVkSemaphoreNVPROC glSignalVkSemaphoreNV = (glSignalVkSemaphoreNVPROC)tlsGetFunction(1958); - UNUSED_PARAM(clazz) - glSignalVkSemaphoreNV(vkSemaphore); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVDrawVulkanImage_glSignalVkFenceNV(JNIEnv *__env, jclass clazz, jlong vkFence) { - glSignalVkFenceNVPROC glSignalVkFenceNV = (glSignalVkFenceNVPROC)tlsGetFunction(1959); - UNUSED_PARAM(clazz) - glSignalVkFenceNV(vkFence); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVExplicitMultisample.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVExplicitMultisample.c deleted file mode 100644 index 2a48db3d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVExplicitMultisample.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetMultisamplefvNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glSampleMaskIndexedNVPROC) (jint, jint); -typedef void (APIENTRY *glTexRenderbufferNVPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVExplicitMultisample_nglGetMultisamplefvNV__IIJ(JNIEnv *__env, jclass clazz, jint pname, jint index, jlong valAddress) { - glGetMultisamplefvNVPROC glGetMultisamplefvNV = (glGetMultisamplefvNVPROC)tlsGetFunction(1960); - uintptr_t val = (uintptr_t)valAddress; - UNUSED_PARAM(clazz) - glGetMultisamplefvNV(pname, index, val); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVExplicitMultisample_glSampleMaskIndexedNV(JNIEnv *__env, jclass clazz, jint index, jint mask) { - glSampleMaskIndexedNVPROC glSampleMaskIndexedNV = (glSampleMaskIndexedNVPROC)tlsGetFunction(1961); - UNUSED_PARAM(clazz) - glSampleMaskIndexedNV(index, mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVExplicitMultisample_glTexRenderbufferNV(JNIEnv *__env, jclass clazz, jint target, jint renderbuffer) { - glTexRenderbufferNVPROC glTexRenderbufferNV = (glTexRenderbufferNVPROC)tlsGetFunction(1962); - UNUSED_PARAM(clazz) - glTexRenderbufferNV(target, renderbuffer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFence.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFence.c deleted file mode 100644 index ab6b1556..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFence.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDeleteFencesNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenFencesNVPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsFenceNVPROC) (jint); -typedef jboolean (APIENTRY *glTestFenceNVPROC) (jint); -typedef void (APIENTRY *glGetFenceivNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glFinishFenceNVPROC) (jint); -typedef void (APIENTRY *glSetFenceNVPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFence_nglDeleteFencesNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong fencesAddress) { - glDeleteFencesNVPROC glDeleteFencesNV = (glDeleteFencesNVPROC)tlsGetFunction(1963); - uintptr_t fences = (uintptr_t)fencesAddress; - UNUSED_PARAM(clazz) - glDeleteFencesNV(n, fences); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFence_nglGenFencesNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong fencesAddress) { - glGenFencesNVPROC glGenFencesNV = (glGenFencesNVPROC)tlsGetFunction(1964); - uintptr_t fences = (uintptr_t)fencesAddress; - UNUSED_PARAM(clazz) - glGenFencesNV(n, fences); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVFence_glIsFenceNV(JNIEnv *__env, jclass clazz, jint fence) { - glIsFenceNVPROC glIsFenceNV = (glIsFenceNVPROC)tlsGetFunction(1965); - UNUSED_PARAM(clazz) - return glIsFenceNV(fence); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVFence_glTestFenceNV(JNIEnv *__env, jclass clazz, jint fence) { - glTestFenceNVPROC glTestFenceNV = (glTestFenceNVPROC)tlsGetFunction(1966); - UNUSED_PARAM(clazz) - return glTestFenceNV(fence); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFence_nglGetFenceivNV__IIJ(JNIEnv *__env, jclass clazz, jint fence, jint pname, jlong paramsAddress) { - glGetFenceivNVPROC glGetFenceivNV = (glGetFenceivNVPROC)tlsGetFunction(1967); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetFenceivNV(fence, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFence_glFinishFenceNV(JNIEnv *__env, jclass clazz, jint fence) { - glFinishFenceNVPROC glFinishFenceNV = (glFinishFenceNVPROC)tlsGetFunction(1968); - UNUSED_PARAM(clazz) - glFinishFenceNV(fence); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFence_glSetFenceNV(JNIEnv *__env, jclass clazz, jint fence, jint condition) { - glSetFenceNVPROC glSetFenceNV = (glSetFenceNVPROC)tlsGetFunction(1969); - UNUSED_PARAM(clazz) - glSetFenceNV(fence, condition); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFragmentCoverageToColor.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFragmentCoverageToColor.c deleted file mode 100644 index 8d998f39..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFragmentCoverageToColor.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFragmentCoverageColorNVPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFragmentCoverageToColor_glFragmentCoverageColorNV(JNIEnv *__env, jclass clazz, jint color) { - glFragmentCoverageColorNVPROC glFragmentCoverageColorNV = (glFragmentCoverageColorNVPROC)tlsGetFunction(1970); - UNUSED_PARAM(clazz) - glFragmentCoverageColorNV(color); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFramebufferMixedSamples.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFramebufferMixedSamples.c deleted file mode 100644 index bcef48a9..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFramebufferMixedSamples.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glCoverageModulationTableNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetCoverageModulationTableNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glCoverageModulationNVPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFramebufferMixedSamples_nglCoverageModulationTableNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong vAddress) { - glCoverageModulationTableNVPROC glCoverageModulationTableNV = (glCoverageModulationTableNVPROC)tlsGetFunction(1971); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glCoverageModulationTableNV(n, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFramebufferMixedSamples_nglGetCoverageModulationTableNV__IJ(JNIEnv *__env, jclass clazz, jint bufsize, jlong vAddress) { - glGetCoverageModulationTableNVPROC glGetCoverageModulationTableNV = (glGetCoverageModulationTableNVPROC)tlsGetFunction(1972); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glGetCoverageModulationTableNV(bufsize, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFramebufferMixedSamples_glCoverageModulationNV(JNIEnv *__env, jclass clazz, jint components) { - glCoverageModulationNVPROC glCoverageModulationNV = (glCoverageModulationNVPROC)tlsGetFunction(1973); - UNUSED_PARAM(clazz) - glCoverageModulationNV(components); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFramebufferMultisampleCoverage.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFramebufferMultisampleCoverage.c deleted file mode 100644 index a8e53ca4..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVFramebufferMultisampleCoverage.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glRenderbufferStorageMultisampleCoverageNVPROC) (jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVFramebufferMultisampleCoverage_glRenderbufferStorageMultisampleCoverageNV(JNIEnv *__env, jclass clazz, jint target, jint coverageSamples, jint colorSamples, jint internalformat, jint width, jint height) { - glRenderbufferStorageMultisampleCoverageNVPROC glRenderbufferStorageMultisampleCoverageNV = (glRenderbufferStorageMultisampleCoverageNVPROC)tlsGetFunction(1974); - UNUSED_PARAM(clazz) - glRenderbufferStorageMultisampleCoverageNV(target, coverageSamples, colorSamples, internalformat, width, height); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVGPUMulticast.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVGPUMulticast.c deleted file mode 100644 index fd892b13..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVGPUMulticast.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glRenderGpuMaskNVPROC) (jint); -typedef void (APIENTRY *glMulticastBufferSubDataNVPROC) (jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glMulticastCopyBufferSubDataNVPROC) (jint, jint, jint, jint, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glMulticastCopyImageSubDataNVPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glMulticastBlitFramebufferNVPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glMulticastFramebufferSampleLocationsfvNVPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMulticastBarrierNVPROC) (void); -typedef void (APIENTRY *glMulticastWaitSyncNVPROC) (jint, jint); -typedef void (APIENTRY *glMulticastGetQueryObjectivNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMulticastGetQueryObjectuivNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMulticastGetQueryObjecti64vNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMulticastGetQueryObjectui64vNVPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_glRenderGpuMaskNV(JNIEnv *__env, jclass clazz, jint mask) { - glRenderGpuMaskNVPROC glRenderGpuMaskNV = (glRenderGpuMaskNVPROC)tlsGetFunction(1975); - UNUSED_PARAM(clazz) - glRenderGpuMaskNV(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_nglMulticastBufferSubDataNV__IIJJJ(JNIEnv *__env, jclass clazz, jint gpuMask, jint buffer, jlong offset, jlong size, jlong dataAddress) { - glMulticastBufferSubDataNVPROC glMulticastBufferSubDataNV = (glMulticastBufferSubDataNVPROC)tlsGetFunction(1976); - uintptr_t data = (uintptr_t)dataAddress; - UNUSED_PARAM(clazz) - glMulticastBufferSubDataNV(gpuMask, buffer, (uintptr_t)offset, (uintptr_t)size, data); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_glMulticastCopyBufferSubDataNV(JNIEnv *__env, jclass clazz, jint readGpu, jint writeGpuMask, jint readBuffer, jint writeBuffer, jlong readOffset, jlong writeOffset, jlong size) { - glMulticastCopyBufferSubDataNVPROC glMulticastCopyBufferSubDataNV = (glMulticastCopyBufferSubDataNVPROC)tlsGetFunction(1977); - UNUSED_PARAM(clazz) - glMulticastCopyBufferSubDataNV(readGpu, writeGpuMask, readBuffer, writeBuffer, (uintptr_t)readOffset, (uintptr_t)writeOffset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_glMulticastCopyImageSubDataNV(JNIEnv *__env, jclass clazz, jint srcGpu, jint dstGpuMask, jint srcName, jint srcTarget, jint srcLevel, jint srcX, jint srxY, jint srcZ, jint dstName, jint dstTarget, jint dstLevel, jint dstX, jint dstY, jint dstZ, jint srcWidth, jint srcHeight, jint srcDepth) { - glMulticastCopyImageSubDataNVPROC glMulticastCopyImageSubDataNV = (glMulticastCopyImageSubDataNVPROC)tlsGetFunction(1978); - UNUSED_PARAM(clazz) - glMulticastCopyImageSubDataNV(srcGpu, dstGpuMask, srcName, srcTarget, srcLevel, srcX, srxY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_glMulticastBlitFramebufferNV(JNIEnv *__env, jclass clazz, jint srcGpu, jint dstGpu, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) { - glMulticastBlitFramebufferNVPROC glMulticastBlitFramebufferNV = (glMulticastBlitFramebufferNVPROC)tlsGetFunction(1979); - UNUSED_PARAM(clazz) - glMulticastBlitFramebufferNV(srcGpu, dstGpu, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_nglMulticastFramebufferSampleLocationsfvNV__IIIIJ(JNIEnv *__env, jclass clazz, jint gpu, jint framebuffer, jint start, jint count, jlong vAddress) { - glMulticastFramebufferSampleLocationsfvNVPROC glMulticastFramebufferSampleLocationsfvNV = (glMulticastFramebufferSampleLocationsfvNVPROC)tlsGetFunction(1980); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMulticastFramebufferSampleLocationsfvNV(gpu, framebuffer, start, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_glMulticastBarrierNV(JNIEnv *__env, jclass clazz) { - glMulticastBarrierNVPROC glMulticastBarrierNV = (glMulticastBarrierNVPROC)tlsGetFunction(1981); - UNUSED_PARAM(clazz) - glMulticastBarrierNV(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_glMulticastWaitSyncNV(JNIEnv *__env, jclass clazz, jint signalGpu, jint waitGpuMask) { - glMulticastWaitSyncNVPROC glMulticastWaitSyncNV = (glMulticastWaitSyncNVPROC)tlsGetFunction(1982); - UNUSED_PARAM(clazz) - glMulticastWaitSyncNV(signalGpu, waitGpuMask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_nglMulticastGetQueryObjectivNV__IIIJ(JNIEnv *__env, jclass clazz, jint gpu, jint id, jint pname, jlong paramsAddress) { - glMulticastGetQueryObjectivNVPROC glMulticastGetQueryObjectivNV = (glMulticastGetQueryObjectivNVPROC)tlsGetFunction(1983); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMulticastGetQueryObjectivNV(gpu, id, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_nglMulticastGetQueryObjectuivNV__IIIJ(JNIEnv *__env, jclass clazz, jint gpu, jint id, jint pname, jlong paramsAddress) { - glMulticastGetQueryObjectuivNVPROC glMulticastGetQueryObjectuivNV = (glMulticastGetQueryObjectuivNVPROC)tlsGetFunction(1984); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMulticastGetQueryObjectuivNV(gpu, id, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_nglMulticastGetQueryObjecti64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint gpu, jint id, jint pname, jlong paramsAddress) { - glMulticastGetQueryObjecti64vNVPROC glMulticastGetQueryObjecti64vNV = (glMulticastGetQueryObjecti64vNVPROC)tlsGetFunction(1985); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMulticastGetQueryObjecti64vNV(gpu, id, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUMulticast_nglMulticastGetQueryObjectui64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint gpu, jint id, jint pname, jlong paramsAddress) { - glMulticastGetQueryObjectui64vNVPROC glMulticastGetQueryObjectui64vNV = (glMulticastGetQueryObjectui64vNVPROC)tlsGetFunction(1986); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glMulticastGetQueryObjectui64vNV(gpu, id, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVGPUShader5.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVGPUShader5.c deleted file mode 100644 index f278b7f8..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVGPUShader5.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glUniform1i64NVPROC) (jint, jlong); -typedef void (APIENTRY *glUniform2i64NVPROC) (jint, jlong, jlong); -typedef void (APIENTRY *glUniform3i64NVPROC) (jint, jlong, jlong, jlong); -typedef void (APIENTRY *glUniform4i64NVPROC) (jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glUniform1i64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2i64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3i64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4i64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform1ui64NVPROC) (jint, jlong); -typedef void (APIENTRY *glUniform2ui64NVPROC) (jint, jlong, jlong); -typedef void (APIENTRY *glUniform3ui64NVPROC) (jint, jlong, jlong, jlong); -typedef void (APIENTRY *glUniform4ui64NVPROC) (jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glUniform1ui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform2ui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform3ui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glUniform4ui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformi64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1i64NVPROC) (jint, jint, jlong); -typedef void (APIENTRY *glProgramUniform2i64NVPROC) (jint, jint, jlong, jlong); -typedef void (APIENTRY *glProgramUniform3i64NVPROC) (jint, jint, jlong, jlong, jlong); -typedef void (APIENTRY *glProgramUniform4i64NVPROC) (jint, jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glProgramUniform1i64vNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2i64vNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3i64vNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4i64vNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform1ui64NVPROC) (jint, jint, jlong); -typedef void (APIENTRY *glProgramUniform2ui64NVPROC) (jint, jint, jlong, jlong); -typedef void (APIENTRY *glProgramUniform3ui64NVPROC) (jint, jint, jlong, jlong, jlong); -typedef void (APIENTRY *glProgramUniform4ui64NVPROC) (jint, jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glProgramUniform1ui64vNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform2ui64vNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform3ui64vNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniform4ui64vNVPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glUniform1i64NV(JNIEnv *__env, jclass clazz, jint location, jlong x) { - glUniform1i64NVPROC glUniform1i64NV = (glUniform1i64NVPROC)tlsGetFunction(1058); - UNUSED_PARAM(clazz) - glUniform1i64NV(location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glUniform2i64NV(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y) { - glUniform2i64NVPROC glUniform2i64NV = (glUniform2i64NVPROC)tlsGetFunction(1059); - UNUSED_PARAM(clazz) - glUniform2i64NV(location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glUniform3i64NV(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y, jlong z) { - glUniform3i64NVPROC glUniform3i64NV = (glUniform3i64NVPROC)tlsGetFunction(1060); - UNUSED_PARAM(clazz) - glUniform3i64NV(location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glUniform4i64NV(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y, jlong z, jlong w) { - glUniform4i64NVPROC glUniform4i64NV = (glUniform4i64NVPROC)tlsGetFunction(1061); - UNUSED_PARAM(clazz) - glUniform4i64NV(location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglUniform1i64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1i64vNVPROC glUniform1i64vNV = (glUniform1i64vNVPROC)tlsGetFunction(1062); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1i64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglUniform2i64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2i64vNVPROC glUniform2i64vNV = (glUniform2i64vNVPROC)tlsGetFunction(1063); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2i64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglUniform3i64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3i64vNVPROC glUniform3i64vNV = (glUniform3i64vNVPROC)tlsGetFunction(1064); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3i64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglUniform4i64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4i64vNVPROC glUniform4i64vNV = (glUniform4i64vNVPROC)tlsGetFunction(1065); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4i64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glUniform1ui64NV(JNIEnv *__env, jclass clazz, jint location, jlong x) { - glUniform1ui64NVPROC glUniform1ui64NV = (glUniform1ui64NVPROC)tlsGetFunction(1066); - UNUSED_PARAM(clazz) - glUniform1ui64NV(location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glUniform2ui64NV(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y) { - glUniform2ui64NVPROC glUniform2ui64NV = (glUniform2ui64NVPROC)tlsGetFunction(1067); - UNUSED_PARAM(clazz) - glUniform2ui64NV(location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glUniform3ui64NV(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y, jlong z) { - glUniform3ui64NVPROC glUniform3ui64NV = (glUniform3ui64NVPROC)tlsGetFunction(1068); - UNUSED_PARAM(clazz) - glUniform3ui64NV(location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glUniform4ui64NV(JNIEnv *__env, jclass clazz, jint location, jlong x, jlong y, jlong z, jlong w) { - glUniform4ui64NVPROC glUniform4ui64NV = (glUniform4ui64NVPROC)tlsGetFunction(1069); - UNUSED_PARAM(clazz) - glUniform4ui64NV(location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglUniform1ui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform1ui64vNVPROC glUniform1ui64vNV = (glUniform1ui64vNVPROC)tlsGetFunction(1070); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform1ui64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglUniform2ui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform2ui64vNVPROC glUniform2ui64vNV = (glUniform2ui64vNVPROC)tlsGetFunction(1071); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform2ui64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglUniform3ui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform3ui64vNVPROC glUniform3ui64vNV = (glUniform3ui64vNVPROC)tlsGetFunction(1072); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform3ui64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglUniform4ui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniform4ui64vNVPROC glUniform4ui64vNV = (glUniform4ui64vNVPROC)tlsGetFunction(1073); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniform4ui64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglGetUniformi64vNV__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformi64vNVPROC glGetUniformi64vNV = (glGetUniformi64vNVPROC)tlsGetFunction(1074); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformi64vNV(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glProgramUniform1i64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x) { - glProgramUniform1i64NVPROC glProgramUniform1i64NV = (glProgramUniform1i64NVPROC)tlsGetFunction(1076); - UNUSED_PARAM(clazz) - glProgramUniform1i64NV(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glProgramUniform2i64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y) { - glProgramUniform2i64NVPROC glProgramUniform2i64NV = (glProgramUniform2i64NVPROC)tlsGetFunction(1077); - UNUSED_PARAM(clazz) - glProgramUniform2i64NV(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glProgramUniform3i64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y, jlong z) { - glProgramUniform3i64NVPROC glProgramUniform3i64NV = (glProgramUniform3i64NVPROC)tlsGetFunction(1078); - UNUSED_PARAM(clazz) - glProgramUniform3i64NV(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glProgramUniform4i64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y, jlong z, jlong w) { - glProgramUniform4i64NVPROC glProgramUniform4i64NV = (glProgramUniform4i64NVPROC)tlsGetFunction(1079); - UNUSED_PARAM(clazz) - glProgramUniform4i64NV(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglProgramUniform1i64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1i64vNVPROC glProgramUniform1i64vNV = (glProgramUniform1i64vNVPROC)tlsGetFunction(1080); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1i64vNV(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglProgramUniform2i64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2i64vNVPROC glProgramUniform2i64vNV = (glProgramUniform2i64vNVPROC)tlsGetFunction(1081); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2i64vNV(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglProgramUniform3i64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3i64vNVPROC glProgramUniform3i64vNV = (glProgramUniform3i64vNVPROC)tlsGetFunction(1082); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3i64vNV(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglProgramUniform4i64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4i64vNVPROC glProgramUniform4i64vNV = (glProgramUniform4i64vNVPROC)tlsGetFunction(1083); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4i64vNV(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glProgramUniform1ui64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x) { - glProgramUniform1ui64NVPROC glProgramUniform1ui64NV = (glProgramUniform1ui64NVPROC)tlsGetFunction(1084); - UNUSED_PARAM(clazz) - glProgramUniform1ui64NV(program, location, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glProgramUniform2ui64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y) { - glProgramUniform2ui64NVPROC glProgramUniform2ui64NV = (glProgramUniform2ui64NVPROC)tlsGetFunction(1085); - UNUSED_PARAM(clazz) - glProgramUniform2ui64NV(program, location, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glProgramUniform3ui64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y, jlong z) { - glProgramUniform3ui64NVPROC glProgramUniform3ui64NV = (glProgramUniform3ui64NVPROC)tlsGetFunction(1086); - UNUSED_PARAM(clazz) - glProgramUniform3ui64NV(program, location, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_glProgramUniform4ui64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong x, jlong y, jlong z, jlong w) { - glProgramUniform4ui64NVPROC glProgramUniform4ui64NV = (glProgramUniform4ui64NVPROC)tlsGetFunction(1087); - UNUSED_PARAM(clazz) - glProgramUniform4ui64NV(program, location, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglProgramUniform1ui64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform1ui64vNVPROC glProgramUniform1ui64vNV = (glProgramUniform1ui64vNVPROC)tlsGetFunction(1088); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform1ui64vNV(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglProgramUniform2ui64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform2ui64vNVPROC glProgramUniform2ui64vNV = (glProgramUniform2ui64vNVPROC)tlsGetFunction(1089); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform2ui64vNV(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglProgramUniform3ui64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform3ui64vNVPROC glProgramUniform3ui64vNV = (glProgramUniform3ui64vNVPROC)tlsGetFunction(1090); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform3ui64vNV(program, location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVGPUShader5_nglProgramUniform4ui64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniform4ui64vNVPROC glProgramUniform4ui64vNV = (glProgramUniform4ui64vNVPROC)tlsGetFunction(1091); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniform4ui64vNV(program, location, count, value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVHalfFloat.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVHalfFloat.c deleted file mode 100644 index d62a76dd..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVHalfFloat.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertex2hNVPROC) (jshort, jshort); -typedef void (APIENTRY *glVertex2hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glVertex3hNVPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glVertex3hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glVertex4hNVPROC) (jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glVertex4hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glNormal3hNVPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glNormal3hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glColor3hNVPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glColor3hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glColor4hNVPROC) (jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glColor4hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord1hNVPROC) (jshort); -typedef void (APIENTRY *glTexCoord1hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord2hNVPROC) (jshort, jshort); -typedef void (APIENTRY *glTexCoord2hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord3hNVPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glTexCoord3hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glTexCoord4hNVPROC) (jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glTexCoord4hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glMultiTexCoord1hNVPROC) (jint, jshort); -typedef void (APIENTRY *glMultiTexCoord1hvNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord2hNVPROC) (jint, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord2hvNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord3hNVPROC) (jint, jshort, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord3hvNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMultiTexCoord4hNVPROC) (jint, jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glMultiTexCoord4hvNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glFogCoordhNVPROC) (jshort); -typedef void (APIENTRY *glFogCoordhvNVPROC) (uintptr_t); -typedef void (APIENTRY *glSecondaryColor3hNVPROC) (jshort, jshort, jshort); -typedef void (APIENTRY *glSecondaryColor3hvNVPROC) (uintptr_t); -typedef void (APIENTRY *glVertexWeighthNVPROC) (jshort); -typedef void (APIENTRY *glVertexWeighthvNVPROC) (uintptr_t); -typedef void (APIENTRY *glVertexAttrib1hNVPROC) (jint, jshort); -typedef void (APIENTRY *glVertexAttrib1hvNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib2hNVPROC) (jint, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib2hvNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib3hNVPROC) (jint, jshort, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib3hvNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttrib4hNVPROC) (jint, jshort, jshort, jshort, jshort); -typedef void (APIENTRY *glVertexAttrib4hvNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribs1hvNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribs2hvNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribs3hvNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribs4hvNVPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glVertex2hNV(JNIEnv *__env, jclass clazz, jshort x, jshort y) { - glVertex2hNVPROC glVertex2hNV = (glVertex2hNVPROC)tlsGetFunction(1987); - UNUSED_PARAM(clazz) - glVertex2hNV(x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertex2hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glVertex2hvNVPROC glVertex2hvNV = (glVertex2hvNVPROC)tlsGetFunction(1988); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertex2hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glVertex3hNV(JNIEnv *__env, jclass clazz, jshort x, jshort y, jshort z) { - glVertex3hNVPROC glVertex3hNV = (glVertex3hNVPROC)tlsGetFunction(1989); - UNUSED_PARAM(clazz) - glVertex3hNV(x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertex3hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glVertex3hvNVPROC glVertex3hvNV = (glVertex3hvNVPROC)tlsGetFunction(1990); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertex3hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glVertex4hNV(JNIEnv *__env, jclass clazz, jshort x, jshort y, jshort z, jshort w) { - glVertex4hNVPROC glVertex4hNV = (glVertex4hNVPROC)tlsGetFunction(1991); - UNUSED_PARAM(clazz) - glVertex4hNV(x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertex4hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glVertex4hvNVPROC glVertex4hvNV = (glVertex4hvNVPROC)tlsGetFunction(1992); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertex4hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glNormal3hNV(JNIEnv *__env, jclass clazz, jshort nx, jshort ny, jshort nz) { - glNormal3hNVPROC glNormal3hNV = (glNormal3hNVPROC)tlsGetFunction(1993); - UNUSED_PARAM(clazz) - glNormal3hNV(nx, ny, nz); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglNormal3hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glNormal3hvNVPROC glNormal3hvNV = (glNormal3hvNVPROC)tlsGetFunction(1994); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glNormal3hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glColor3hNV(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue) { - glColor3hNVPROC glColor3hNV = (glColor3hNVPROC)tlsGetFunction(1995); - UNUSED_PARAM(clazz) - glColor3hNV(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglColor3hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor3hvNVPROC glColor3hvNV = (glColor3hvNVPROC)tlsGetFunction(1996); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor3hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glColor4hNV(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue, jshort alpha) { - glColor4hNVPROC glColor4hNV = (glColor4hNVPROC)tlsGetFunction(1997); - UNUSED_PARAM(clazz) - glColor4hNV(red, green, blue, alpha); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglColor4hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glColor4hvNVPROC glColor4hvNV = (glColor4hvNVPROC)tlsGetFunction(1998); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glColor4hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glTexCoord1hNV(JNIEnv *__env, jclass clazz, jshort s) { - glTexCoord1hNVPROC glTexCoord1hNV = (glTexCoord1hNVPROC)tlsGetFunction(1999); - UNUSED_PARAM(clazz) - glTexCoord1hNV(s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglTexCoord1hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord1hvNVPROC glTexCoord1hvNV = (glTexCoord1hvNVPROC)tlsGetFunction(2000); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord1hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glTexCoord2hNV(JNIEnv *__env, jclass clazz, jshort s, jshort t) { - glTexCoord2hNVPROC glTexCoord2hNV = (glTexCoord2hNVPROC)tlsGetFunction(2001); - UNUSED_PARAM(clazz) - glTexCoord2hNV(s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglTexCoord2hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord2hvNVPROC glTexCoord2hvNV = (glTexCoord2hvNVPROC)tlsGetFunction(2002); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord2hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glTexCoord3hNV(JNIEnv *__env, jclass clazz, jshort s, jshort t, jshort r) { - glTexCoord3hNVPROC glTexCoord3hNV = (glTexCoord3hNVPROC)tlsGetFunction(2003); - UNUSED_PARAM(clazz) - glTexCoord3hNV(s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglTexCoord3hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord3hvNVPROC glTexCoord3hvNV = (glTexCoord3hvNVPROC)tlsGetFunction(2004); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord3hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glTexCoord4hNV(JNIEnv *__env, jclass clazz, jshort s, jshort t, jshort r, jshort q) { - glTexCoord4hNVPROC glTexCoord4hNV = (glTexCoord4hNVPROC)tlsGetFunction(2005); - UNUSED_PARAM(clazz) - glTexCoord4hNV(s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglTexCoord4hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glTexCoord4hvNVPROC glTexCoord4hvNV = (glTexCoord4hvNVPROC)tlsGetFunction(2006); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glTexCoord4hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glMultiTexCoord1hNV(JNIEnv *__env, jclass clazz, jint target, jshort s) { - glMultiTexCoord1hNVPROC glMultiTexCoord1hNV = (glMultiTexCoord1hNVPROC)tlsGetFunction(2007); - UNUSED_PARAM(clazz) - glMultiTexCoord1hNV(target, s); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglMultiTexCoord1hvNV__IJ(JNIEnv *__env, jclass clazz, jint target, jlong vAddress) { - glMultiTexCoord1hvNVPROC glMultiTexCoord1hvNV = (glMultiTexCoord1hvNVPROC)tlsGetFunction(2008); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord1hvNV(target, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glMultiTexCoord2hNV(JNIEnv *__env, jclass clazz, jint target, jshort s, jshort t) { - glMultiTexCoord2hNVPROC glMultiTexCoord2hNV = (glMultiTexCoord2hNVPROC)tlsGetFunction(2009); - UNUSED_PARAM(clazz) - glMultiTexCoord2hNV(target, s, t); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglMultiTexCoord2hvNV__IJ(JNIEnv *__env, jclass clazz, jint target, jlong vAddress) { - glMultiTexCoord2hvNVPROC glMultiTexCoord2hvNV = (glMultiTexCoord2hvNVPROC)tlsGetFunction(2010); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord2hvNV(target, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glMultiTexCoord3hNV(JNIEnv *__env, jclass clazz, jint target, jshort s, jshort t, jshort r) { - glMultiTexCoord3hNVPROC glMultiTexCoord3hNV = (glMultiTexCoord3hNVPROC)tlsGetFunction(2011); - UNUSED_PARAM(clazz) - glMultiTexCoord3hNV(target, s, t, r); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglMultiTexCoord3hvNV__IJ(JNIEnv *__env, jclass clazz, jint target, jlong vAddress) { - glMultiTexCoord3hvNVPROC glMultiTexCoord3hvNV = (glMultiTexCoord3hvNVPROC)tlsGetFunction(2012); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord3hvNV(target, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glMultiTexCoord4hNV(JNIEnv *__env, jclass clazz, jint target, jshort s, jshort t, jshort r, jshort q) { - glMultiTexCoord4hNVPROC glMultiTexCoord4hNV = (glMultiTexCoord4hNVPROC)tlsGetFunction(2013); - UNUSED_PARAM(clazz) - glMultiTexCoord4hNV(target, s, t, r, q); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglMultiTexCoord4hvNV__IJ(JNIEnv *__env, jclass clazz, jint target, jlong vAddress) { - glMultiTexCoord4hvNVPROC glMultiTexCoord4hvNV = (glMultiTexCoord4hvNVPROC)tlsGetFunction(2014); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMultiTexCoord4hvNV(target, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glFogCoordhNV(JNIEnv *__env, jclass clazz, jshort fog) { - glFogCoordhNVPROC glFogCoordhNV = (glFogCoordhNVPROC)tlsGetFunction(2015); - UNUSED_PARAM(clazz) - glFogCoordhNV(fog); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglFogCoordhvNV__J(JNIEnv *__env, jclass clazz, jlong fogAddress) { - glFogCoordhvNVPROC glFogCoordhvNV = (glFogCoordhvNVPROC)tlsGetFunction(2016); - uintptr_t fog = (uintptr_t)fogAddress; - UNUSED_PARAM(clazz) - glFogCoordhvNV(fog); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glSecondaryColor3hNV(JNIEnv *__env, jclass clazz, jshort red, jshort green, jshort blue) { - glSecondaryColor3hNVPROC glSecondaryColor3hNV = (glSecondaryColor3hNVPROC)tlsGetFunction(2017); - UNUSED_PARAM(clazz) - glSecondaryColor3hNV(red, green, blue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglSecondaryColor3hvNV__J(JNIEnv *__env, jclass clazz, jlong vAddress) { - glSecondaryColor3hvNVPROC glSecondaryColor3hvNV = (glSecondaryColor3hvNVPROC)tlsGetFunction(2018); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glSecondaryColor3hvNV(v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glVertexWeighthNV(JNIEnv *__env, jclass clazz, jshort weight) { - glVertexWeighthNVPROC glVertexWeighthNV = (glVertexWeighthNVPROC)tlsGetFunction(2019); - UNUSED_PARAM(clazz) - glVertexWeighthNV(weight); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexWeighthvNV__J(JNIEnv *__env, jclass clazz, jlong weightAddress) { - glVertexWeighthvNVPROC glVertexWeighthvNV = (glVertexWeighthvNVPROC)tlsGetFunction(2020); - uintptr_t weight = (uintptr_t)weightAddress; - UNUSED_PARAM(clazz) - glVertexWeighthvNV(weight); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glVertexAttrib1hNV(JNIEnv *__env, jclass clazz, jint index, jshort x) { - glVertexAttrib1hNVPROC glVertexAttrib1hNV = (glVertexAttrib1hNVPROC)tlsGetFunction(2021); - UNUSED_PARAM(clazz) - glVertexAttrib1hNV(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexAttrib1hvNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib1hvNVPROC glVertexAttrib1hvNV = (glVertexAttrib1hvNVPROC)tlsGetFunction(2022); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib1hvNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glVertexAttrib2hNV(JNIEnv *__env, jclass clazz, jint index, jshort x, jshort y) { - glVertexAttrib2hNVPROC glVertexAttrib2hNV = (glVertexAttrib2hNVPROC)tlsGetFunction(2023); - UNUSED_PARAM(clazz) - glVertexAttrib2hNV(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexAttrib2hvNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib2hvNVPROC glVertexAttrib2hvNV = (glVertexAttrib2hvNVPROC)tlsGetFunction(2024); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib2hvNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glVertexAttrib3hNV(JNIEnv *__env, jclass clazz, jint index, jshort x, jshort y, jshort z) { - glVertexAttrib3hNVPROC glVertexAttrib3hNV = (glVertexAttrib3hNVPROC)tlsGetFunction(2025); - UNUSED_PARAM(clazz) - glVertexAttrib3hNV(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexAttrib3hvNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib3hvNVPROC glVertexAttrib3hvNV = (glVertexAttrib3hvNVPROC)tlsGetFunction(2026); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib3hvNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_glVertexAttrib4hNV(JNIEnv *__env, jclass clazz, jint index, jshort x, jshort y, jshort z, jshort w) { - glVertexAttrib4hNVPROC glVertexAttrib4hNV = (glVertexAttrib4hNVPROC)tlsGetFunction(2027); - UNUSED_PARAM(clazz) - glVertexAttrib4hNV(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexAttrib4hvNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttrib4hvNVPROC glVertexAttrib4hvNV = (glVertexAttrib4hvNVPROC)tlsGetFunction(2028); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttrib4hvNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexAttribs1hvNV__IIJ(JNIEnv *__env, jclass clazz, jint index, jint n, jlong vAddress) { - glVertexAttribs1hvNVPROC glVertexAttribs1hvNV = (glVertexAttribs1hvNVPROC)tlsGetFunction(2029); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribs1hvNV(index, n, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexAttribs2hvNV__IIJ(JNIEnv *__env, jclass clazz, jint index, jint n, jlong vAddress) { - glVertexAttribs2hvNVPROC glVertexAttribs2hvNV = (glVertexAttribs2hvNVPROC)tlsGetFunction(2030); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribs2hvNV(index, n, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexAttribs3hvNV__IIJ(JNIEnv *__env, jclass clazz, jint index, jint n, jlong vAddress) { - glVertexAttribs3hvNVPROC glVertexAttribs3hvNV = (glVertexAttribs3hvNVPROC)tlsGetFunction(2031); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribs3hvNV(index, n, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVHalfFloat_nglVertexAttribs4hvNV__IIJ(JNIEnv *__env, jclass clazz, jint index, jint n, jlong vAddress) { - glVertexAttribs4hvNVPROC glVertexAttribs4hvNV = (glVertexAttribs4hvNVPROC)tlsGetFunction(2032); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribs4hvNV(index, n, v); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVInternalformatSampleQuery.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVInternalformatSampleQuery.c deleted file mode 100644 index 624e9ca0..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVInternalformatSampleQuery.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetInternalformatSampleivNVPROC) (jint, jint, jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVInternalformatSampleQuery_nglGetInternalformatSampleivNV__IIIIIJ(JNIEnv *__env, jclass clazz, jint target, jint internalformat, jint samples, jint pname, jint bufSize, jlong paramsAddress) { - glGetInternalformatSampleivNVPROC glGetInternalformatSampleivNV = (glGetInternalformatSampleivNVPROC)tlsGetFunction(2033); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetInternalformatSampleivNV(target, internalformat, samples, pname, bufSize, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMemoryAttachment.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMemoryAttachment.c deleted file mode 100644 index 8ab55f3a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMemoryAttachment.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGetMemoryObjectDetachedResourcesuivNVPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glResetMemoryObjectParameterNVPROC) (jint, jint); -typedef void (APIENTRY *glTexAttachMemoryNVPROC) (jint, jint, jlong); -typedef void (APIENTRY *glBufferAttachMemoryNVPROC) (jint, jint, jlong); -typedef void (APIENTRY *glTextureAttachMemoryNVPROC) (jint, jint, jlong); -typedef void (APIENTRY *glNamedBufferAttachMemoryNVPROC) (jint, jint, jlong); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryAttachment_nglGetMemoryObjectDetachedResourcesuivNV__IIIIJ(JNIEnv *__env, jclass clazz, jint memory, jint pname, jint first, jint count, jlong paramsAddress) { - glGetMemoryObjectDetachedResourcesuivNVPROC glGetMemoryObjectDetachedResourcesuivNV = (glGetMemoryObjectDetachedResourcesuivNVPROC)tlsGetFunction(2034); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetMemoryObjectDetachedResourcesuivNV(memory, pname, first, count, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryAttachment_glResetMemoryObjectParameterNV(JNIEnv *__env, jclass clazz, jint memory, jint pname) { - glResetMemoryObjectParameterNVPROC glResetMemoryObjectParameterNV = (glResetMemoryObjectParameterNVPROC)tlsGetFunction(2035); - UNUSED_PARAM(clazz) - glResetMemoryObjectParameterNV(memory, pname); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryAttachment_glTexAttachMemoryNV(JNIEnv *__env, jclass clazz, jint target, jint memory, jlong offset) { - glTexAttachMemoryNVPROC glTexAttachMemoryNV = (glTexAttachMemoryNVPROC)tlsGetFunction(2036); - UNUSED_PARAM(clazz) - glTexAttachMemoryNV(target, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryAttachment_glBufferAttachMemoryNV(JNIEnv *__env, jclass clazz, jint target, jint memory, jlong offset) { - glBufferAttachMemoryNVPROC glBufferAttachMemoryNV = (glBufferAttachMemoryNVPROC)tlsGetFunction(2037); - UNUSED_PARAM(clazz) - glBufferAttachMemoryNV(target, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryAttachment_glTextureAttachMemoryNV(JNIEnv *__env, jclass clazz, jint texture, jint memory, jlong offset) { - glTextureAttachMemoryNVPROC glTextureAttachMemoryNV = (glTextureAttachMemoryNVPROC)tlsGetFunction(2038); - UNUSED_PARAM(clazz) - glTextureAttachMemoryNV(texture, memory, offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryAttachment_glNamedBufferAttachMemoryNV(JNIEnv *__env, jclass clazz, jint buffer, jint memory, jlong offset) { - glNamedBufferAttachMemoryNVPROC glNamedBufferAttachMemoryNV = (glNamedBufferAttachMemoryNVPROC)tlsGetFunction(2039); - UNUSED_PARAM(clazz) - glNamedBufferAttachMemoryNV(buffer, memory, offset); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMemoryObjectSparse.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMemoryObjectSparse.c deleted file mode 100644 index b2a354e1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMemoryObjectSparse.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBufferPageCommitmentMemNVPROC) (jint, uintptr_t, uintptr_t, jint, jlong, jboolean); -typedef void (APIENTRY *glNamedBufferPageCommitmentMemNVPROC) (jint, uintptr_t, uintptr_t, jint, jlong, jboolean); -typedef void (APIENTRY *glTexPageCommitmentMemNVPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jlong, jboolean); -typedef void (APIENTRY *glTexturePageCommitmentMemNVPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jlong, jboolean); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryObjectSparse_glBufferPageCommitmentMemNV(JNIEnv *__env, jclass clazz, jint target, jlong offset, jlong size, jint memory, jlong memOffset, jboolean commit) { - glBufferPageCommitmentMemNVPROC glBufferPageCommitmentMemNV = (glBufferPageCommitmentMemNVPROC)tlsGetFunction(2040); - UNUSED_PARAM(clazz) - glBufferPageCommitmentMemNV(target, (uintptr_t)offset, (uintptr_t)size, memory, memOffset, commit); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryObjectSparse_glNamedBufferPageCommitmentMemNV(JNIEnv *__env, jclass clazz, jint buffer, jlong offset, jlong size, jint memory, jlong memOffset, jboolean commit) { - glNamedBufferPageCommitmentMemNVPROC glNamedBufferPageCommitmentMemNV = (glNamedBufferPageCommitmentMemNVPROC)tlsGetFunction(2041); - UNUSED_PARAM(clazz) - glNamedBufferPageCommitmentMemNV(buffer, (uintptr_t)offset, (uintptr_t)size, memory, memOffset, commit); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryObjectSparse_glTexPageCommitmentMemNV(JNIEnv *__env, jclass clazz, jint target, jint layer, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint memory, jlong offset, jboolean commit) { - glTexPageCommitmentMemNVPROC glTexPageCommitmentMemNV = (glTexPageCommitmentMemNVPROC)tlsGetFunction(2042); - UNUSED_PARAM(clazz) - glTexPageCommitmentMemNV(target, layer, level, xoffset, yoffset, zoffset, width, height, depth, memory, offset, commit); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMemoryObjectSparse_glTexturePageCommitmentMemNV(JNIEnv *__env, jclass clazz, jint texture, jint layer, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint memory, jlong offset, jboolean commit) { - glTexturePageCommitmentMemNVPROC glTexturePageCommitmentMemNV = (glTexturePageCommitmentMemNVPROC)tlsGetFunction(2043); - UNUSED_PARAM(clazz) - glTexturePageCommitmentMemNV(texture, layer, level, xoffset, yoffset, zoffset, width, height, depth, memory, offset, commit); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMeshShader.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMeshShader.c deleted file mode 100644 index 34108806..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVMeshShader.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glDrawMeshTasksNVPROC) (jint, jint); -typedef void (APIENTRY *glDrawMeshTasksIndirectNVPROC) (uintptr_t); -typedef void (APIENTRY *glMultiDrawMeshTasksIndirectNVPROC) (uintptr_t, jint, jint); -typedef void (APIENTRY *glMultiDrawMeshTasksIndirectCountNVPROC) (uintptr_t, uintptr_t, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMeshShader_glDrawMeshTasksNV(JNIEnv *__env, jclass clazz, jint first, jint count) { - glDrawMeshTasksNVPROC glDrawMeshTasksNV = (glDrawMeshTasksNVPROC)tlsGetFunction(2044); - UNUSED_PARAM(clazz) - glDrawMeshTasksNV(first, count); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMeshShader_glDrawMeshTasksIndirectNV(JNIEnv *__env, jclass clazz, jlong indirect) { - glDrawMeshTasksIndirectNVPROC glDrawMeshTasksIndirectNV = (glDrawMeshTasksIndirectNVPROC)tlsGetFunction(2045); - UNUSED_PARAM(clazz) - glDrawMeshTasksIndirectNV((uintptr_t)indirect); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMeshShader_glMultiDrawMeshTasksIndirectNV(JNIEnv *__env, jclass clazz, jlong indirect, jint drawcount, jint stride) { - glMultiDrawMeshTasksIndirectNVPROC glMultiDrawMeshTasksIndirectNV = (glMultiDrawMeshTasksIndirectNVPROC)tlsGetFunction(2046); - UNUSED_PARAM(clazz) - glMultiDrawMeshTasksIndirectNV((uintptr_t)indirect, drawcount, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVMeshShader_glMultiDrawMeshTasksIndirectCountNV(JNIEnv *__env, jclass clazz, jlong indirect, jlong drawcount, jint maxdrawcount, jint stride) { - glMultiDrawMeshTasksIndirectCountNVPROC glMultiDrawMeshTasksIndirectCountNV = (glMultiDrawMeshTasksIndirectCountNVPROC)tlsGetFunction(2047); - UNUSED_PARAM(clazz) - glMultiDrawMeshTasksIndirectCountNV((uintptr_t)indirect, (uintptr_t)drawcount, maxdrawcount, stride); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPathRendering.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPathRendering.c deleted file mode 100644 index 9d10ce01..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPathRendering.c +++ /dev/null @@ -1,522 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glPathCommandsNVPROC) (jint, jint, uintptr_t, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathCoordsNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathSubCommandsNVPROC) (jint, jint, jint, jint, uintptr_t, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathSubCoordsNVPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathStringNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathGlyphsNVPROC) (jint, jint, uintptr_t, jint, jint, jint, uintptr_t, jint, jint, jfloat); -typedef void (APIENTRY *glPathGlyphRangeNVPROC) (jint, jint, uintptr_t, jint, jint, jint, jint, jint, jfloat); -typedef jint (APIENTRY *glPathGlyphIndexArrayNVPROC) (jint, jint, uintptr_t, jint, jint, jint, jint, jfloat); -typedef jint (APIENTRY *glPathMemoryGlyphIndexArrayNVPROC) (jint, jint, uintptr_t, uintptr_t, jint, jint, jint, jint, jfloat); -typedef void (APIENTRY *glCopyPathNVPROC) (jint, jint); -typedef void (APIENTRY *glWeightPathsNVPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glInterpolatePathsNVPROC) (jint, jint, jint, jfloat); -typedef void (APIENTRY *glTransformPathNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathParameterivNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glPathParameteriNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glPathParameterfvNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glPathParameterfNVPROC) (jint, jint, jfloat); -typedef void (APIENTRY *glPathDashArrayNVPROC) (jint, jint, uintptr_t); -typedef jint (APIENTRY *glGenPathsNVPROC) (jint); -typedef void (APIENTRY *glDeletePathsNVPROC) (jint, jint); -typedef jboolean (APIENTRY *glIsPathNVPROC) (jint); -typedef void (APIENTRY *glPathStencilFuncNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glPathStencilDepthOffsetNVPROC) (jfloat, jfloat); -typedef void (APIENTRY *glStencilFillPathNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glStencilStrokePathNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glStencilFillPathInstancedNVPROC) (jint, jint, uintptr_t, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glStencilStrokePathInstancedNVPROC) (jint, jint, uintptr_t, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathCoverDepthFuncNVPROC) (jint); -typedef void (APIENTRY *glPathColorGenNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathTexGenNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glPathFogGenNVPROC) (jint); -typedef void (APIENTRY *glCoverFillPathNVPROC) (jint, jint); -typedef void (APIENTRY *glCoverStrokePathNVPROC) (jint, jint); -typedef void (APIENTRY *glCoverFillPathInstancedNVPROC) (jint, jint, uintptr_t, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glCoverStrokePathInstancedNVPROC) (jint, jint, uintptr_t, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glStencilThenCoverFillPathNVPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glStencilThenCoverStrokePathNVPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glStencilThenCoverFillPathInstancedNVPROC) (jint, jint, uintptr_t, jint, jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glStencilThenCoverStrokePathInstancedNVPROC) (jint, jint, uintptr_t, jint, jint, jint, jint, jint, uintptr_t); -typedef jint (APIENTRY *glPathGlyphIndexRangeNVPROC) (jint, uintptr_t, jint, jint, jfloat, uintptr_t); -typedef void (APIENTRY *glProgramPathFragmentInputGenNVPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPathParameterivNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPathParameterfvNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPathCommandsNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetPathCoordsNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetPathDashArrayNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetPathMetricsNVPROC) (jint, jint, jint, uintptr_t, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPathMetricRangeNVPROC) (jint, jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPathSpacingNVPROC) (jint, jint, jint, uintptr_t, jint, jfloat, jfloat, jint, uintptr_t); -typedef void (APIENTRY *glGetPathColorGenivNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPathColorGenfvNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPathTexGenivNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetPathTexGenfvNVPROC) (jint, jint, uintptr_t); -typedef jboolean (APIENTRY *glIsPointInFillPathNVPROC) (jint, jint, jfloat, jfloat); -typedef jboolean (APIENTRY *glIsPointInStrokePathNVPROC) (jint, jfloat, jfloat); -typedef jfloat (APIENTRY *glGetPathLengthNVPROC) (jint, jint, jint); -typedef jboolean (APIENTRY *glPointAlongPathNVPROC) (jint, jint, jint, jfloat, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glMatrixLoad3x2fNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixLoad3x3fNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixLoadTranspose3x3fNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixMult3x2fNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixMult3x3fNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glMatrixMultTranspose3x3fNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetProgramResourcefvNVPROC) (jint, jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathCommandsNV__IIJIIJ(JNIEnv *__env, jclass clazz, jint path, jint numCommands, jlong commandsAddress, jint numCoords, jint coordType, jlong coordsAddress) { - glPathCommandsNVPROC glPathCommandsNV = (glPathCommandsNVPROC)tlsGetFunction(2048); - uintptr_t commands = (uintptr_t)commandsAddress; - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glPathCommandsNV(path, numCommands, commands, numCoords, coordType, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathCoordsNV__IIIJ(JNIEnv *__env, jclass clazz, jint path, jint numCoords, jint coordType, jlong coordsAddress) { - glPathCoordsNVPROC glPathCoordsNV = (glPathCoordsNVPROC)tlsGetFunction(2049); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glPathCoordsNV(path, numCoords, coordType, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathSubCommandsNV__IIIIJIIJ(JNIEnv *__env, jclass clazz, jint path, jint commandStart, jint commandsToDelete, jint numCommands, jlong commandsAddress, jint numCoords, jint coordType, jlong coordsAddress) { - glPathSubCommandsNVPROC glPathSubCommandsNV = (glPathSubCommandsNVPROC)tlsGetFunction(2050); - uintptr_t commands = (uintptr_t)commandsAddress; - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glPathSubCommandsNV(path, commandStart, commandsToDelete, numCommands, commands, numCoords, coordType, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathSubCoordsNV__IIIIJ(JNIEnv *__env, jclass clazz, jint path, jint coordStart, jint numCoords, jint coordType, jlong coordsAddress) { - glPathSubCoordsNVPROC glPathSubCoordsNV = (glPathSubCoordsNVPROC)tlsGetFunction(2051); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glPathSubCoordsNV(path, coordStart, numCoords, coordType, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathStringNV(JNIEnv *__env, jclass clazz, jint path, jint format, jint length, jlong pathStringAddress) { - glPathStringNVPROC glPathStringNV = (glPathStringNVPROC)tlsGetFunction(2052); - uintptr_t pathString = (uintptr_t)pathStringAddress; - UNUSED_PARAM(clazz) - glPathStringNV(path, format, length, pathString); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathGlyphsNV(JNIEnv *__env, jclass clazz, jint firstPathName, jint fontTarget, jlong fontNameAddress, jint fontStyle, jint numGlyphs, jint type, jlong charcodesAddress, jint handleMissingGlyphs, jint pathParameterTemplate, jfloat emScale) { - glPathGlyphsNVPROC glPathGlyphsNV = (glPathGlyphsNVPROC)tlsGetFunction(2053); - uintptr_t fontName = (uintptr_t)fontNameAddress; - uintptr_t charcodes = (uintptr_t)charcodesAddress; - UNUSED_PARAM(clazz) - glPathGlyphsNV(firstPathName, fontTarget, fontName, fontStyle, numGlyphs, type, charcodes, handleMissingGlyphs, pathParameterTemplate, emScale); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathGlyphRangeNV(JNIEnv *__env, jclass clazz, jint firstPathName, jint fontTarget, jlong fontNameAddress, jint fontStyle, jint firstGlyph, jint numGlyphs, jint handleMissingGlyphs, jint pathParameterTemplate, jfloat emScale) { - glPathGlyphRangeNVPROC glPathGlyphRangeNV = (glPathGlyphRangeNVPROC)tlsGetFunction(2054); - uintptr_t fontName = (uintptr_t)fontNameAddress; - UNUSED_PARAM(clazz) - glPathGlyphRangeNV(firstPathName, fontTarget, fontName, fontStyle, firstGlyph, numGlyphs, handleMissingGlyphs, pathParameterTemplate, emScale); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathGlyphIndexArrayNV(JNIEnv *__env, jclass clazz, jint firstPathName, jint fontTarget, jlong fontNameAddress, jint fontStyle, jint firstGlyphIndex, jint numGlyphs, jint pathParameterTemplate, jfloat emScale) { - glPathGlyphIndexArrayNVPROC glPathGlyphIndexArrayNV = (glPathGlyphIndexArrayNVPROC)tlsGetFunction(2055); - uintptr_t fontName = (uintptr_t)fontNameAddress; - UNUSED_PARAM(clazz) - return glPathGlyphIndexArrayNV(firstPathName, fontTarget, fontName, fontStyle, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathMemoryGlyphIndexArrayNV(JNIEnv *__env, jclass clazz, jint firstPathName, jint fontTarget, jlong fontSize, jlong fontDataAddress, jint faceIndex, jint firstGlyphIndex, jint numGlyphs, jint pathParameterTemplate, jfloat emScale) { - glPathMemoryGlyphIndexArrayNVPROC glPathMemoryGlyphIndexArrayNV = (glPathMemoryGlyphIndexArrayNVPROC)tlsGetFunction(2056); - uintptr_t fontData = (uintptr_t)fontDataAddress; - UNUSED_PARAM(clazz) - return glPathMemoryGlyphIndexArrayNV(firstPathName, fontTarget, (uintptr_t)fontSize, fontData, faceIndex, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glCopyPathNV(JNIEnv *__env, jclass clazz, jint resultPath, jint srcPath) { - glCopyPathNVPROC glCopyPathNV = (glCopyPathNVPROC)tlsGetFunction(2057); - UNUSED_PARAM(clazz) - glCopyPathNV(resultPath, srcPath); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglWeightPathsNV__IIJJ(JNIEnv *__env, jclass clazz, jint resultPath, jint numPaths, jlong pathsAddress, jlong weightsAddress) { - glWeightPathsNVPROC glWeightPathsNV = (glWeightPathsNVPROC)tlsGetFunction(2058); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t weights = (uintptr_t)weightsAddress; - UNUSED_PARAM(clazz) - glWeightPathsNV(resultPath, numPaths, paths, weights); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glInterpolatePathsNV(JNIEnv *__env, jclass clazz, jint resultPath, jint pathA, jint pathB, jfloat weight) { - glInterpolatePathsNVPROC glInterpolatePathsNV = (glInterpolatePathsNVPROC)tlsGetFunction(2059); - UNUSED_PARAM(clazz) - glInterpolatePathsNV(resultPath, pathA, pathB, weight); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglTransformPathNV__IIIJ(JNIEnv *__env, jclass clazz, jint resultPath, jint srcPath, jint transformType, jlong transformValuesAddress) { - glTransformPathNVPROC glTransformPathNV = (glTransformPathNVPROC)tlsGetFunction(2060); - uintptr_t transformValues = (uintptr_t)transformValuesAddress; - UNUSED_PARAM(clazz) - glTransformPathNV(resultPath, srcPath, transformType, transformValues); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathParameterivNV__IIJ(JNIEnv *__env, jclass clazz, jint path, jint pname, jlong valueAddress) { - glPathParameterivNVPROC glPathParameterivNV = (glPathParameterivNVPROC)tlsGetFunction(2061); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glPathParameterivNV(path, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glPathParameteriNV(JNIEnv *__env, jclass clazz, jint path, jint pname, jint value) { - glPathParameteriNVPROC glPathParameteriNV = (glPathParameteriNVPROC)tlsGetFunction(2062); - UNUSED_PARAM(clazz) - glPathParameteriNV(path, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathParameterfvNV__IIJ(JNIEnv *__env, jclass clazz, jint path, jint pname, jlong valueAddress) { - glPathParameterfvNVPROC glPathParameterfvNV = (glPathParameterfvNVPROC)tlsGetFunction(2063); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glPathParameterfvNV(path, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glPathParameterfNV(JNIEnv *__env, jclass clazz, jint path, jint pname, jfloat value) { - glPathParameterfNVPROC glPathParameterfNV = (glPathParameterfNVPROC)tlsGetFunction(2064); - UNUSED_PARAM(clazz) - glPathParameterfNV(path, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathDashArrayNV__IIJ(JNIEnv *__env, jclass clazz, jint path, jint dashCount, jlong dashArrayAddress) { - glPathDashArrayNVPROC glPathDashArrayNV = (glPathDashArrayNVPROC)tlsGetFunction(2065); - uintptr_t dashArray = (uintptr_t)dashArrayAddress; - UNUSED_PARAM(clazz) - glPathDashArrayNV(path, dashCount, dashArray); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVPathRendering_glGenPathsNV(JNIEnv *__env, jclass clazz, jint range) { - glGenPathsNVPROC glGenPathsNV = (glGenPathsNVPROC)tlsGetFunction(2066); - UNUSED_PARAM(clazz) - return glGenPathsNV(range); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glDeletePathsNV(JNIEnv *__env, jclass clazz, jint path, jint range) { - glDeletePathsNVPROC glDeletePathsNV = (glDeletePathsNVPROC)tlsGetFunction(2067); - UNUSED_PARAM(clazz) - glDeletePathsNV(path, range); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPathRendering_glIsPathNV(JNIEnv *__env, jclass clazz, jint path) { - glIsPathNVPROC glIsPathNV = (glIsPathNVPROC)tlsGetFunction(2068); - UNUSED_PARAM(clazz) - return glIsPathNV(path); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glPathStencilFuncNV(JNIEnv *__env, jclass clazz, jint func, jint ref, jint mask) { - glPathStencilFuncNVPROC glPathStencilFuncNV = (glPathStencilFuncNVPROC)tlsGetFunction(2069); - UNUSED_PARAM(clazz) - glPathStencilFuncNV(func, ref, mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glPathStencilDepthOffsetNV(JNIEnv *__env, jclass clazz, jfloat factor, jfloat units) { - glPathStencilDepthOffsetNVPROC glPathStencilDepthOffsetNV = (glPathStencilDepthOffsetNVPROC)tlsGetFunction(2070); - UNUSED_PARAM(clazz) - glPathStencilDepthOffsetNV(factor, units); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glStencilFillPathNV(JNIEnv *__env, jclass clazz, jint path, jint fillMode, jint mask) { - glStencilFillPathNVPROC glStencilFillPathNV = (glStencilFillPathNVPROC)tlsGetFunction(2071); - UNUSED_PARAM(clazz) - glStencilFillPathNV(path, fillMode, mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glStencilStrokePathNV(JNIEnv *__env, jclass clazz, jint path, jint reference, jint mask) { - glStencilStrokePathNVPROC glStencilStrokePathNV = (glStencilStrokePathNVPROC)tlsGetFunction(2072); - UNUSED_PARAM(clazz) - glStencilStrokePathNV(path, reference, mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglStencilFillPathInstancedNV__IIJIIIIJ(JNIEnv *__env, jclass clazz, jint numPaths, jint pathNameType, jlong pathsAddress, jint pathBase, jint fillMode, jint mask, jint transformType, jlong transformValuesAddress) { - glStencilFillPathInstancedNVPROC glStencilFillPathInstancedNV = (glStencilFillPathInstancedNVPROC)tlsGetFunction(2073); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t transformValues = (uintptr_t)transformValuesAddress; - UNUSED_PARAM(clazz) - glStencilFillPathInstancedNV(numPaths, pathNameType, paths, pathBase, fillMode, mask, transformType, transformValues); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglStencilStrokePathInstancedNV__IIJIIIIJ(JNIEnv *__env, jclass clazz, jint numPaths, jint pathNameType, jlong pathsAddress, jint pathBase, jint reference, jint mask, jint transformType, jlong transformValuesAddress) { - glStencilStrokePathInstancedNVPROC glStencilStrokePathInstancedNV = (glStencilStrokePathInstancedNVPROC)tlsGetFunction(2074); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t transformValues = (uintptr_t)transformValuesAddress; - UNUSED_PARAM(clazz) - glStencilStrokePathInstancedNV(numPaths, pathNameType, paths, pathBase, reference, mask, transformType, transformValues); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glPathCoverDepthFuncNV(JNIEnv *__env, jclass clazz, jint zfunc) { - glPathCoverDepthFuncNVPROC glPathCoverDepthFuncNV = (glPathCoverDepthFuncNVPROC)tlsGetFunction(2075); - UNUSED_PARAM(clazz) - glPathCoverDepthFuncNV(zfunc); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathColorGenNV__IIIJ(JNIEnv *__env, jclass clazz, jint color, jint genMode, jint colorFormat, jlong coeffsAddress) { - glPathColorGenNVPROC glPathColorGenNV = (glPathColorGenNVPROC)tlsGetFunction(2076); - uintptr_t coeffs = (uintptr_t)coeffsAddress; - UNUSED_PARAM(clazz) - glPathColorGenNV(color, genMode, colorFormat, coeffs); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathTexGenNV__IIIJ(JNIEnv *__env, jclass clazz, jint texCoordSet, jint genMode, jint components, jlong coeffsAddress) { - glPathTexGenNVPROC glPathTexGenNV = (glPathTexGenNVPROC)tlsGetFunction(2077); - uintptr_t coeffs = (uintptr_t)coeffsAddress; - UNUSED_PARAM(clazz) - glPathTexGenNV(texCoordSet, genMode, components, coeffs); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glPathFogGenNV(JNIEnv *__env, jclass clazz, jint genMode) { - glPathFogGenNVPROC glPathFogGenNV = (glPathFogGenNVPROC)tlsGetFunction(2078); - UNUSED_PARAM(clazz) - glPathFogGenNV(genMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glCoverFillPathNV(JNIEnv *__env, jclass clazz, jint path, jint coverMode) { - glCoverFillPathNVPROC glCoverFillPathNV = (glCoverFillPathNVPROC)tlsGetFunction(2079); - UNUSED_PARAM(clazz) - glCoverFillPathNV(path, coverMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glCoverStrokePathNV(JNIEnv *__env, jclass clazz, jint path, jint coverMode) { - glCoverStrokePathNVPROC glCoverStrokePathNV = (glCoverStrokePathNVPROC)tlsGetFunction(2080); - UNUSED_PARAM(clazz) - glCoverStrokePathNV(path, coverMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglCoverFillPathInstancedNV__IIJIIIJ(JNIEnv *__env, jclass clazz, jint numPaths, jint pathNameType, jlong pathsAddress, jint pathBase, jint coverMode, jint transformType, jlong transformValuesAddress) { - glCoverFillPathInstancedNVPROC glCoverFillPathInstancedNV = (glCoverFillPathInstancedNVPROC)tlsGetFunction(2081); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t transformValues = (uintptr_t)transformValuesAddress; - UNUSED_PARAM(clazz) - glCoverFillPathInstancedNV(numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglCoverStrokePathInstancedNV__IIJIIIJ(JNIEnv *__env, jclass clazz, jint numPaths, jint pathNameType, jlong pathsAddress, jint pathBase, jint coverMode, jint transformType, jlong transformValuesAddress) { - glCoverStrokePathInstancedNVPROC glCoverStrokePathInstancedNV = (glCoverStrokePathInstancedNVPROC)tlsGetFunction(2082); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t transformValues = (uintptr_t)transformValuesAddress; - UNUSED_PARAM(clazz) - glCoverStrokePathInstancedNV(numPaths, pathNameType, paths, pathBase, coverMode, transformType, transformValues); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glStencilThenCoverFillPathNV(JNIEnv *__env, jclass clazz, jint path, jint fillMode, jint mask, jint coverMode) { - glStencilThenCoverFillPathNVPROC glStencilThenCoverFillPathNV = (glStencilThenCoverFillPathNVPROC)tlsGetFunction(2083); - UNUSED_PARAM(clazz) - glStencilThenCoverFillPathNV(path, fillMode, mask, coverMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_glStencilThenCoverStrokePathNV(JNIEnv *__env, jclass clazz, jint path, jint reference, jint mask, jint coverMode) { - glStencilThenCoverStrokePathNVPROC glStencilThenCoverStrokePathNV = (glStencilThenCoverStrokePathNVPROC)tlsGetFunction(2084); - UNUSED_PARAM(clazz) - glStencilThenCoverStrokePathNV(path, reference, mask, coverMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglStencilThenCoverFillPathInstancedNV__IIJIIIIIJ(JNIEnv *__env, jclass clazz, jint numPaths, jint pathNameType, jlong pathsAddress, jint pathBase, jint fillMode, jint mask, jint coverMode, jint transformType, jlong transformValuesAddress) { - glStencilThenCoverFillPathInstancedNVPROC glStencilThenCoverFillPathInstancedNV = (glStencilThenCoverFillPathInstancedNVPROC)tlsGetFunction(2085); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t transformValues = (uintptr_t)transformValuesAddress; - UNUSED_PARAM(clazz) - glStencilThenCoverFillPathInstancedNV(numPaths, pathNameType, paths, pathBase, fillMode, mask, coverMode, transformType, transformValues); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglStencilThenCoverStrokePathInstancedNV__IIJIIIIIJ(JNIEnv *__env, jclass clazz, jint numPaths, jint pathNameType, jlong pathsAddress, jint pathBase, jint reference, jint mask, jint coverMode, jint transformType, jlong transformValuesAddress) { - glStencilThenCoverStrokePathInstancedNVPROC glStencilThenCoverStrokePathInstancedNV = (glStencilThenCoverStrokePathInstancedNVPROC)tlsGetFunction(2086); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t transformValues = (uintptr_t)transformValuesAddress; - UNUSED_PARAM(clazz) - glStencilThenCoverStrokePathInstancedNV(numPaths, pathNameType, paths, pathBase, reference, mask, coverMode, transformType, transformValues); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPathGlyphIndexRangeNV__IJIIFJ(JNIEnv *__env, jclass clazz, jint fontTarget, jlong fontNameAddress, jint fontStyle, jint pathParameterTemplate, jfloat emScale, jlong baseAndCountAddress) { - glPathGlyphIndexRangeNVPROC glPathGlyphIndexRangeNV = (glPathGlyphIndexRangeNVPROC)tlsGetFunction(2087); - uintptr_t fontName = (uintptr_t)fontNameAddress; - uintptr_t baseAndCount = (uintptr_t)baseAndCountAddress; - UNUSED_PARAM(clazz) - return glPathGlyphIndexRangeNV(fontTarget, fontName, fontStyle, pathParameterTemplate, emScale, baseAndCount); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglProgramPathFragmentInputGenNV__IIIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint genMode, jint components, jlong coeffsAddress) { - glProgramPathFragmentInputGenNVPROC glProgramPathFragmentInputGenNV = (glProgramPathFragmentInputGenNVPROC)tlsGetFunction(2088); - uintptr_t coeffs = (uintptr_t)coeffsAddress; - UNUSED_PARAM(clazz) - glProgramPathFragmentInputGenNV(program, location, genMode, components, coeffs); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathParameterivNV__IIJ(JNIEnv *__env, jclass clazz, jint path, jint pname, jlong valueAddress) { - glGetPathParameterivNVPROC glGetPathParameterivNV = (glGetPathParameterivNVPROC)tlsGetFunction(2089); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glGetPathParameterivNV(path, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathParameterfvNV__IIJ(JNIEnv *__env, jclass clazz, jint path, jint pname, jlong valueAddress) { - glGetPathParameterfvNVPROC glGetPathParameterfvNV = (glGetPathParameterfvNVPROC)tlsGetFunction(2090); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glGetPathParameterfvNV(path, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathCommandsNV(JNIEnv *__env, jclass clazz, jint path, jlong commandsAddress) { - glGetPathCommandsNVPROC glGetPathCommandsNV = (glGetPathCommandsNVPROC)tlsGetFunction(2091); - uintptr_t commands = (uintptr_t)commandsAddress; - UNUSED_PARAM(clazz) - glGetPathCommandsNV(path, commands); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathCoordsNV__IJ(JNIEnv *__env, jclass clazz, jint path, jlong coordsAddress) { - glGetPathCoordsNVPROC glGetPathCoordsNV = (glGetPathCoordsNVPROC)tlsGetFunction(2092); - uintptr_t coords = (uintptr_t)coordsAddress; - UNUSED_PARAM(clazz) - glGetPathCoordsNV(path, coords); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathDashArrayNV__IJ(JNIEnv *__env, jclass clazz, jint path, jlong dashArrayAddress) { - glGetPathDashArrayNVPROC glGetPathDashArrayNV = (glGetPathDashArrayNVPROC)tlsGetFunction(2093); - uintptr_t dashArray = (uintptr_t)dashArrayAddress; - UNUSED_PARAM(clazz) - glGetPathDashArrayNV(path, dashArray); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathMetricsNV__IIIJIIJ(JNIEnv *__env, jclass clazz, jint metricQueryMask, jint numPaths, jint pathNameType, jlong pathsAddress, jint pathBase, jint stride, jlong metricsAddress) { - glGetPathMetricsNVPROC glGetPathMetricsNV = (glGetPathMetricsNVPROC)tlsGetFunction(2094); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t metrics = (uintptr_t)metricsAddress; - UNUSED_PARAM(clazz) - glGetPathMetricsNV(metricQueryMask, numPaths, pathNameType, paths, pathBase, stride, metrics); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathMetricRangeNV__IIIIJ(JNIEnv *__env, jclass clazz, jint metricQueryMask, jint firstPathName, jint numPaths, jint stride, jlong metricsAddress) { - glGetPathMetricRangeNVPROC glGetPathMetricRangeNV = (glGetPathMetricRangeNVPROC)tlsGetFunction(2095); - uintptr_t metrics = (uintptr_t)metricsAddress; - UNUSED_PARAM(clazz) - glGetPathMetricRangeNV(metricQueryMask, firstPathName, numPaths, stride, metrics); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathSpacingNV__IIIJIFFIJ(JNIEnv *__env, jclass clazz, jint pathListMode, jint numPaths, jint pathNameType, jlong pathsAddress, jint pathBase, jfloat advanceScale, jfloat kerningScale, jint transformType, jlong returnedSpacingAddress) { - glGetPathSpacingNVPROC glGetPathSpacingNV = (glGetPathSpacingNVPROC)tlsGetFunction(2096); - uintptr_t paths = (uintptr_t)pathsAddress; - uintptr_t returnedSpacing = (uintptr_t)returnedSpacingAddress; - UNUSED_PARAM(clazz) - glGetPathSpacingNV(pathListMode, numPaths, pathNameType, paths, pathBase, advanceScale, kerningScale, transformType, returnedSpacing); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathColorGenivNV__IIJ(JNIEnv *__env, jclass clazz, jint color, jint pname, jlong valueAddress) { - glGetPathColorGenivNVPROC glGetPathColorGenivNV = (glGetPathColorGenivNVPROC)tlsGetFunction(2097); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glGetPathColorGenivNV(color, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathColorGenfvNV__IIJ(JNIEnv *__env, jclass clazz, jint color, jint pname, jlong valueAddress) { - glGetPathColorGenfvNVPROC glGetPathColorGenfvNV = (glGetPathColorGenfvNVPROC)tlsGetFunction(2098); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glGetPathColorGenfvNV(color, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathTexGenivNV__IIJ(JNIEnv *__env, jclass clazz, jint texCoordSet, jint pname, jlong valueAddress) { - glGetPathTexGenivNVPROC glGetPathTexGenivNV = (glGetPathTexGenivNVPROC)tlsGetFunction(2099); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glGetPathTexGenivNV(texCoordSet, pname, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetPathTexGenfvNV__IIJ(JNIEnv *__env, jclass clazz, jint texCoordSet, jint pname, jlong valueAddress) { - glGetPathTexGenfvNVPROC glGetPathTexGenfvNV = (glGetPathTexGenfvNVPROC)tlsGetFunction(2100); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glGetPathTexGenfvNV(texCoordSet, pname, value); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPathRendering_glIsPointInFillPathNV(JNIEnv *__env, jclass clazz, jint path, jint mask, jfloat x, jfloat y) { - glIsPointInFillPathNVPROC glIsPointInFillPathNV = (glIsPointInFillPathNVPROC)tlsGetFunction(2101); - UNUSED_PARAM(clazz) - return glIsPointInFillPathNV(path, mask, x, y); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPathRendering_glIsPointInStrokePathNV(JNIEnv *__env, jclass clazz, jint path, jfloat x, jfloat y) { - glIsPointInStrokePathNVPROC glIsPointInStrokePathNV = (glIsPointInStrokePathNVPROC)tlsGetFunction(2102); - UNUSED_PARAM(clazz) - return glIsPointInStrokePathNV(path, x, y); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_opengl_NVPathRendering_glGetPathLengthNV(JNIEnv *__env, jclass clazz, jint path, jint startSegment, jint numSegments) { - glGetPathLengthNVPROC glGetPathLengthNV = (glGetPathLengthNVPROC)tlsGetFunction(2103); - UNUSED_PARAM(clazz) - return glGetPathLengthNV(path, startSegment, numSegments); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglPointAlongPathNV__IIIFJJJJ(JNIEnv *__env, jclass clazz, jint path, jint startSegment, jint numSegments, jfloat distance, jlong xAddress, jlong yAddress, jlong tangentXAddress, jlong tangentYAddress) { - glPointAlongPathNVPROC glPointAlongPathNV = (glPointAlongPathNVPROC)tlsGetFunction(2104); - uintptr_t x = (uintptr_t)xAddress; - uintptr_t y = (uintptr_t)yAddress; - uintptr_t tangentX = (uintptr_t)tangentXAddress; - uintptr_t tangentY = (uintptr_t)tangentYAddress; - UNUSED_PARAM(clazz) - return glPointAlongPathNV(path, startSegment, numSegments, distance, x, y, tangentX, tangentY); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglMatrixLoad3x2fNV__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixLoad3x2fNVPROC glMatrixLoad3x2fNV = (glMatrixLoad3x2fNVPROC)tlsGetFunction(2105); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixLoad3x2fNV(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglMatrixLoad3x3fNV__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixLoad3x3fNVPROC glMatrixLoad3x3fNV = (glMatrixLoad3x3fNVPROC)tlsGetFunction(2106); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixLoad3x3fNV(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglMatrixLoadTranspose3x3fNV__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixLoadTranspose3x3fNVPROC glMatrixLoadTranspose3x3fNV = (glMatrixLoadTranspose3x3fNVPROC)tlsGetFunction(2107); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixLoadTranspose3x3fNV(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglMatrixMult3x2fNV__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixMult3x2fNVPROC glMatrixMult3x2fNV = (glMatrixMult3x2fNVPROC)tlsGetFunction(2108); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixMult3x2fNV(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglMatrixMult3x3fNV__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixMult3x3fNVPROC glMatrixMult3x3fNV = (glMatrixMult3x3fNVPROC)tlsGetFunction(2109); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixMult3x3fNV(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglMatrixMultTranspose3x3fNV__IJ(JNIEnv *__env, jclass clazz, jint matrixMode, jlong mAddress) { - glMatrixMultTranspose3x3fNVPROC glMatrixMultTranspose3x3fNV = (glMatrixMultTranspose3x3fNVPROC)tlsGetFunction(2110); - uintptr_t m = (uintptr_t)mAddress; - UNUSED_PARAM(clazz) - glMatrixMultTranspose3x3fNV(matrixMode, m); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPathRendering_nglGetProgramResourcefvNV__IIIIJIJJ(JNIEnv *__env, jclass clazz, jint program, jint programInterface, jint index, jint propCount, jlong propsAddress, jint bufSize, jlong lengthAddress, jlong paramsAddress) { - glGetProgramResourcefvNVPROC glGetProgramResourcefvNV = (glGetProgramResourcefvNVPROC)tlsGetFunction(2111); - uintptr_t props = (uintptr_t)propsAddress; - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetProgramResourcefvNV(program, programInterface, index, propCount, props, bufSize, length, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPixelDataRange.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPixelDataRange.c deleted file mode 100644 index 55fced18..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPixelDataRange.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glPixelDataRangeNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glFlushPixelDataRangeNVPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPixelDataRange_nglPixelDataRangeNV(JNIEnv *__env, jclass clazz, jint target, jint length, jlong pointerAddress) { - glPixelDataRangeNVPROC glPixelDataRangeNV = (glPixelDataRangeNVPROC)tlsGetFunction(2112); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glPixelDataRangeNV(target, length, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPixelDataRange_glFlushPixelDataRangeNV(JNIEnv *__env, jclass clazz, jint target) { - glFlushPixelDataRangeNVPROC glFlushPixelDataRangeNV = (glFlushPixelDataRangeNVPROC)tlsGetFunction(2113); - UNUSED_PARAM(clazz) - glFlushPixelDataRangeNV(target); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPointSprite.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPointSprite.c deleted file mode 100644 index 877e4ec3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPointSprite.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glPointParameteriNVPROC) (jint, jint); -typedef void (APIENTRY *glPointParameterivNVPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPointSprite_glPointParameteriNV(JNIEnv *__env, jclass clazz, jint pname, jint param) { - glPointParameteriNVPROC glPointParameteriNV = (glPointParameteriNVPROC)tlsGetFunction(2114); - UNUSED_PARAM(clazz) - glPointParameteriNV(pname, param); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPointSprite_nglPointParameterivNV__IJ(JNIEnv *__env, jclass clazz, jint pname, jlong paramsAddress) { - glPointParameterivNVPROC glPointParameterivNV = (glPointParameterivNVPROC)tlsGetFunction(2115); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glPointParameterivNV(pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPrimitiveRestart.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPrimitiveRestart.c deleted file mode 100644 index 14458431..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVPrimitiveRestart.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glPrimitiveRestartNVPROC) (void); -typedef void (APIENTRY *glPrimitiveRestartIndexNVPROC) (jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPrimitiveRestart_glPrimitiveRestartNV(JNIEnv *__env, jclass clazz) { - glPrimitiveRestartNVPROC glPrimitiveRestartNV = (glPrimitiveRestartNVPROC)tlsGetFunction(2116); - UNUSED_PARAM(clazz) - glPrimitiveRestartNV(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVPrimitiveRestart_glPrimitiveRestartIndexNV(JNIEnv *__env, jclass clazz, jint index) { - glPrimitiveRestartIndexNVPROC glPrimitiveRestartIndexNV = (glPrimitiveRestartIndexNVPROC)tlsGetFunction(2117); - UNUSED_PARAM(clazz) - glPrimitiveRestartIndexNV(index); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVQueryResource.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVQueryResource.c deleted file mode 100644 index 6428efe5..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVQueryResource.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jint (APIENTRY *glQueryResourceNVPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVQueryResource_nglQueryResourceNV__IIIJ(JNIEnv *__env, jclass clazz, jint queryType, jint pname, jint bufSize, jlong bufferAddress) { - glQueryResourceNVPROC glQueryResourceNV = (glQueryResourceNVPROC)tlsGetFunction(2118); - uintptr_t buffer = (uintptr_t)bufferAddress; - UNUSED_PARAM(clazz) - return glQueryResourceNV(queryType, pname, bufSize, buffer); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVQueryResourceTag.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVQueryResourceTag.c deleted file mode 100644 index a8100a5d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVQueryResourceTag.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glGenQueryResourceTagNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glDeleteQueryResourceTagNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glQueryResourceTagNVPROC) (jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVQueryResourceTag_nglGenQueryResourceTagNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong tagIdsAddress) { - glGenQueryResourceTagNVPROC glGenQueryResourceTagNV = (glGenQueryResourceTagNVPROC)tlsGetFunction(2119); - uintptr_t tagIds = (uintptr_t)tagIdsAddress; - UNUSED_PARAM(clazz) - glGenQueryResourceTagNV(n, tagIds); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVQueryResourceTag_nglDeleteQueryResourceTagNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong tagIdsAddress) { - glDeleteQueryResourceTagNVPROC glDeleteQueryResourceTagNV = (glDeleteQueryResourceTagNVPROC)tlsGetFunction(2120); - uintptr_t tagIds = (uintptr_t)tagIdsAddress; - UNUSED_PARAM(clazz) - glDeleteQueryResourceTagNV(n, tagIds); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVQueryResourceTag_nglQueryResourceTagNV(JNIEnv *__env, jclass clazz, jint tagId, jlong tagStringAddress) { - glQueryResourceTagNVPROC glQueryResourceTagNV = (glQueryResourceTagNVPROC)tlsGetFunction(2121); - uintptr_t tagString = (uintptr_t)tagStringAddress; - UNUSED_PARAM(clazz) - glQueryResourceTagNV(tagId, tagString); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVSampleLocations.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVSampleLocations.c deleted file mode 100644 index 24a5cb18..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVSampleLocations.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFramebufferSampleLocationsfvNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glNamedFramebufferSampleLocationsfvNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glResolveDepthValuesNVPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVSampleLocations_nglFramebufferSampleLocationsfvNV__IIIJ(JNIEnv *__env, jclass clazz, jint target, jint start, jint count, jlong vAddress) { - glFramebufferSampleLocationsfvNVPROC glFramebufferSampleLocationsfvNV = (glFramebufferSampleLocationsfvNVPROC)tlsGetFunction(2122); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glFramebufferSampleLocationsfvNV(target, start, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVSampleLocations_nglNamedFramebufferSampleLocationsfvNV__IIIJ(JNIEnv *__env, jclass clazz, jint framebuffer, jint start, jint count, jlong vAddress) { - glNamedFramebufferSampleLocationsfvNVPROC glNamedFramebufferSampleLocationsfvNV = (glNamedFramebufferSampleLocationsfvNVPROC)tlsGetFunction(2123); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glNamedFramebufferSampleLocationsfvNV(framebuffer, start, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVSampleLocations_glResolveDepthValuesNV(JNIEnv *__env, jclass clazz) { - glResolveDepthValuesNVPROC glResolveDepthValuesNV = (glResolveDepthValuesNVPROC)tlsGetFunction(2124); - UNUSED_PARAM(clazz) - glResolveDepthValuesNV(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVScissorExclusive.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVScissorExclusive.c deleted file mode 100644 index 0dffad6b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVScissorExclusive.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glScissorExclusiveArrayvNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glScissorExclusiveNVPROC) (jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVScissorExclusive_nglScissorExclusiveArrayvNV__IIJ(JNIEnv *__env, jclass clazz, jint first, jint count, jlong vAddress) { - glScissorExclusiveArrayvNVPROC glScissorExclusiveArrayvNV = (glScissorExclusiveArrayvNVPROC)tlsGetFunction(2125); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glScissorExclusiveArrayvNV(first, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVScissorExclusive_glScissorExclusiveNV(JNIEnv *__env, jclass clazz, jint x, jint y, jint width, jint height) { - glScissorExclusiveNVPROC glScissorExclusiveNV = (glScissorExclusiveNVPROC)tlsGetFunction(2126); - UNUSED_PARAM(clazz) - glScissorExclusiveNV(x, y, width, height); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVShaderBufferLoad.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVShaderBufferLoad.c deleted file mode 100644 index 9d4ed975..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVShaderBufferLoad.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glMakeBufferResidentNVPROC) (jint, jint); -typedef void (APIENTRY *glMakeBufferNonResidentNVPROC) (jint); -typedef jboolean (APIENTRY *glIsBufferResidentNVPROC) (jint); -typedef void (APIENTRY *glMakeNamedBufferResidentNVPROC) (jint, jint); -typedef void (APIENTRY *glMakeNamedBufferNonResidentNVPROC) (jint); -typedef jboolean (APIENTRY *glIsNamedBufferResidentNVPROC) (jint); -typedef void (APIENTRY *glGetBufferParameterui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetNamedBufferParameterui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetIntegerui64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glUniformui64NVPROC) (jint, jlong); -typedef void (APIENTRY *glUniformui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetUniformui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glProgramUniformui64NVPROC) (jint, jint, jlong); -typedef void (APIENTRY *glProgramUniformui64vNVPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_glMakeBufferResidentNV(JNIEnv *__env, jclass clazz, jint target, jint access) { - glMakeBufferResidentNVPROC glMakeBufferResidentNV = (glMakeBufferResidentNVPROC)tlsGetFunction(2127); - UNUSED_PARAM(clazz) - glMakeBufferResidentNV(target, access); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_glMakeBufferNonResidentNV(JNIEnv *__env, jclass clazz, jint target) { - glMakeBufferNonResidentNVPROC glMakeBufferNonResidentNV = (glMakeBufferNonResidentNVPROC)tlsGetFunction(2128); - UNUSED_PARAM(clazz) - glMakeBufferNonResidentNV(target); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_glIsBufferResidentNV(JNIEnv *__env, jclass clazz, jint target) { - glIsBufferResidentNVPROC glIsBufferResidentNV = (glIsBufferResidentNVPROC)tlsGetFunction(2129); - UNUSED_PARAM(clazz) - return glIsBufferResidentNV(target); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_glMakeNamedBufferResidentNV(JNIEnv *__env, jclass clazz, jint buffer, jint access) { - glMakeNamedBufferResidentNVPROC glMakeNamedBufferResidentNV = (glMakeNamedBufferResidentNVPROC)tlsGetFunction(2130); - UNUSED_PARAM(clazz) - glMakeNamedBufferResidentNV(buffer, access); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_glMakeNamedBufferNonResidentNV(JNIEnv *__env, jclass clazz, jint buffer) { - glMakeNamedBufferNonResidentNVPROC glMakeNamedBufferNonResidentNV = (glMakeNamedBufferNonResidentNVPROC)tlsGetFunction(2131); - UNUSED_PARAM(clazz) - glMakeNamedBufferNonResidentNV(buffer); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_glIsNamedBufferResidentNV(JNIEnv *__env, jclass clazz, jint buffer) { - glIsNamedBufferResidentNVPROC glIsNamedBufferResidentNV = (glIsNamedBufferResidentNVPROC)tlsGetFunction(2132); - UNUSED_PARAM(clazz) - return glIsNamedBufferResidentNV(buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_nglGetBufferParameterui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint target, jint pname, jlong paramsAddress) { - glGetBufferParameterui64vNVPROC glGetBufferParameterui64vNV = (glGetBufferParameterui64vNVPROC)tlsGetFunction(2133); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetBufferParameterui64vNV(target, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_nglGetNamedBufferParameterui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint buffer, jint pname, jlong paramsAddress) { - glGetNamedBufferParameterui64vNVPROC glGetNamedBufferParameterui64vNV = (glGetNamedBufferParameterui64vNVPROC)tlsGetFunction(2134); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetNamedBufferParameterui64vNV(buffer, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_nglGetIntegerui64vNV__IJ(JNIEnv *__env, jclass clazz, jint value, jlong resultAddress) { - glGetIntegerui64vNVPROC glGetIntegerui64vNV = (glGetIntegerui64vNVPROC)tlsGetFunction(2135); - uintptr_t result = (uintptr_t)resultAddress; - UNUSED_PARAM(clazz) - glGetIntegerui64vNV(value, result); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_glUniformui64NV(JNIEnv *__env, jclass clazz, jint location, jlong value) { - glUniformui64NVPROC glUniformui64NV = (glUniformui64NVPROC)tlsGetFunction(2136); - UNUSED_PARAM(clazz) - glUniformui64NV(location, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_nglUniformui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint location, jint count, jlong valueAddress) { - glUniformui64vNVPROC glUniformui64vNV = (glUniformui64vNVPROC)tlsGetFunction(2137); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glUniformui64vNV(location, count, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_nglGetUniformui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jlong paramsAddress) { - glGetUniformui64vNVPROC glGetUniformui64vNV = (glGetUniformui64vNVPROC)tlsGetFunction(1075); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetUniformui64vNV(program, location, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_glProgramUniformui64NV(JNIEnv *__env, jclass clazz, jint program, jint location, jlong value) { - glProgramUniformui64NVPROC glProgramUniformui64NV = (glProgramUniformui64NVPROC)tlsGetFunction(2138); - UNUSED_PARAM(clazz) - glProgramUniformui64NV(program, location, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShaderBufferLoad_nglProgramUniformui64vNV__IIIJ(JNIEnv *__env, jclass clazz, jint program, jint location, jint count, jlong valueAddress) { - glProgramUniformui64vNVPROC glProgramUniformui64vNV = (glProgramUniformui64vNVPROC)tlsGetFunction(2139); - uintptr_t value = (uintptr_t)valueAddress; - UNUSED_PARAM(clazz) - glProgramUniformui64vNV(program, location, count, value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVShadingRateImage.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVShadingRateImage.c deleted file mode 100644 index abc136de..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVShadingRateImage.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBindShadingRateImageNVPROC) (jint); -typedef void (APIENTRY *glShadingRateImagePaletteNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glGetShadingRateImagePaletteNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glShadingRateImageBarrierNVPROC) (jboolean); -typedef void (APIENTRY *glShadingRateSampleOrderNVPROC) (jint); -typedef void (APIENTRY *glShadingRateSampleOrderCustomNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetShadingRateSampleLocationivNVPROC) (jint, jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShadingRateImage_glBindShadingRateImageNV(JNIEnv *__env, jclass clazz, jint texture) { - glBindShadingRateImageNVPROC glBindShadingRateImageNV = (glBindShadingRateImageNVPROC)tlsGetFunction(2140); - UNUSED_PARAM(clazz) - glBindShadingRateImageNV(texture); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShadingRateImage_nglShadingRateImagePaletteNV__IIIJ(JNIEnv *__env, jclass clazz, jint viewport, jint first, jint count, jlong ratesAddress) { - glShadingRateImagePaletteNVPROC glShadingRateImagePaletteNV = (glShadingRateImagePaletteNVPROC)tlsGetFunction(2141); - uintptr_t rates = (uintptr_t)ratesAddress; - UNUSED_PARAM(clazz) - glShadingRateImagePaletteNV(viewport, first, count, rates); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShadingRateImage_nglGetShadingRateImagePaletteNV__IIJ(JNIEnv *__env, jclass clazz, jint viewport, jint entry, jlong rateAddress) { - glGetShadingRateImagePaletteNVPROC glGetShadingRateImagePaletteNV = (glGetShadingRateImagePaletteNVPROC)tlsGetFunction(2142); - uintptr_t rate = (uintptr_t)rateAddress; - UNUSED_PARAM(clazz) - glGetShadingRateImagePaletteNV(viewport, entry, rate); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShadingRateImage_glShadingRateImageBarrierNV(JNIEnv *__env, jclass clazz, jboolean synchronize) { - glShadingRateImageBarrierNVPROC glShadingRateImageBarrierNV = (glShadingRateImageBarrierNVPROC)tlsGetFunction(2143); - UNUSED_PARAM(clazz) - glShadingRateImageBarrierNV(synchronize); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShadingRateImage_glShadingRateSampleOrderNV(JNIEnv *__env, jclass clazz, jint order) { - glShadingRateSampleOrderNVPROC glShadingRateSampleOrderNV = (glShadingRateSampleOrderNVPROC)tlsGetFunction(2144); - UNUSED_PARAM(clazz) - glShadingRateSampleOrderNV(order); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShadingRateImage_nglShadingRateSampleOrderCustomNV__IIJ(JNIEnv *__env, jclass clazz, jint rate, jint samples, jlong locationsAddress) { - glShadingRateSampleOrderCustomNVPROC glShadingRateSampleOrderCustomNV = (glShadingRateSampleOrderCustomNVPROC)tlsGetFunction(2145); - uintptr_t locations = (uintptr_t)locationsAddress; - UNUSED_PARAM(clazz) - glShadingRateSampleOrderCustomNV(rate, samples, locations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVShadingRateImage_nglGetShadingRateSampleLocationivNV__IIIJ(JNIEnv *__env, jclass clazz, jint rate, jint samples, jint index, jlong locationAddress) { - glGetShadingRateSampleLocationivNVPROC glGetShadingRateSampleLocationivNV = (glGetShadingRateSampleLocationivNVPROC)tlsGetFunction(2146); - uintptr_t location = (uintptr_t)locationAddress; - UNUSED_PARAM(clazz) - glGetShadingRateSampleLocationivNV(rate, samples, index, location); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTextureBarrier.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTextureBarrier.c deleted file mode 100644 index f0f49b1a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTextureBarrier.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTextureBarrierNVPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTextureBarrier_glTextureBarrierNV(JNIEnv *__env, jclass clazz) { - glTextureBarrierNVPROC glTextureBarrierNV = (glTextureBarrierNVPROC)tlsGetFunction(2147); - UNUSED_PARAM(clazz) - glTextureBarrierNV(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTextureMultisample.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTextureMultisample.c deleted file mode 100644 index a07ccf66..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTextureMultisample.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glTexImage2DMultisampleCoverageNVPROC) (jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTexImage3DMultisampleCoverageNVPROC) (jint, jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTextureImage2DMultisampleNVPROC) (jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTextureImage3DMultisampleNVPROC) (jint, jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTextureImage2DMultisampleCoverageNVPROC) (jint, jint, jint, jint, jint, jint, jint, jboolean); -typedef void (APIENTRY *glTextureImage3DMultisampleCoverageNVPROC) (jint, jint, jint, jint, jint, jint, jint, jint, jboolean); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTextureMultisample_glTexImage2DMultisampleCoverageNV(JNIEnv *__env, jclass clazz, jint target, jint coverageSamples, jint colorSamples, jint internalFormat, jint width, jint height, jboolean fixedSampleLocations) { - glTexImage2DMultisampleCoverageNVPROC glTexImage2DMultisampleCoverageNV = (glTexImage2DMultisampleCoverageNVPROC)tlsGetFunction(2148); - UNUSED_PARAM(clazz) - glTexImage2DMultisampleCoverageNV(target, coverageSamples, colorSamples, internalFormat, width, height, fixedSampleLocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTextureMultisample_glTexImage3DMultisampleCoverageNV(JNIEnv *__env, jclass clazz, jint target, jint coverageSamples, jint colorSamples, jint internalFormat, jint width, jint height, jint depth, jboolean fixedSampleLocations) { - glTexImage3DMultisampleCoverageNVPROC glTexImage3DMultisampleCoverageNV = (glTexImage3DMultisampleCoverageNVPROC)tlsGetFunction(2149); - UNUSED_PARAM(clazz) - glTexImage3DMultisampleCoverageNV(target, coverageSamples, colorSamples, internalFormat, width, height, depth, fixedSampleLocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTextureMultisample_glTextureImage2DMultisampleNV(JNIEnv *__env, jclass clazz, jint texture, jint target, jint samples, jint internalFormat, jint width, jint height, jboolean fixedSampleLocations) { - glTextureImage2DMultisampleNVPROC glTextureImage2DMultisampleNV = (glTextureImage2DMultisampleNVPROC)tlsGetFunction(2150); - UNUSED_PARAM(clazz) - glTextureImage2DMultisampleNV(texture, target, samples, internalFormat, width, height, fixedSampleLocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTextureMultisample_glTextureImage3DMultisampleNV(JNIEnv *__env, jclass clazz, jint texture, jint target, jint samples, jint internalFormat, jint width, jint height, jint depth, jboolean fixedSampleLocations) { - glTextureImage3DMultisampleNVPROC glTextureImage3DMultisampleNV = (glTextureImage3DMultisampleNVPROC)tlsGetFunction(2151); - UNUSED_PARAM(clazz) - glTextureImage3DMultisampleNV(texture, target, samples, internalFormat, width, height, depth, fixedSampleLocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTextureMultisample_glTextureImage2DMultisampleCoverageNV(JNIEnv *__env, jclass clazz, jint texture, jint target, jint coverageSamples, jint colorSamples, jint internalFormat, jint width, jint height, jboolean fixedSampleLocations) { - glTextureImage2DMultisampleCoverageNVPROC glTextureImage2DMultisampleCoverageNV = (glTextureImage2DMultisampleCoverageNVPROC)tlsGetFunction(2152); - UNUSED_PARAM(clazz) - glTextureImage2DMultisampleCoverageNV(texture, target, coverageSamples, colorSamples, internalFormat, width, height, fixedSampleLocations); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTextureMultisample_glTextureImage3DMultisampleCoverageNV(JNIEnv *__env, jclass clazz, jint texture, jint target, jint coverageSamples, jint colorSamples, jint internalFormat, jint width, jint height, jint depth, jboolean fixedSampleLocations) { - glTextureImage3DMultisampleCoverageNVPROC glTextureImage3DMultisampleCoverageNV = (glTextureImage3DMultisampleCoverageNVPROC)tlsGetFunction(2153); - UNUSED_PARAM(clazz) - glTextureImage3DMultisampleCoverageNV(texture, target, coverageSamples, colorSamples, internalFormat, width, height, depth, fixedSampleLocations); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTimelineSemaphore.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTimelineSemaphore.c deleted file mode 100644 index 505579ff..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTimelineSemaphore.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glCreateSemaphoresNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glSemaphoreParameterivNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetSemaphoreParameterivNVPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTimelineSemaphore_nglCreateSemaphoresNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong semaphoresAddress) { - glCreateSemaphoresNVPROC glCreateSemaphoresNV = (glCreateSemaphoresNVPROC)tlsGetFunction(2154); - uintptr_t semaphores = (uintptr_t)semaphoresAddress; - UNUSED_PARAM(clazz) - glCreateSemaphoresNV(n, semaphores); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTimelineSemaphore_nglSemaphoreParameterivNV__IIJ(JNIEnv *__env, jclass clazz, jint semaphore, jint pname, jlong paramsAddress) { - glSemaphoreParameterivNVPROC glSemaphoreParameterivNV = (glSemaphoreParameterivNVPROC)tlsGetFunction(2155); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glSemaphoreParameterivNV(semaphore, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTimelineSemaphore_nglGetSemaphoreParameterivNV__IIJ(JNIEnv *__env, jclass clazz, jint semaphore, jint pname, jlong paramsAddress) { - glGetSemaphoreParameterivNVPROC glGetSemaphoreParameterivNV = (glGetSemaphoreParameterivNVPROC)tlsGetFunction(2156); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetSemaphoreParameterivNV(semaphore, pname, params); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTransformFeedback.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTransformFeedback.c deleted file mode 100644 index bd1a1379..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTransformFeedback.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBeginTransformFeedbackNVPROC) (jint); -typedef void (APIENTRY *glEndTransformFeedbackNVPROC) (void); -typedef void (APIENTRY *glTransformFeedbackAttribsNVPROC) (jint, uintptr_t, jint); -typedef void (APIENTRY *glBindBufferRangeNVPROC) (jint, jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glBindBufferOffsetNVPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glBindBufferBaseNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glTransformFeedbackVaryingsNVPROC) (jint, jint, uintptr_t, jint); -typedef void (APIENTRY *glActiveVaryingNVPROC) (jint, uintptr_t); -typedef jint (APIENTRY *glGetVaryingLocationNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetActiveVaryingNVPROC) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t); -typedef void (APIENTRY *glGetTransformFeedbackVaryingNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glTransformFeedbackStreamAttribsNVPROC) (jint, uintptr_t, jint, uintptr_t, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_glBeginTransformFeedbackNV(JNIEnv *__env, jclass clazz, jint primitiveMode) { - glBeginTransformFeedbackNVPROC glBeginTransformFeedbackNV = (glBeginTransformFeedbackNVPROC)tlsGetFunction(2157); - UNUSED_PARAM(clazz) - glBeginTransformFeedbackNV(primitiveMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_glEndTransformFeedbackNV(JNIEnv *__env, jclass clazz) { - glEndTransformFeedbackNVPROC glEndTransformFeedbackNV = (glEndTransformFeedbackNVPROC)tlsGetFunction(2158); - UNUSED_PARAM(clazz) - glEndTransformFeedbackNV(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackAttribsNV__IJI(JNIEnv *__env, jclass clazz, jint count, jlong attribsAddress, jint bufferMode) { - glTransformFeedbackAttribsNVPROC glTransformFeedbackAttribsNV = (glTransformFeedbackAttribsNVPROC)tlsGetFunction(2159); - uintptr_t attribs = (uintptr_t)attribsAddress; - UNUSED_PARAM(clazz) - glTransformFeedbackAttribsNV(count, attribs, bufferMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_glBindBufferRangeNV(JNIEnv *__env, jclass clazz, jint target, jint index, jint buffer, jlong offset, jlong size) { - glBindBufferRangeNVPROC glBindBufferRangeNV = (glBindBufferRangeNVPROC)tlsGetFunction(2160); - UNUSED_PARAM(clazz) - glBindBufferRangeNV(target, index, buffer, (uintptr_t)offset, (uintptr_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_glBindBufferOffsetNV(JNIEnv *__env, jclass clazz, jint target, jint index, jint buffer, jlong offset) { - glBindBufferOffsetNVPROC glBindBufferOffsetNV = (glBindBufferOffsetNVPROC)tlsGetFunction(2161); - UNUSED_PARAM(clazz) - glBindBufferOffsetNV(target, index, buffer, (uintptr_t)offset); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_glBindBufferBaseNV(JNIEnv *__env, jclass clazz, jint target, jint index, jint buffer) { - glBindBufferBaseNVPROC glBindBufferBaseNV = (glBindBufferBaseNVPROC)tlsGetFunction(2162); - UNUSED_PARAM(clazz) - glBindBufferBaseNV(target, index, buffer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackVaryingsNV__IIJI(JNIEnv *__env, jclass clazz, jint program, jint count, jlong locationsAddress, jint bufferMode) { - glTransformFeedbackVaryingsNVPROC glTransformFeedbackVaryingsNV = (glTransformFeedbackVaryingsNVPROC)tlsGetFunction(2163); - uintptr_t locations = (uintptr_t)locationsAddress; - UNUSED_PARAM(clazz) - glTransformFeedbackVaryingsNV(program, count, locations, bufferMode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglActiveVaryingNV(JNIEnv *__env, jclass clazz, jint program, jlong nameAddress) { - glActiveVaryingNVPROC glActiveVaryingNV = (glActiveVaryingNVPROC)tlsGetFunction(2164); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glActiveVaryingNV(program, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetVaryingLocationNV(JNIEnv *__env, jclass clazz, jint program, jlong nameAddress) { - glGetVaryingLocationNVPROC glGetVaryingLocationNV = (glGetVaryingLocationNVPROC)tlsGetFunction(2165); - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - return glGetVaryingLocationNV(program, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetActiveVaryingNV__IIIJJJJ(JNIEnv *__env, jclass clazz, jint program, jint index, jint bufSize, jlong lengthAddress, jlong sizeAddress, jlong typeAddress, jlong nameAddress) { - glGetActiveVaryingNVPROC glGetActiveVaryingNV = (glGetActiveVaryingNVPROC)tlsGetFunction(2166); - uintptr_t length = (uintptr_t)lengthAddress; - uintptr_t size = (uintptr_t)sizeAddress; - uintptr_t type = (uintptr_t)typeAddress; - uintptr_t name = (uintptr_t)nameAddress; - UNUSED_PARAM(clazz) - glGetActiveVaryingNV(program, index, bufSize, length, size, type, name); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglGetTransformFeedbackVaryingNV__IIJ(JNIEnv *__env, jclass clazz, jint program, jint index, jlong locationAddress) { - glGetTransformFeedbackVaryingNVPROC glGetTransformFeedbackVaryingNV = (glGetTransformFeedbackVaryingNVPROC)tlsGetFunction(2167); - uintptr_t location = (uintptr_t)locationAddress; - UNUSED_PARAM(clazz) - glGetTransformFeedbackVaryingNV(program, index, location); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback_nglTransformFeedbackStreamAttribsNV__IJIJI(JNIEnv *__env, jclass clazz, jint count, jlong attribsAddress, jint nbuffers, jlong bufstreamsAddress, jint bufferMode) { - glTransformFeedbackStreamAttribsNVPROC glTransformFeedbackStreamAttribsNV = (glTransformFeedbackStreamAttribsNVPROC)tlsGetFunction(2168); - uintptr_t attribs = (uintptr_t)attribsAddress; - uintptr_t bufstreams = (uintptr_t)bufstreamsAddress; - UNUSED_PARAM(clazz) - glTransformFeedbackStreamAttribsNV(count, attribs, nbuffers, bufstreams, bufferMode); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTransformFeedback2.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTransformFeedback2.c deleted file mode 100644 index 666dcfc6..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVTransformFeedback2.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBindTransformFeedbackNVPROC) (jint, jint); -typedef void (APIENTRY *glDeleteTransformFeedbacksNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGenTransformFeedbacksNVPROC) (jint, uintptr_t); -typedef jboolean (APIENTRY *glIsTransformFeedbackNVPROC) (jint); -typedef void (APIENTRY *glPauseTransformFeedbackNVPROC) (void); -typedef void (APIENTRY *glResumeTransformFeedbackNVPROC) (void); -typedef void (APIENTRY *glDrawTransformFeedbackNVPROC) (jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback2_glBindTransformFeedbackNV(JNIEnv *__env, jclass clazz, jint target, jint id) { - glBindTransformFeedbackNVPROC glBindTransformFeedbackNV = (glBindTransformFeedbackNVPROC)tlsGetFunction(2169); - UNUSED_PARAM(clazz) - glBindTransformFeedbackNV(target, id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback2_nglDeleteTransformFeedbacksNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glDeleteTransformFeedbacksNVPROC glDeleteTransformFeedbacksNV = (glDeleteTransformFeedbacksNVPROC)tlsGetFunction(2170); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glDeleteTransformFeedbacksNV(n, ids); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback2_nglGenTransformFeedbacksNV__IJ(JNIEnv *__env, jclass clazz, jint n, jlong idsAddress) { - glGenTransformFeedbacksNVPROC glGenTransformFeedbacksNV = (glGenTransformFeedbacksNVPROC)tlsGetFunction(2171); - uintptr_t ids = (uintptr_t)idsAddress; - UNUSED_PARAM(clazz) - glGenTransformFeedbacksNV(n, ids); -} - -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_NVTransformFeedback2_glIsTransformFeedbackNV(JNIEnv *__env, jclass clazz, jint id) { - glIsTransformFeedbackNVPROC glIsTransformFeedbackNV = (glIsTransformFeedbackNVPROC)tlsGetFunction(2172); - UNUSED_PARAM(clazz) - return glIsTransformFeedbackNV(id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback2_glPauseTransformFeedbackNV(JNIEnv *__env, jclass clazz) { - glPauseTransformFeedbackNVPROC glPauseTransformFeedbackNV = (glPauseTransformFeedbackNVPROC)tlsGetFunction(2173); - UNUSED_PARAM(clazz) - glPauseTransformFeedbackNV(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback2_glResumeTransformFeedbackNV(JNIEnv *__env, jclass clazz) { - glResumeTransformFeedbackNVPROC glResumeTransformFeedbackNV = (glResumeTransformFeedbackNVPROC)tlsGetFunction(2174); - UNUSED_PARAM(clazz) - glResumeTransformFeedbackNV(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVTransformFeedback2_glDrawTransformFeedbackNV(JNIEnv *__env, jclass clazz, jint mode, jint id) { - glDrawTransformFeedbackNVPROC glDrawTransformFeedbackNV = (glDrawTransformFeedbackNVPROC)tlsGetFunction(2175); - UNUSED_PARAM(clazz) - glDrawTransformFeedbackNV(mode, id); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexArrayRange.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexArrayRange.c deleted file mode 100644 index 8b2445df..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexArrayRange.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexArrayRangeNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glFlushVertexArrayRangeNVPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexArrayRange_nglVertexArrayRangeNV(JNIEnv *__env, jclass clazz, jint length, jlong pointerAddress) { - glVertexArrayRangeNVPROC glVertexArrayRangeNV = (glVertexArrayRangeNVPROC)tlsGetFunction(2176); - uintptr_t pointer = (uintptr_t)pointerAddress; - UNUSED_PARAM(clazz) - glVertexArrayRangeNV(length, pointer); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexArrayRange_glFlushVertexArrayRangeNV(JNIEnv *__env, jclass clazz) { - glFlushVertexArrayRangeNVPROC glFlushVertexArrayRangeNV = (glFlushVertexArrayRangeNVPROC)tlsGetFunction(2177); - UNUSED_PARAM(clazz) - glFlushVertexArrayRangeNV(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexAttribInteger64bit.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexAttribInteger64bit.c deleted file mode 100644 index b368d8c9..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexAttribInteger64bit.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glVertexAttribL1i64NVPROC) (jint, jlong); -typedef void (APIENTRY *glVertexAttribL2i64NVPROC) (jint, jlong, jlong); -typedef void (APIENTRY *glVertexAttribL3i64NVPROC) (jint, jlong, jlong, jlong); -typedef void (APIENTRY *glVertexAttribL4i64NVPROC) (jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glVertexAttribL1i64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL2i64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL3i64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL4i64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL1ui64NVPROC) (jint, jlong); -typedef void (APIENTRY *glVertexAttribL2ui64NVPROC) (jint, jlong, jlong); -typedef void (APIENTRY *glVertexAttribL3ui64NVPROC) (jint, jlong, jlong, jlong); -typedef void (APIENTRY *glVertexAttribL4ui64NVPROC) (jint, jlong, jlong, jlong, jlong); -typedef void (APIENTRY *glVertexAttribL1ui64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL2ui64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL3ui64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribL4ui64vNVPROC) (jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribLi64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glGetVertexAttribLui64vNVPROC) (jint, jint, uintptr_t); -typedef void (APIENTRY *glVertexAttribLFormatNVPROC) (jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribL1i64NV(JNIEnv *__env, jclass clazz, jint index, jlong x) { - glVertexAttribL1i64NVPROC glVertexAttribL1i64NV = (glVertexAttribL1i64NVPROC)tlsGetFunction(2178); - UNUSED_PARAM(clazz) - glVertexAttribL1i64NV(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribL2i64NV(JNIEnv *__env, jclass clazz, jint index, jlong x, jlong y) { - glVertexAttribL2i64NVPROC glVertexAttribL2i64NV = (glVertexAttribL2i64NVPROC)tlsGetFunction(2179); - UNUSED_PARAM(clazz) - glVertexAttribL2i64NV(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribL3i64NV(JNIEnv *__env, jclass clazz, jint index, jlong x, jlong y, jlong z) { - glVertexAttribL3i64NVPROC glVertexAttribL3i64NV = (glVertexAttribL3i64NVPROC)tlsGetFunction(2180); - UNUSED_PARAM(clazz) - glVertexAttribL3i64NV(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribL4i64NV(JNIEnv *__env, jclass clazz, jint index, jlong x, jlong y, jlong z, jlong w) { - glVertexAttribL4i64NVPROC glVertexAttribL4i64NV = (glVertexAttribL4i64NVPROC)tlsGetFunction(2181); - UNUSED_PARAM(clazz) - glVertexAttribL4i64NV(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglVertexAttribL1i64vNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL1i64vNVPROC glVertexAttribL1i64vNV = (glVertexAttribL1i64vNVPROC)tlsGetFunction(2182); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL1i64vNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglVertexAttribL2i64vNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL2i64vNVPROC glVertexAttribL2i64vNV = (glVertexAttribL2i64vNVPROC)tlsGetFunction(2183); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL2i64vNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglVertexAttribL3i64vNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL3i64vNVPROC glVertexAttribL3i64vNV = (glVertexAttribL3i64vNVPROC)tlsGetFunction(2184); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL3i64vNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglVertexAttribL4i64vNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL4i64vNVPROC glVertexAttribL4i64vNV = (glVertexAttribL4i64vNVPROC)tlsGetFunction(2185); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL4i64vNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribL1ui64NV(JNIEnv *__env, jclass clazz, jint index, jlong x) { - glVertexAttribL1ui64NVPROC glVertexAttribL1ui64NV = (glVertexAttribL1ui64NVPROC)tlsGetFunction(2186); - UNUSED_PARAM(clazz) - glVertexAttribL1ui64NV(index, x); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribL2ui64NV(JNIEnv *__env, jclass clazz, jint index, jlong x, jlong y) { - glVertexAttribL2ui64NVPROC glVertexAttribL2ui64NV = (glVertexAttribL2ui64NVPROC)tlsGetFunction(2187); - UNUSED_PARAM(clazz) - glVertexAttribL2ui64NV(index, x, y); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribL3ui64NV(JNIEnv *__env, jclass clazz, jint index, jlong x, jlong y, jlong z) { - glVertexAttribL3ui64NVPROC glVertexAttribL3ui64NV = (glVertexAttribL3ui64NVPROC)tlsGetFunction(2188); - UNUSED_PARAM(clazz) - glVertexAttribL3ui64NV(index, x, y, z); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribL4ui64NV(JNIEnv *__env, jclass clazz, jint index, jlong x, jlong y, jlong z, jlong w) { - glVertexAttribL4ui64NVPROC glVertexAttribL4ui64NV = (glVertexAttribL4ui64NVPROC)tlsGetFunction(2189); - UNUSED_PARAM(clazz) - glVertexAttribL4ui64NV(index, x, y, z, w); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglVertexAttribL1ui64vNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL1ui64vNVPROC glVertexAttribL1ui64vNV = (glVertexAttribL1ui64vNVPROC)tlsGetFunction(2190); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL1ui64vNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglVertexAttribL2ui64vNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL2ui64vNVPROC glVertexAttribL2ui64vNV = (glVertexAttribL2ui64vNVPROC)tlsGetFunction(2191); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL2ui64vNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglVertexAttribL3ui64vNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL3ui64vNVPROC glVertexAttribL3ui64vNV = (glVertexAttribL3ui64vNVPROC)tlsGetFunction(2192); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL3ui64vNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglVertexAttribL4ui64vNV__IJ(JNIEnv *__env, jclass clazz, jint index, jlong vAddress) { - glVertexAttribL4ui64vNVPROC glVertexAttribL4ui64vNV = (glVertexAttribL4ui64vNVPROC)tlsGetFunction(2193); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glVertexAttribL4ui64vNV(index, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglGetVertexAttribLi64vNV__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribLi64vNVPROC glGetVertexAttribLi64vNV = (glGetVertexAttribLi64vNVPROC)tlsGetFunction(2194); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribLi64vNV(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_nglGetVertexAttribLui64vNV__IIJ(JNIEnv *__env, jclass clazz, jint index, jint pname, jlong paramsAddress) { - glGetVertexAttribLui64vNVPROC glGetVertexAttribLui64vNV = (glGetVertexAttribLui64vNVPROC)tlsGetFunction(2195); - uintptr_t params = (uintptr_t)paramsAddress; - UNUSED_PARAM(clazz) - glGetVertexAttribLui64vNV(index, pname, params); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexAttribInteger64bit_glVertexAttribLFormatNV(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jint stride) { - glVertexAttribLFormatNVPROC glVertexAttribLFormatNV = (glVertexAttribLFormatNVPROC)tlsGetFunction(2196); - UNUSED_PARAM(clazz) - glVertexAttribLFormatNV(index, size, type, stride); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexBufferUnifiedMemory.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexBufferUnifiedMemory.c deleted file mode 100644 index 610b4adc..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVVertexBufferUnifiedMemory.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBufferAddressRangeNVPROC) (jint, jint, jlong, uintptr_t); -typedef void (APIENTRY *glVertexFormatNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glNormalFormatNVPROC) (jint, jint); -typedef void (APIENTRY *glColorFormatNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glIndexFormatNVPROC) (jint, jint); -typedef void (APIENTRY *glTexCoordFormatNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glEdgeFlagFormatNVPROC) (jint); -typedef void (APIENTRY *glSecondaryColorFormatNVPROC) (jint, jint, jint); -typedef void (APIENTRY *glFogCoordFormatNVPROC) (jint, jint); -typedef void (APIENTRY *glVertexAttribFormatNVPROC) (jint, jint, jint, jboolean, jint); -typedef void (APIENTRY *glVertexAttribIFormatNVPROC) (jint, jint, jint, jint); -typedef void (APIENTRY *glGetIntegerui64i_vNVPROC) (jint, jint, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glBufferAddressRangeNV(JNIEnv *__env, jclass clazz, jint pname, jint index, jlong address, jlong length) { - glBufferAddressRangeNVPROC glBufferAddressRangeNV = (glBufferAddressRangeNVPROC)tlsGetFunction(2197); - UNUSED_PARAM(clazz) - glBufferAddressRangeNV(pname, index, address, (uintptr_t)length); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glVertexFormatNV(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride) { - glVertexFormatNVPROC glVertexFormatNV = (glVertexFormatNVPROC)tlsGetFunction(2198); - UNUSED_PARAM(clazz) - glVertexFormatNV(size, type, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glNormalFormatNV(JNIEnv *__env, jclass clazz, jint type, jint stride) { - glNormalFormatNVPROC glNormalFormatNV = (glNormalFormatNVPROC)tlsGetFunction(2199); - UNUSED_PARAM(clazz) - glNormalFormatNV(type, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glColorFormatNV(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride) { - glColorFormatNVPROC glColorFormatNV = (glColorFormatNVPROC)tlsGetFunction(2200); - UNUSED_PARAM(clazz) - glColorFormatNV(size, type, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glIndexFormatNV(JNIEnv *__env, jclass clazz, jint type, jint stride) { - glIndexFormatNVPROC glIndexFormatNV = (glIndexFormatNVPROC)tlsGetFunction(2201); - UNUSED_PARAM(clazz) - glIndexFormatNV(type, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glTexCoordFormatNV(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride) { - glTexCoordFormatNVPROC glTexCoordFormatNV = (glTexCoordFormatNVPROC)tlsGetFunction(2202); - UNUSED_PARAM(clazz) - glTexCoordFormatNV(size, type, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glEdgeFlagFormatNV(JNIEnv *__env, jclass clazz, jint stride) { - glEdgeFlagFormatNVPROC glEdgeFlagFormatNV = (glEdgeFlagFormatNVPROC)tlsGetFunction(2203); - UNUSED_PARAM(clazz) - glEdgeFlagFormatNV(stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glSecondaryColorFormatNV(JNIEnv *__env, jclass clazz, jint size, jint type, jint stride) { - glSecondaryColorFormatNVPROC glSecondaryColorFormatNV = (glSecondaryColorFormatNVPROC)tlsGetFunction(2204); - UNUSED_PARAM(clazz) - glSecondaryColorFormatNV(size, type, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glFogCoordFormatNV(JNIEnv *__env, jclass clazz, jint type, jint stride) { - glFogCoordFormatNVPROC glFogCoordFormatNV = (glFogCoordFormatNVPROC)tlsGetFunction(2205); - UNUSED_PARAM(clazz) - glFogCoordFormatNV(type, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glVertexAttribFormatNV(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jboolean normalized, jint stride) { - glVertexAttribFormatNVPROC glVertexAttribFormatNV = (glVertexAttribFormatNVPROC)tlsGetFunction(2206); - UNUSED_PARAM(clazz) - glVertexAttribFormatNV(index, size, type, normalized, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_glVertexAttribIFormatNV(JNIEnv *__env, jclass clazz, jint index, jint size, jint type, jint stride) { - glVertexAttribIFormatNVPROC glVertexAttribIFormatNV = (glVertexAttribIFormatNVPROC)tlsGetFunction(2207); - UNUSED_PARAM(clazz) - glVertexAttribIFormatNV(index, size, type, stride); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVVertexBufferUnifiedMemory_nglGetIntegerui64i_1vNV__IIJ(JNIEnv *__env, jclass clazz, jint value, jint index, jlong resultAddress) { - glGetIntegerui64i_vNVPROC glGetIntegerui64i_vNV = (glGetIntegerui64i_vNVPROC)tlsGetFunction(2208); - uintptr_t result = (uintptr_t)resultAddress; - UNUSED_PARAM(clazz) - glGetIntegerui64i_vNV(value, index, result); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVViewportSwizzle.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVViewportSwizzle.c deleted file mode 100644 index 8c3df276..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVViewportSwizzle.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glViewportSwizzleNVPROC) (jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVViewportSwizzle_glViewportSwizzleNV(JNIEnv *__env, jclass clazz, jint index, jint swizzlex, jint swizzley, jint swizzlez, jint swizzlew) { - glViewportSwizzleNVPROC glViewportSwizzleNV = (glViewportSwizzleNVPROC)tlsGetFunction(2209); - UNUSED_PARAM(clazz) - glViewportSwizzleNV(index, swizzlex, swizzley, swizzlez, swizzlew); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXConditionalRender.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXConditionalRender.c deleted file mode 100644 index 44bae4b7..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXConditionalRender.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glBeginConditionalRenderNVXPROC) (jint); -typedef void (APIENTRY *glEndConditionalRenderNVXPROC) (void); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXConditionalRender_glBeginConditionalRenderNVX(JNIEnv *__env, jclass clazz, jint id) { - glBeginConditionalRenderNVXPROC glBeginConditionalRenderNVX = (glBeginConditionalRenderNVXPROC)tlsGetFunction(2210); - UNUSED_PARAM(clazz) - glBeginConditionalRenderNVX(id); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXConditionalRender_glEndConditionalRenderNVX(JNIEnv *__env, jclass clazz) { - glEndConditionalRenderNVXPROC glEndConditionalRenderNVX = (glEndConditionalRenderNVXPROC)tlsGetFunction(2211); - UNUSED_PARAM(clazz) - glEndConditionalRenderNVX(); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXGpuMulticast2.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXGpuMulticast2.c deleted file mode 100644 index 1dfe7e6f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXGpuMulticast2.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jint (APIENTRY *glAsyncCopyImageSubDataNVXPROC) (jint, uintptr_t, uintptr_t, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t, uintptr_t); -typedef uintptr_t (APIENTRY *glAsyncCopyBufferSubDataNVXPROC) (jint, uintptr_t, uintptr_t, jint, jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glUploadGpuMaskNVXPROC) (jint); -typedef void (APIENTRY *glMulticastViewportArrayvNVXPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMulticastScissorArrayvNVXPROC) (jint, jint, jint, uintptr_t); -typedef void (APIENTRY *glMulticastViewportPositionWScaleNVXPROC) (jint, jint, jfloat, jfloat); - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVXGpuMulticast2_nglAsyncCopyImageSubDataNVX__IJJIIIIIIIIIIIIIIIIIIJJ(JNIEnv *__env, jclass clazz, jint waitSemaphoreCount, jlong waitSemaphoreArrayAddress, jlong waitValueArrayAddress, jint srcGpu, jint dstGpuMask, jint srcName, jint srcTarget, jint srcLevel, jint srcX, jint srcY, jint srcZ, jint dstName, jint dstTarget, jint dstLevel, jint dstX, jint dstY, jint dstZ, jint srcWidth, jint srcHeight, jint srcDepth, jint signalSemaphoreCount, jlong signalSemaphoreArrayAddress, jlong signalValueArrayAddress) { - glAsyncCopyImageSubDataNVXPROC glAsyncCopyImageSubDataNVX = (glAsyncCopyImageSubDataNVXPROC)tlsGetFunction(2212); - uintptr_t waitSemaphoreArray = (uintptr_t)waitSemaphoreArrayAddress; - uintptr_t waitValueArray = (uintptr_t)waitValueArrayAddress; - uintptr_t signalSemaphoreArray = (uintptr_t)signalSemaphoreArrayAddress; - uintptr_t signalValueArray = (uintptr_t)signalValueArrayAddress; - UNUSED_PARAM(clazz) - return glAsyncCopyImageSubDataNVX(waitSemaphoreCount, waitSemaphoreArray, waitValueArray, srcGpu, dstGpuMask, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth, signalSemaphoreCount, signalSemaphoreArray, signalValueArray); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_NVXGpuMulticast2_nglAsyncCopyBufferSubDataNVX__IJJIIIIJJJIJJ(JNIEnv *__env, jclass clazz, jint waitSemaphoreCount, jlong waitSemaphoreArrayAddress, jlong fenceValueArrayAddress, jint readGpu, jint writeGpuMask, jint readBuffer, jint writeBuffer, jlong readOffset, jlong writeOffset, jlong size, jint signalSemaphoreCount, jlong signalSemaphoreArrayAddress, jlong signalValueArrayAddress) { - glAsyncCopyBufferSubDataNVXPROC glAsyncCopyBufferSubDataNVX = (glAsyncCopyBufferSubDataNVXPROC)tlsGetFunction(2213); - uintptr_t waitSemaphoreArray = (uintptr_t)waitSemaphoreArrayAddress; - uintptr_t fenceValueArray = (uintptr_t)fenceValueArrayAddress; - uintptr_t signalSemaphoreArray = (uintptr_t)signalSemaphoreArrayAddress; - uintptr_t signalValueArray = (uintptr_t)signalValueArrayAddress; - UNUSED_PARAM(clazz) - return (jlong)glAsyncCopyBufferSubDataNVX(waitSemaphoreCount, waitSemaphoreArray, fenceValueArray, readGpu, writeGpuMask, readBuffer, writeBuffer, (uintptr_t)readOffset, (uintptr_t)writeOffset, (uintptr_t)size, signalSemaphoreCount, signalSemaphoreArray, signalValueArray); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXGpuMulticast2_glUploadGpuMaskNVX(JNIEnv *__env, jclass clazz, jint mask) { - glUploadGpuMaskNVXPROC glUploadGpuMaskNVX = (glUploadGpuMaskNVXPROC)tlsGetFunction(2214); - UNUSED_PARAM(clazz) - glUploadGpuMaskNVX(mask); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXGpuMulticast2_nglMulticastViewportArrayvNVX__IIIJ(JNIEnv *__env, jclass clazz, jint gpu, jint first, jint count, jlong vAddress) { - glMulticastViewportArrayvNVXPROC glMulticastViewportArrayvNVX = (glMulticastViewportArrayvNVXPROC)tlsGetFunction(2215); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMulticastViewportArrayvNVX(gpu, first, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXGpuMulticast2_nglMulticastScissorArrayvNVX__IIIJ(JNIEnv *__env, jclass clazz, jint gpu, jint first, jint count, jlong vAddress) { - glMulticastScissorArrayvNVXPROC glMulticastScissorArrayvNVX = (glMulticastScissorArrayvNVXPROC)tlsGetFunction(2216); - uintptr_t v = (uintptr_t)vAddress; - UNUSED_PARAM(clazz) - glMulticastScissorArrayvNVX(gpu, first, count, v); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXGpuMulticast2_glMulticastViewportPositionWScaleNVX(JNIEnv *__env, jclass clazz, jint gpu, jint index, jfloat xcoeff, jfloat ycoeff) { - glMulticastViewportPositionWScaleNVXPROC glMulticastViewportPositionWScaleNVX = (glMulticastViewportPositionWScaleNVXPROC)tlsGetFunction(2217); - UNUSED_PARAM(clazz) - glMulticastViewportPositionWScaleNVX(gpu, index, xcoeff, ycoeff); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXProgressFence.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXProgressFence.c deleted file mode 100644 index 706656fb..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_NVXProgressFence.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef jint (APIENTRY *glCreateProgressFenceNVXPROC) (void); -typedef void (APIENTRY *glSignalSemaphoreui64NVXPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glWaitSemaphoreui64NVXPROC) (jint, jint, uintptr_t, uintptr_t); -typedef void (APIENTRY *glClientWaitSemaphoreui64NVXPROC) (jint, uintptr_t, uintptr_t); - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_NVXProgressFence_glCreateProgressFenceNVX(JNIEnv *__env, jclass clazz) { - glCreateProgressFenceNVXPROC glCreateProgressFenceNVX = (glCreateProgressFenceNVXPROC)tlsGetFunction(2218); - UNUSED_PARAM(clazz) - return glCreateProgressFenceNVX(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXProgressFence_nglSignalSemaphoreui64NVX__IIJJ(JNIEnv *__env, jclass clazz, jint signalGpu, jint fenceObjectCount, jlong semaphoreArrayAddress, jlong fenceValueArrayAddress) { - glSignalSemaphoreui64NVXPROC glSignalSemaphoreui64NVX = (glSignalSemaphoreui64NVXPROC)tlsGetFunction(2219); - uintptr_t semaphoreArray = (uintptr_t)semaphoreArrayAddress; - uintptr_t fenceValueArray = (uintptr_t)fenceValueArrayAddress; - UNUSED_PARAM(clazz) - glSignalSemaphoreui64NVX(signalGpu, fenceObjectCount, semaphoreArray, fenceValueArray); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXProgressFence_nglWaitSemaphoreui64NVX__IIJJ(JNIEnv *__env, jclass clazz, jint waitGpu, jint fenceObjectCount, jlong semaphoreArrayAddress, jlong fenceValueArrayAddress) { - glWaitSemaphoreui64NVXPROC glWaitSemaphoreui64NVX = (glWaitSemaphoreui64NVXPROC)tlsGetFunction(2220); - uintptr_t semaphoreArray = (uintptr_t)semaphoreArrayAddress; - uintptr_t fenceValueArray = (uintptr_t)fenceValueArrayAddress; - UNUSED_PARAM(clazz) - glWaitSemaphoreui64NVX(waitGpu, fenceObjectCount, semaphoreArray, fenceValueArray); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVXProgressFence_nglClientWaitSemaphoreui64NVX__IJJ(JNIEnv *__env, jclass clazz, jint fenceObjectCount, jlong semaphoreArrayAddress, jlong fenceValueArrayAddress) { - glClientWaitSemaphoreui64NVXPROC glClientWaitSemaphoreui64NVX = (glClientWaitSemaphoreui64NVXPROC)tlsGetFunction(2221); - uintptr_t semaphoreArray = (uintptr_t)semaphoreArrayAddress; - uintptr_t fenceValueArray = (uintptr_t)fenceValueArrayAddress; - UNUSED_PARAM(clazz) - glClientWaitSemaphoreui64NVX(fenceObjectCount, semaphoreArray, fenceValueArray); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_OVRMultiview.c b/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_OVRMultiview.c deleted file mode 100644 index 0b403ef1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/opengl/org_lwjgl_opengl_OVRMultiview.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "opengl.h" - -typedef void (APIENTRY *glFramebufferTextureMultiviewOVRPROC) (jint, jint, jint, jint, jint, jint); -typedef void (APIENTRY *glNamedFramebufferTextureMultiviewOVRPROC) (jint, jint, jint, jint, jint, jint); - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_OVRMultiview_glFramebufferTextureMultiviewOVR(JNIEnv *__env, jclass clazz, jint target, jint attachment, jint texture, jint level, jint baseViewIndex, jint numViews) { - glFramebufferTextureMultiviewOVRPROC glFramebufferTextureMultiviewOVR = (glFramebufferTextureMultiviewOVRPROC)tlsGetFunction(2222); - UNUSED_PARAM(clazz) - glFramebufferTextureMultiviewOVR(target, attachment, texture, level, baseViewIndex, numViews); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_OVRMultiview_glNamedFramebufferTextureMultiviewOVR(JNIEnv *__env, jclass clazz, jint framebuffer, jint attachment, jint texture, jint level, jint baseViewIndex, jint numViews) { - glNamedFramebufferTextureMultiviewOVRPROC glNamedFramebufferTextureMultiviewOVR = (glNamedFramebufferTextureMultiviewOVRPROC)tlsGetFunction(2223); - UNUSED_PARAM(clazz) - glNamedFramebufferTextureMultiviewOVR(framebuffer, attachment, texture, level, baseViewIndex, numViews); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_Callback.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_Callback.c deleted file mode 100644 index 87c30fab..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_Callback.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ -#include "common_tools.h" -DISABLE_WARNINGS() -#include "ffi.h" -ENABLE_WARNINGS() - -static jmethodID javaCallback; - -typedef struct LWJGLCallback { - jweak reference; - const char* debug; -} LWJGLCallback; - -#if LWJGL_WINDOWS - #define noinline __declspec(noinline) -#else - #define noinline __attribute__((noinline)) -#endif - -noinline static void asyncCallbackException(JNIEnv* env) { - fprintf(stderr, "[LWJGL] Exception in callback that was invoked asynchronously from a native thread.\n"); - fflush(stderr); - - (*env)->ExceptionDescribe(env); - (*env)->ExceptionClear(env); -} - -static void cbHandler(ffi_cif *cif, void *ret, void **args, void *user_data) { - jboolean async; - JNIEnv* env = getEnv(&async); - - UNUSED_PARAM(cif) - UNUSED_PARAM(ret) - - // Invoke the Java callback - (*env)->CallVoidMethod(env, - (jobject)user_data, - javaCallback, - (jlong)(uintptr_t)ret, - (jlong)(uintptr_t)args - ); - - // Check for exception - if ((*env)->ExceptionCheck(env) && async) { - asyncCallbackException(env); - } -} - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_Callback_getCallbackHandler(JNIEnv *env, jclass clazz, jobject method) { - UNUSED_PARAMS(env, clazz) - - javaCallback = (*env)->FromReflectedMethod(env, method); - return (jlong)(uintptr_t)&cbHandler; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_JNI.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_JNI.c deleted file mode 100644 index 3b1dbfa3..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_JNI.c +++ /dev/null @@ -1,5128 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" - -#ifdef LWJGL_WINDOWS - #define APIENTRY __stdcall -#else - #define APIENTRY -#endif - -JNIEXPORT jshort JNICALL Java_org_lwjgl_system_JNI_invokePC__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jshort)((uint16_t (*) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jdouble JNICALL Java_org_lwjgl_system_JNI_invokeD__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jdouble (*) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT jdouble JNICALL Java_org_lwjgl_system_JNI_invokeD__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jdouble (*) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jdouble JNICALL Java_org_lwjgl_system_JNI_invokePD__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jdouble (*) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jdouble JNICALL Java_org_lwjgl_system_JNI_invokePD__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jdouble (*) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jfloat JNICALL Java_org_lwjgl_system_JNI_invokeF__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jfloat (*) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jfloat JNICALL Java_org_lwjgl_system_JNI_invokePF__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jfloat (*) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jfloat JNICALL Java_org_lwjgl_system_JNI_invokePF__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jfloat (*) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jfloat JNICALL Java_org_lwjgl_system_JNI_invokePF__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jfloat (*) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokeI__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokeI__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokeI__IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (jint, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokeI__IIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePI__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePI__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePI__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePI__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePI__JIZJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jboolean param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePI__JIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNI__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNI__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, long))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (long)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNI__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__IJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JJZJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jboolean param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JZJJ(JNIEnv *__env, jclass clazz, jlong param0, jboolean param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jboolean, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JIJZJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jboolean param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JIZJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jboolean param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jboolean, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JJZZJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jboolean param2, jboolean param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jboolean, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JIJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__JIIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePCPI__JSJJ(JNIEnv *__env, jclass clazz, jlong param0, jshort param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uint16_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uint16_t)param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNNI__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (long)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNPI__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPNI__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNPI__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNPI__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPNI__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (long)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNNI__JJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, long, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (long)param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JIJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JIIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JIJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JIIIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPI__JIIJIJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jint param4, jlong param5, jint param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, uintptr_t, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5, param6, param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNPPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPNNI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, long, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, (long)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPNPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPNI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (long)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNNPI__JJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, jint, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, param2, (long)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPNI__JJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (long)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJIJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JIIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JIIJIJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jint param4, jlong param5, jlong param6, jint param7, jint param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5, (uintptr_t)param6, param7, param8); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNNPPI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, long, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (long)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPNNPI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, long, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, (long)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPNNI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, long, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (long)param3, (long)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPNI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (long)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePJPPNI__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jlong, uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (long)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPNPPI__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, long, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (long)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPNPPI__JJJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, long, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPNJI__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, uintptr_t, long, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (long)param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPNNI__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, uintptr_t, long, long))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (long)param4, (long)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPNPI__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (long)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPNI__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (long)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPNI__JJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4, (long)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPI__JJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPI__JJJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPI__JJJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNPPPI__JIIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, long, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (long)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPI__JJIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPI__JJIJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, jint, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5, param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPI__JJJIIIFJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jint param5, jfloat param6, jlong param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, jint, jint, jint, jfloat, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5, param6, (uintptr_t)param7, (uintptr_t)param8); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPPI__JJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPNPPPI__JIJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, long, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (long)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPPI__JIJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNNPPPI__JJJIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, long, long, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (long)param2, param3, param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPPI__JIIJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPPPI__JJJIJFFJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jfloat param5, jfloat param6, jlong param7, jlong param8, jlong param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (*) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, jfloat, jfloat, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4, param5, param6, (uintptr_t)param7, (uintptr_t)param8, (uintptr_t)param9); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeJ__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (*) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePJ__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (*) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePJ__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (*) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeNN__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (long))(uintptr_t)__functionAddress)((long)param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePN__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePN__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeNNN__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (long, long))(uintptr_t)__functionAddress)((long)param0, (long)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPN__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeNNNN__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (long, long, long))(uintptr_t)__functionAddress)((long)param0, (long)param1, (long)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePNPN__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePNPN__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (uintptr_t, long, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPNN__JIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (uintptr_t, jint, jint, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (long)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePNPNN__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (uintptr_t, long, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2, (long)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePNPNPN__JJIIIIIIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jlong param9, jlong param10, jlong param11, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (*) (uintptr_t, long, jint, jint, jint, jint, jint, jint, jint, uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)param9, (long)param10, (uintptr_t)param11); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeP__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeP__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeP__IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (jint, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__IIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__JIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePP__JIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePNP__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPP__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePCP__JSZJ(JNIEnv *__env, jclass clazz, jlong param0, jshort param1, jboolean param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uint16_t, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, (uint16_t)param1, param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPP__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPP__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPP__JIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPP__JJZZJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jboolean param2, jboolean param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, jboolean, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPP__JZZJJ(JNIEnv *__env, jclass clazz, jlong param0, jboolean param1, jboolean param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jboolean, jboolean, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPP__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPP__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPP__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPP__IIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPP__JIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPP__JJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokeJPPP__IIIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (jint, jint, jint, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePNNPP__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, long, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (long)param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPNNP__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, long, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, (long)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPPP__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPPP__JJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPPP__JJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePJPPP__JIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, jint, jint, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePNNNPP__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, long, long, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (long)param2, (long)param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPPNP__JJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4, (long)param5); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPPPP__JJJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4, param5, (uintptr_t)param6); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPPPPP__JJJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPPPPPP__JJJJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, param6); -} -JNIEXPORT jbyte JNICALL Java_org_lwjgl_system_JNI_invokeU__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jbyte)((uint8_t (*) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__DJ(JNIEnv *__env, jclass clazz, jdouble param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jdouble))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__FJ(JNIEnv *__env, jclass clazz, jfloat param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jfloat))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jfloat))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IIDJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdouble param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IIFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IFFFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IIDDDJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdouble param2, jdouble param3, jdouble param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IIFFFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeV__IIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeJV__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jlong))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JZJ(JNIEnv *__env, jclass clazz, jlong param0, jboolean param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeJV__IIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jlong))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IJZJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jboolean param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JDDJ(JNIEnv *__env, jclass clazz, jlong param0, jdouble param1, jdouble param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jdouble, jdouble))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JFFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIDJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jdouble param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jdouble))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIFJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JFFIJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jfloat param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jfloat, jfloat, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIIDJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jdouble param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jdouble))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIIFJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIJIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePJV__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePNV__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePJV__IJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, uintptr_t, jlong))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePJV__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JJZJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jboolean param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePBV__JIIBJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jbyte param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jbyte))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePCV__JIISJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jshort param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, uint16_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uint16_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__IIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePSV__JIISJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jshort param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jshort))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePUV__JIIBJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jbyte param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, uint8_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uint8_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__IIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__IIIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JIIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JJFFFFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JJIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JJFFFFFFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePNNV__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, long, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (long)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePNPV__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPNV__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__IJJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokeJJJV__IIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, jlong, jlong, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePNNV__JJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, long, jint, jint, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, param2, param3, (long)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__IIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJJFFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jfloat param3, jfloat param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJJZZJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jboolean param3, jboolean param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jboolean, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JIIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JIJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JIJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJJIZZJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jboolean param4, jboolean param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jint, jboolean, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JIIJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jint param4, jlong param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJFFFFJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jfloat, jfloat, jfloat, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJJFFFFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJFFFFFFJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5, param6, param7, (uintptr_t)param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__JJJFFFFFFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jfloat param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5, param6, param7, param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePNPPV__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, long, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPV__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPV__JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPV__JJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPV__JJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPV__JJJFFJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jfloat param3, jfloat param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jfloat, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPV__JJJFFFFJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jfloat, jfloat, jfloat, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPV__JJJIIIFJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jint param5, jfloat param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jint, jint, jint, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPV__JJJFFFFFFJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jfloat param8, jlong param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5, param6, param7, param8, (uintptr_t)param9); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPPV__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPPV__IJJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPPV__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPPV__JJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPPV__JIIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPPV__JJIJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5, param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPPV__JJIJJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jint param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (*) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokeZ__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePZ__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePZ__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePZ__JZJ(JNIEnv *__env, jclass clazz, jlong param0, jboolean param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePZ__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePZ__JIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPZ__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPZ__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPZ__JIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPZ__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPZ__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPZ__JJJZIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jboolean param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, uintptr_t, uintptr_t, jboolean, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPPZ__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPPZ__JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPUPZ__JJJBJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jbyte param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, uintptr_t, uintptr_t, uint8_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uint8_t)param3, (uintptr_t)param4); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPPPZ__JJJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, param5); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPPPZ__JJJJJZIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jboolean param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jboolean, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, param5, param6); -} -JNIEXPORT jshort JNICALL Java_org_lwjgl_system_JNI_callC__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jshort)((uint16_t (APIENTRY *) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jfloat JNICALL Java_org_lwjgl_system_JNI_callF__IIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jfloat (APIENTRY *) (jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT jfloat JNICALL Java_org_lwjgl_system_JNI_callPF__JFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jfloat (APIENTRY *) (uintptr_t, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callI__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callI__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callI__IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callI__IIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JFFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JFIJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jfloat, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIFJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callJI__IJIIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jlong, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JFFFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIFFJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIIZJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jboolean param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIFFIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jfloat param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat, jfloat, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IJIIFIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jint param3, jfloat param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, uintptr_t, jint, jint, jfloat, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, param3, param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JIIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IIJIIIIFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jfloat param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, jint, jfloat))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, param6, param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__JFFFFFFFFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jfloat param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, param7, param8); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJI__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJI__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJI__JJFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJI__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__IJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JFJJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__IIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIFJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJFFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJFIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jfloat, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIFFJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jfloat param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJIIZJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jboolean param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, jboolean))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__IJIIFJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jint param3, jfloat param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, uintptr_t, jint, jint, jfloat, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIFFFJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat, jfloat, jfloat, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JJIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIFFFIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat, jfloat, jfloat, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIIIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIFFFFIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat, jfloat, jfloat, jfloat, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIIIIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__IIJJIIIIFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jint param6, jint param7, jfloat param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint, jint, jint, jint, jfloat))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5, param6, param7, param8); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIFFFFFIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jint param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, param7, (uintptr_t)param8); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIIFFFFFIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jint param8, jlong param9, jint param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)param9, param10); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JIIIIIIJIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jlong param7, jint param8, jint param9, jint param10, jint param11, jint param12, jint param13, jint param14, jint param15, jint param16, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint, jint, uintptr_t, jint, jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, (uintptr_t)param7, param8, param9, param10, param11, param12, param13, param14, param15, param16); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJI__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPI__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPJI__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJI__JJJFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJI__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPI__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPI__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPJI__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPJI__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPNI__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (long)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJI__JJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jint, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPI__JIJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jlong, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPJI__JIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__IJIJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JFFIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jfloat param2, jint param3, jint param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jfloat, jfloat, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIIIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIJJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5, param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJIIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callJPPI__IIIIIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, jint, jint, jint, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callJJPPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jlong, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJJI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPJPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPNPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJJI__JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jlong, jlong, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPI__JJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPI__JJIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JIJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JIJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4, param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JIIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__IJJIIIIIIIIIIIIIIIIIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jint param11, jint param12, jint param13, jint param14, jint param15, jint param16, jint param17, jint param18, jint param19, jint param20, jlong param21, jlong param22, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, (uintptr_t)param21, (uintptr_t)param22); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJPPI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPPI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPJPPI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJJPI__JJJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPPI__JJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JJJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JJJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__IIJJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JIIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JIJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JIJJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callJPPPPI__IIJJIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, jlong, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPJI__JJIIJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong param5, jlong param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jint, jint, uintptr_t, uintptr_t, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5, param6, param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJJJPI__JJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPJPI__JJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPPI__JJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJPPPI__JJJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jlong, jlong, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPPPI__JIJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jlong, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPPI__IIJJJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPPI__JIJIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPPPI__JJJJJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6, param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPPPI__JIJIJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jlong param5, jlong param6, jlong param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7, (uintptr_t)param8); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPJPPI__JJJJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPPPPI__JIIJJJJIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong param6, jint param7, jlong param8, jlong param9, jlong param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6, param7, (uintptr_t)param8, (uintptr_t)param9, (uintptr_t)param10); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callJ__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (APIENTRY *) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callJ__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (APIENTRY *) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callJ__IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (APIENTRY *) (jint, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callJ__IIZIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jboolean param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (APIENTRY *) (jint, jint, jboolean, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPJ__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPJJ__JJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jlong (APIENTRY *) (uintptr_t, jlong, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPN__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((long (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callP__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callP__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callP__IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callP__IFFFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPP__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPP__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPP__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPP__IIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPP__IJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPP__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPP__IIJIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPNP__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__IJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__IJJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__JIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__IIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__JIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__JJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPNP__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPNPP__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPJPP__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPJPPP__JJJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPPPPP__IJJIIIIJJJIJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jlong param7, jlong param8, jlong param9, jint param10, jlong param11, jlong param12, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return (jlong)((uintptr_t (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5, param6, (uintptr_t)param7, (uintptr_t)param8, (uintptr_t)param9, param10, (uintptr_t)param11, (uintptr_t)param12); -} -JNIEXPORT jshort JNICALL Java_org_lwjgl_system_JNI_callS__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jshort (APIENTRY *) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__J(JNIEnv *__env, jclass clazz, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (void))(uintptr_t)__functionAddress)(); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__DJ(JNIEnv *__env, jclass clazz, jdouble param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jdouble))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__FJ(JNIEnv *__env, jclass clazz, jfloat param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jfloat))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__ZJ(JNIEnv *__env, jclass clazz, jboolean param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jboolean))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__DDJ(JNIEnv *__env, jclass clazz, jdouble param0, jdouble param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__FFJ(JNIEnv *__env, jclass clazz, jfloat param0, jfloat param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__FZJ(JNIEnv *__env, jclass clazz, jfloat param0, jboolean param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jfloat, jboolean))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IDJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jdouble))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jfloat))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IZJ(JNIEnv *__env, jclass clazz, jint param0, jboolean param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jboolean))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__DDDJ(JNIEnv *__env, jclass clazz, jdouble param0, jdouble param1, jdouble param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__FFFJ(JNIEnv *__env, jclass clazz, jfloat param0, jfloat param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IDDJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IFFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIDJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdouble param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jboolean param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__DDDDJ(JNIEnv *__env, jclass clazz, jdouble param0, jdouble param1, jdouble param2, jdouble param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jdouble, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__FFFFJ(JNIEnv *__env, jclass clazz, jfloat param0, jfloat param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IDDDJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jdouble param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IFFFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIDDJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdouble param2, jdouble param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIFFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIFIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jfloat, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIDJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jdouble param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIZIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jboolean param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jboolean, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__ZZZZJ(JNIEnv *__env, jclass clazz, jboolean param0, jboolean param1, jboolean param2, jboolean param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jboolean, jboolean, jboolean, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IDDDDJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jdouble param3, jdouble param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jdouble, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IFFFFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jfloat param3, jfloat param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIDDDJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdouble param2, jdouble param3, jdouble param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIFFFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIFIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jfloat param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jfloat, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIZIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jboolean, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IZZZZJ(JNIEnv *__env, jclass clazz, jint param0, jboolean param1, jboolean param2, jboolean param3, jboolean param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jboolean, jboolean, jboolean, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__DDDDDDJ(JNIEnv *__env, jclass clazz, jdouble param0, jdouble param1, jdouble param2, jdouble param3, jdouble param4, jdouble param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jdouble, jdouble, jdouble, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IDDIDDJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jint param3, jdouble param4, jdouble param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jdouble, jdouble, jint, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IFFIFFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jint param3, jfloat param4, jfloat param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jfloat, jfloat, jint, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIDDDDJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdouble param2, jdouble param3, jdouble param4, jdouble param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jdouble, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIFFFFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jboolean param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIZIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jboolean param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jboolean, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IDDDDDDJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jdouble param3, jdouble param4, jdouble param5, jdouble param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIDDDDJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jdouble param3, jdouble param4, jdouble param5, jdouble param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jdouble, jdouble, jdouble, jdouble))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIFFFFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jboolean param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIZIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jboolean, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__FFFFFFFFJ(JNIEnv *__env, jclass clazz, jfloat param0, jfloat param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIFFFFFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jfloat, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jboolean param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIIZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jboolean param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIFFFFFFFFFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jfloat param8, jfloat param9, jfloat param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jint param11, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jint param11, jint param12, jint param13, jint param14, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callV__IIIIIIIIIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jint param11, jint param12, jint param13, jint param14, jint param15, jint param16, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jlong))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callSV__SJ(JNIEnv *__env, jclass clazz, jshort param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jshort))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callUV__BJ(JNIEnv *__env, jclass clazz, jbyte param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uint8_t))(uintptr_t)__functionAddress)((uint8_t)param0); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callCV__ISJ(JNIEnv *__env, jclass clazz, jint param0, jshort param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uint16_t))(uintptr_t)__functionAddress)(param0, (uint16_t)param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jlong))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jlong, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callSV__ISJ(JNIEnv *__env, jclass clazz, jint param0, jshort param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jshort))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jlong))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JFFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IJIIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jlong, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callNV__JIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (long, jint, jint, jint))(uintptr_t)__functionAddress)((long)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIJIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIZJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jboolean param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jboolean, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IJIIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JFFFJ(JNIEnv *__env, jclass clazz, jlong param0, jfloat param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIJIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIJZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jboolean param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIZJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jboolean, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIJIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IJIIIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IZIIJJ(JNIEnv *__env, jclass clazz, jint param0, jboolean param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jboolean, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IDDIIJJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jdouble, jdouble, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IFFIIJJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jfloat, jfloat, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIJZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jboolean param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIJIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIZIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jboolean, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIJIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IZIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jboolean param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jboolean, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIFFFFJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jfloat, jfloat, jfloat, jfloat, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIJIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIJIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIJIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JIIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IIIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IIIIIZIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jboolean param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jboolean, jint, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIZIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jboolean param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jboolean, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IIIIIIZIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jboolean param6, jint param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jboolean, jint, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, (uintptr_t)param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIJIIIIIFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jint param7, jfloat param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, jint, jint, jfloat))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, param6, param7, param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IDDIIDDIIJJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jint param3, jint param4, jdouble param5, jdouble param6, jint param7, jint param8, jlong param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jdouble, jdouble, jint, jint, jdouble, jdouble, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)param9); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IFFIIFFIIJJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jint param3, jint param4, jfloat param5, jfloat param6, jint param7, jint param8, jlong param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jfloat, jfloat, jint, jint, jfloat, jfloat, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)param9); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jlong param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)param9); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__JIFFFFFFFFFJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloat param2, jfloat param3, jfloat param4, jfloat param5, jfloat param6, jfloat param7, jfloat param8, jfloat param9, jfloat param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jlong, jint, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jlong param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, (uintptr_t)param10); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__JIIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJV__IIIIIIIIIIJZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jlong param10, jboolean param11, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jlong, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jlong param11, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, (uintptr_t)param11); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJV__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callSSV__SSJ(JNIEnv *__env, jclass clazz, jshort param0, jshort param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jshort, jshort))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJJV__IJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jlong, jlong))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPCV__JISJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jshort param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uint16_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uint16_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJV__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJV__JJFJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jfloat))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJV__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callSSV__ISSJ(JNIEnv *__env, jclass clazz, jint param0, jshort param1, jshort param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jshort, jshort))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJJV__IIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jlong, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJPV__IIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jlong, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJPV__IJIJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJV__IJIJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint, jlong))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJV__JIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJV__JJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJIJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJJZJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jboolean param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJV__JJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJJIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJIJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJJIIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJJIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJJIIIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JIJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIJIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJJIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIIIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIIJIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jint param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIJIFFIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jfloat param5, jfloat param6, jint param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint, jfloat, jfloat, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, param5, param6, param7, (uintptr_t)param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIIIIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jint param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, param6, param7, (uintptr_t)param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIIIJIIFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jlong param6, jint param7, jint param8, jfloat param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, uintptr_t, jint, jint, jfloat))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, (uintptr_t)param6, param7, param8, param9); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callBBBV__BBBJ(JNIEnv *__env, jclass clazz, jbyte param0, jbyte param1, jbyte param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jbyte, jbyte, jbyte))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callCCCV__SSSJ(JNIEnv *__env, jclass clazz, jshort param0, jshort param1, jshort param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uint16_t, uint16_t, uint16_t))(uintptr_t)__functionAddress)((uint16_t)param0, (uint16_t)param1, (uint16_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJV__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPNV__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callSSSV__SSSJ(JNIEnv *__env, jclass clazz, jshort param0, jshort param1, jshort param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jshort, jshort, jshort))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callUUUV__BBBJ(JNIEnv *__env, jclass clazz, jbyte param0, jbyte param1, jbyte param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uint8_t, uint8_t, uint8_t))(uintptr_t)__functionAddress)((uint8_t)param0, (uint8_t)param1, (uint8_t)param2); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJJJV__IJJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jlong, jlong, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJV__JJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callSSSV__ISSSJ(JNIEnv *__env, jclass clazz, jint param0, jshort param1, jshort param2, jshort param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jshort, jshort, jshort))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJJJV__IIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jlong, jlong, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJV__JIJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jlong, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJV__JJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJIJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJJIJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJJJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JIJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jlong, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPJV__IJJIJZJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jint param3, jlong param4, jboolean param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, jlong, jboolean))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPJV__JIJIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJIJIJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJV__JIIJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jlong, jlong, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIIIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJIIJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JIJIIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIIIJIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jint param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JIIIIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JJIIIIIIJIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jlong param8, jint param9, jint param10, jint param11, jint param12, jint param13, jint param14, jint param15, jint param16, jint param17, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, jint, jint, jint, jint, uintptr_t, jint, jint, jint, jint, jint, jint, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5, param6, param7, (uintptr_t)param8, param9, param10, param11, param12, param13, param14, param15, param16, param17); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callBBBBV__BBBBJ(JNIEnv *__env, jclass clazz, jbyte param0, jbyte param1, jbyte param2, jbyte param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jbyte, jbyte, jbyte, jbyte))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callCCCCV__SSSSJ(JNIEnv *__env, jclass clazz, jshort param0, jshort param1, jshort param2, jshort param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uint16_t, uint16_t, uint16_t, uint16_t))(uintptr_t)__functionAddress)((uint16_t)param0, (uint16_t)param1, (uint16_t)param2, (uint16_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPPV__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPNV__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, long))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (long)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__JJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callSSSSV__SSSSJ(JNIEnv *__env, jclass clazz, jshort param0, jshort param1, jshort param2, jshort param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jshort, jshort, jshort, jshort))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callUUUUV__BBBBJ(JNIEnv *__env, jclass clazz, jbyte param0, jbyte param1, jbyte param2, jbyte param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uint8_t, uint8_t, uint8_t, uint8_t))(uintptr_t)__functionAddress)((uint8_t)param0, (uint8_t)param1, (uint8_t)param2, (uint8_t)param3); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJJJJV__IJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jlong, jlong, jlong, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJV__JJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JJJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__JJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callSSSSV__ISSSSJ(JNIEnv *__env, jclass clazz, jint param0, jshort param1, jshort param2, jshort param3, jshort param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jshort, jshort, jshort, jshort))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callUUUUV__IBBBBJ(JNIEnv *__env, jclass clazz, jint param0, jbyte param1, jbyte param2, jbyte param3, jbyte param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uint8_t, uint8_t, uint8_t, uint8_t))(uintptr_t)__functionAddress)(param0, (uint8_t)param1, (uint8_t)param2, (uint8_t)param3, (uint8_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callJJJJV__IIJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jlong, jlong, jlong, jlong))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JJJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPPV__JJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__IJIJJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__IJJJJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__JIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JJIIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JJIJIIJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jint param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, jlong, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPPV__JIJIIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jlong, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__IIIJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__IIJJJJIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JJIJIIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jint param4, jint param5, jlong param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, jlong, jint, jint, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, (uintptr_t)param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPPV__JIJIIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jlong param5, jint param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jlong, jint, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5, param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__JIIIIJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jlong param5, jint param6, jlong param7, jint param8, jlong param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, jint, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)param5, param6, (uintptr_t)param7, param8, (uintptr_t)param9); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJPV__JJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__JIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJJV__JJJJJIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, jlong, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__IIJJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__JIIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJJV__JJIIJJJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlong param5, jlong param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jlong, jlong, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPPPV__JIIJJIJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jlong param4, jint param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, jint, jlong, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__JJJJJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jint param5, jint param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, param5, param6, param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__JIJIIIJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jlong param6, jint param7, jlong param8, jint param9, jlong param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jint, jint, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, param4, param5, (uintptr_t)param6, param7, (uintptr_t)param8, param9, (uintptr_t)param10); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPJV__JJJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)param4, param5); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPPV__JJJIIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPPPV__IIIJIJJJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jlong param5, jlong param6, jlong param7, jlong param8, jlong param9, jlong param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7, (uintptr_t)param8, (uintptr_t)param9, (uintptr_t)param10); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPJJJJJJV__JJJJIJJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jint param4, jlong param5, jlong param6, jlong param7, jlong param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, uintptr_t, jlong, jlong, jint, jlong, jlong, jlong, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, param4, param5, param6, param7, param8); -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJJJJJJJJJV__JJJJJJJJJJJJIIIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jlong param5, jlong param6, jlong param7, jlong param8, jlong param9, jlong param10, jlong param11, jint param12, jint param13, jint param14, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jint, jint, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callZ__IJ(JNIEnv *__env, jclass clazz, jint param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callZ__IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint, jint))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callZ__IFFJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callZ__IIFFJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloat param2, jfloat param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint, jint, jfloat, jfloat))(uintptr_t)__functionAddress)(param0, param1, param2, param3); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callJZ__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jlong))(uintptr_t)__functionAddress)(param0); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callPZ__JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callJZ__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint, jlong))(uintptr_t)__functionAddress)(param0, param1); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callPZ__IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callJZ__IJIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint, jlong, jint))(uintptr_t)__functionAddress)(param0, param1, param2); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callPPZ__IJJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2); -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callPPPPZ__IIIFJJJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jfloat param3, jlong param4, jlong param5, jlong param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - return ((jboolean (APIENTRY *) (jint, jint, jint, jfloat, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6, (uintptr_t)param7); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPI__IJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (*) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPI__JJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePPPPPI__J_3I_3I_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jintArray param2, jintArray param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_invokePNNPPPI__JJJII_3I_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jint param4, jintArray param5, jintArray param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - jint __result = ((jint (*) (uintptr_t, long, long, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (long)param2, param3, param4, (uintptr_t)paramArray5, (uintptr_t)paramArray6, (uintptr_t)param7); - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_invokePPP__J_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - jlong __result = (jlong)((uintptr_t (*) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__I_3DJ(JNIEnv *__env, jclass clazz, jint param0, jdoubleArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param1, NULL); - ((void (*) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__I_3FJ(JNIEnv *__env, jclass clazz, jint param0, jfloatArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param1, NULL); - ((void (*) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (*) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__II_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdoubleArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param2, NULL); - ((void (*) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__II_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloatArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - ((void (*) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__II_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (*) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__II_3JJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlongArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - ((void (*) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__I_3IZJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jboolean param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (*) (jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__II_3FIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloatArray param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - ((void (*) (jint, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, param3, param4); - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__II_3IIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (*) (jint, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, param3, param4); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__II_3SIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jshortArray param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param2, NULL); - ((void (*) (jint, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, param3, param4); - if (param2 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jdoubleArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param5, NULL); - ((void (*) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jfloatArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param5, NULL); - ((void (*) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (*) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jshortArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param5, NULL); - ((void (*) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jdoubleArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param6, NULL); - ((void (*) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jfloatArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param6, NULL); - ((void (*) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jintArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - ((void (*) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jshortArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param6, NULL); - ((void (*) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePJV__I_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (*) (jint, uintptr_t, jlong))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__J_3FIJ(JNIEnv *__env, jclass clazz, jlong param0, jfloatArray param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param1, NULL); - ((void (*) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, param2); - if (param1 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__J_3IIJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (*) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, param2); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__J_3SIJ(JNIEnv *__env, jclass clazz, jlong param0, jshortArray param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param1, NULL); - ((void (*) (uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, param2); - if (param1 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JII_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (*) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JII_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - ((void (*) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePNPV__JJ_3SJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jshortArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param2, NULL); - ((void (*) (uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__J_3D_3DJ(JNIEnv *__env, jclass clazz, jlong param0, jdoubleArray param1, jdoubleArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param2, NULL); - ((void (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__J_3F_3FJ(JNIEnv *__env, jclass clazz, jlong param0, jfloatArray param1, jfloatArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - ((void (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__J_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV___3I_3I_3IJ(JNIEnv *__env, jclass clazz, jintArray param0, jintArray param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, (uintptr_t)paramArray1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__I_3F_3F_3FJ(JNIEnv *__env, jclass clazz, jint param0, jfloatArray param1, jfloatArray param2, jfloatArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param3, NULL); - ((void (*) (jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__II_3D_3D_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdoubleArray param2, jdoubleArray param3, jdoubleArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param4, NULL); - ((void (*) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__II_3F_3F_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloatArray param2, jfloatArray param3, jfloatArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param4, NULL); - ((void (*) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPV__II_3J_3J_3JJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlongArray param2, jlongArray param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - ((void (*) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePNPPV__JJJ_3SJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jshortArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param3, NULL); - ((void (*) (uintptr_t, long, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (long)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPPPPV__J_3I_3I_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jintArray param2, jintArray param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (*) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPZ__J_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - jboolean __result = ((jboolean (*) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_invokePPPZ__JJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jboolean __result = ((jboolean (*) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI___3IJ(JNIEnv *__env, jclass clazz, jintArray param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0); - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - jint __result = ((jint (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI___3IIJ(JNIEnv *__env, jclass clazz, jintArray param0, jint param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, param1); - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__II_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__I_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - jint __result = ((jint (APIENTRY *) (jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__III_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jfloatArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPI__IIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__J_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI___3IJJ(JNIEnv *__env, jclass clazz, jintArray param0, jlong param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, (uintptr_t)param1); - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__IJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JI_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlongArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JII_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__JII_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPI__IJIIF_3IJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jint param3, jfloat param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (jint, uintptr_t, jint, jint, jfloat, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPI__JJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPI__JJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlongArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlongArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__J_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)param2); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__J_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI___3IJ_3IJ(JNIEnv *__env, jclass clazz, jintArray param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPI__JIJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPI__JJI_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JI_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JI_3I_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJI_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JJ_3IIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPJI__JI_3JIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlongArray param2, jint param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jlong))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, param3, param4); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIIJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlong param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIII_3I_3FJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jintArray param4, jfloatArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPI__JIII_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jintArray param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPI__JJJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPI__JJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPI__JJ_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPI__JJ_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPI__JJ_3I_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPNPI__JJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJ_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2, (uintptr_t)param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJ_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JIJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JIJ_3J_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlongArray param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JI_3IJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jlong param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3, (uintptr_t)param4); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJI_3JJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlongArray param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3, (uintptr_t)param4); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JJJI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__J_3IJI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jlong param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__JII_3J_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlongArray param3, jintArray param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPI__I_3I_3JIIIIIIIIIIIIIIIIII_3I_3JJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlongArray param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jint param11, jint param12, jint param13, jint param14, jint param15, jint param16, jint param17, jint param18, jint param19, jint param20, jintArray param21, jlongArray param22, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - void *paramArray21 = param21 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param21, NULL); - void *paramArray22 = param22 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param22, NULL); - jint __result = ((jint (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, (uintptr_t)paramArray21, (uintptr_t)paramArray22); - if (param22 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param22, paramArray22, 0); } - if (param21 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param21, paramArray21, 0); } - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPPI__JJJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPJPPI__JJJ_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jintArray param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3, (uintptr_t)param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JJ_3I_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jintArray param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JJ_3I_3I_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jintArray param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__J_3I_3I_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jintArray param2, jintArray param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPPI__JJIJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jlong param4, jlongArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param5, paramArray5, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JJJ_3II_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jintArray param3, jint param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__J_3I_3FI_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jfloatArray param2, jint param3, jintArray param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, param3, (uintptr_t)paramArray4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__II_3I_3I_3I_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jintArray param3, jintArray param4, jintArray param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5, (uintptr_t)param6); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPI__JI_3JIJJJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlongArray param2, jint param3, jlong param4, jlong param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)param6); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPJI__JJIIJ_3IJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jintArray param5, jlong param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, jint, jint, uintptr_t, uintptr_t, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)paramArray5, param6, param7); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJPPJI__JJIIJ_3JJIJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jlong param4, jlongArray param5, jlong param6, jint param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, jint, jint, uintptr_t, uintptr_t, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)paramArray5, param6, param7); - if (param5 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param5, paramArray5, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJJJPI__JJJJJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlong param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, jlong, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPPI__J_3I_3I_3I_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jintArray param2, jintArray param3, jintArray param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPJJPPPI__JJJIJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jlong param4, jlong param5, jlongArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param6, NULL); - jint __result = ((jint (APIENTRY *) (uintptr_t, jlong, jlong, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param6, paramArray6, 0); } - return __result; -} -JNIEXPORT jint JNICALL Java_org_lwjgl_system_JNI_callPPPPPPI__II_3I_3I_3I_3I_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jintArray param3, jintArray param4, jintArray param5, jintArray param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - jint __result = ((jint (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5, (uintptr_t)paramArray6, (uintptr_t)param7); - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPP___3IJ(JNIEnv *__env, jclass clazz, jintArray param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0); - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__J_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__IJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__JI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__III_3I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPP__JIII_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JI_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JJI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPP__JJII_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPNPP__JJJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, long, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (long)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JJJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JIJJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JJIJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlong param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPP__JJJI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - return __result; -} -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_JNI_callPPPPPPPP__I_3I_3JIIIIJJJI_3I_3JJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlongArray param2, jint param3, jint param4, jint param5, jint param6, jlong param7, jlong param8, jlong param9, jint param10, jintArray param11, jlongArray param12, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - void *paramArray11 = param11 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param11, NULL); - void *paramArray12 = param12 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param12, NULL); - jlong __result = (jlong)((uintptr_t (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, param3, param4, param5, param6, (uintptr_t)param7, (uintptr_t)param8, (uintptr_t)param9, param10, (uintptr_t)paramArray11, (uintptr_t)paramArray12); - if (param12 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param12, paramArray12, 0); } - if (param11 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param11, paramArray11, 0); } - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV___3DJ(JNIEnv *__env, jclass clazz, jdoubleArray param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param0, NULL); - ((void (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0); - if (param0 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV___3FJ(JNIEnv *__env, jclass clazz, jfloatArray param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param0, NULL); - ((void (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0); - if (param0 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV___3IJ(JNIEnv *__env, jclass clazz, jintArray param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - ((void (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0); - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV___3SJ(JNIEnv *__env, jclass clazz, jshortArray param0, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param0, NULL); - ((void (APIENTRY *) (uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0); - if (param0 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__I_3DJ(JNIEnv *__env, jclass clazz, jint param0, jdoubleArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__I_3FJ(JNIEnv *__env, jclass clazz, jint param0, jfloatArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__I_3JJ(JNIEnv *__env, jclass clazz, jint param0, jlongArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__I_3SJ(JNIEnv *__env, jclass clazz, jint param0, jshortArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__II_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jdoubleArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__II_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jfloatArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__II_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__II_3JJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlongArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__II_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jshortArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__I_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jint param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__III_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jdoubleArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__III_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jfloatArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__III_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__III_3JJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__III_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jshortArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIZ_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jboolean param2, jdoubleArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jboolean, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIZ_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jboolean param2, jfloatArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jboolean, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIZ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jboolean param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jboolean, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__II_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__I_3IIIJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jint param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2, param3); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jdoubleArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jfloatArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIII_3JJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jshortArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIZ_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jdoubleArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jboolean, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIZ_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jfloatArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jboolean, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__III_3IZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jboolean param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3, param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__II_3IIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, param3, param4); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IZII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jboolean param1, jint param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jboolean, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IDDII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jint param3, jint param4, jdoubleArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jdouble, jdouble, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IFFII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jint param3, jint param4, jfloatArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jfloat, jfloat, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jdoubleArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jfloatArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jshortArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIII_3IZJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jintArray param4, jboolean param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4, param5); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIZI_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jint param4, jfloatArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, jboolean, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIZI_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jint param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, jboolean, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIZI_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jboolean param3, jint param4, jshortArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, jboolean, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jdoubleArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jfloatArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jintArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jshortArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__II_3IIIIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jint param3, jint param4, jint param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, param3, param4, param5, param6); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jdoubleArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param7, paramArray7, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jfloatArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param7, paramArray7, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jintArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param7, paramArray7, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jshortArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param7, paramArray7, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jdoubleArray param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray8 = param8 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param8, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, (uintptr_t)paramArray8); - if (param8 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param8, paramArray8, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jfloatArray param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray8 = param8 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param8, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, (uintptr_t)paramArray8); - if (param8 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param8, paramArray8, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jintArray param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray8 = param8 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param8, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, (uintptr_t)paramArray8); - if (param8 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param8, paramArray8, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jshortArray param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray8 = param8 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param8, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, (uintptr_t)paramArray8); - if (param8 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param8, paramArray8, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IDDIIDDII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jdouble param1, jdouble param2, jint param3, jint param4, jdouble param5, jdouble param6, jint param7, jint param8, jdoubleArray param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray9 = param9 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param9, NULL); - ((void (APIENTRY *) (jint, jdouble, jdouble, jint, jint, jdouble, jdouble, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)paramArray9); - if (param9 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param9, paramArray9, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IFFIIFFII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jfloat param1, jfloat param2, jint param3, jint param4, jfloat param5, jfloat param6, jint param7, jint param8, jfloatArray param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray9 = param9 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param9, NULL); - ((void (APIENTRY *) (jint, jfloat, jfloat, jint, jint, jfloat, jfloat, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)paramArray9); - if (param9 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param9, paramArray9, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jdoubleArray param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray9 = param9 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param9, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)paramArray9); - if (param9 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param9, paramArray9, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jfloatArray param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray9 = param9 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param9, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)paramArray9); - if (param9 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param9, paramArray9, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jintArray param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray9 = param9 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param9, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)paramArray9); - if (param9 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param9, paramArray9, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jshortArray param9, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray9 = param9 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param9, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, (uintptr_t)paramArray9); - if (param9 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param9, paramArray9, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jdoubleArray param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray10 = param10 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param10, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, (uintptr_t)paramArray10); - if (param10 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param10, paramArray10, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jfloatArray param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray10 = param10 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param10, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, (uintptr_t)paramArray10); - if (param10 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param10, paramArray10, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jintArray param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray10 = param10 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param10, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, (uintptr_t)paramArray10); - if (param10 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param10, paramArray10, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jshortArray param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray10 = param10 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param10, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, (uintptr_t)paramArray10); - if (param10 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param10, paramArray10, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIIII_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jdoubleArray param11, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray11 = param11 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param11, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, (uintptr_t)paramArray11); - if (param11 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param11, paramArray11, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jfloatArray param11, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray11 = param11 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param11, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, (uintptr_t)paramArray11); - if (param11 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param11, paramArray11, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIIII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jintArray param11, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray11 = param11 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param11, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, (uintptr_t)paramArray11); - if (param11 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param11, paramArray11, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPV__IIIIIIIIIII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jint param4, jint param5, jint param6, jint param7, jint param8, jint param9, jint param10, jshortArray param11, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray11 = param11 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param11, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, (uintptr_t)paramArray11); - if (param11 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param11, paramArray11, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__J_3FJ(JNIEnv *__env, jclass clazz, jlong param0, jfloatArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__J_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV___3D_3DJ(JNIEnv *__env, jclass clazz, jdoubleArray param0, jdoubleArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param0, NULL); - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param1, paramArray1, 0); } - if (param0 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV___3F_3FJ(JNIEnv *__env, jclass clazz, jfloatArray param0, jfloatArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param0, NULL); - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param1, paramArray1, 0); } - if (param0 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV___3I_3IJ(JNIEnv *__env, jclass clazz, jintArray param0, jintArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV___3S_3SJ(JNIEnv *__env, jclass clazz, jshortArray param0, jshortArray param1, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param0, NULL); - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, (uintptr_t)paramArray1); - if (param1 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param1, paramArray1, 0); } - if (param0 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__I_3I_3FJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jfloatArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__I_3I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__I_3I_3JJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlongArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JI_3FJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jfloatArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV___3II_3IJ(JNIEnv *__env, jclass clazz, jintArray param0, jint param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param0, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__II_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__II_3I_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jfloatArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__II_3I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__II_3I_3JJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJI_3IJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJ_3DIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jdoubleArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJ_3FIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jfloatArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJ_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jintArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJ_3JIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlongArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IJ_3SIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jshortArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__I_3I_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jintArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__I_3J_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jlongArray param1, jintArray param2, jint param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JII_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__III_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__III_3I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJ_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jintArray param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3, param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__II_3II_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__I_3IIJIJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jint param2, jlong param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2, (uintptr_t)param3, param4); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__I_3II_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jint param2, jintArray param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2, (uintptr_t)paramArray3, param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__I_3IJIIJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlong param2, jint param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)param2, param3, param4); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__JIII_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIII_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jintArray param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4, (uintptr_t)param5); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jfloatArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jshortArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__II_3IJIIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jlong param3, jint param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3, param4, param5); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIJII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jint param5, jfloatArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jfloatArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIIJII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jint param5, jint param6, jfloatArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, param5, param6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param7, paramArray7, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIIJII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jint param5, jint param6, jshortArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, param5, param6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param7, paramArray7, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jfloatArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, param6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param7, paramArray7, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIIJIFFI_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jfloat param5, jfloat param6, jint param7, jfloatArray param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray8 = param8 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param8, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint, jfloat, jfloat, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, param5, param6, param7, (uintptr_t)paramArray8); - if (param8 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param8, paramArray8, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPV__IIJIIIII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jint param6, jint param7, jfloatArray param8, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray8 = param8 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param8, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, jint, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, param3, param4, param5, param6, param7, (uintptr_t)paramArray8); - if (param8 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param8, paramArray8, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlongArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__J_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jintArray param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)paramArray1, (uintptr_t)param2); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJI_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJJ_3DJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jdoubleArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJJ_3FJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jfloatArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJJ_3JJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJJ_3SJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jlong param2, jshortArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JI_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JI_3I_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jintArray param2, jlongArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JI_3JJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlongArray param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JJI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jintArray param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJ_3DJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jdoubleArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJ_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jfloatArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJ_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jshortArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__II_3IJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jlong param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__II_3I_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jintArray param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJI_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jintArray param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3, (uintptr_t)param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IJI_3I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jint param2, jintArray param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__I_3I_3II_3IJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jintArray param2, jint param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JII_3I_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jintArray param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JII_3J_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlongArray param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJIII_3DJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jdoubleArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJIII_3FJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jfloatArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJIII_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJIII_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jlongArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPV__JJIII_3SJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jint param2, jint param3, jint param4, jshortArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPJV__JI_3JIJIJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlongArray param2, jint param3, jlong param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jlong, jint))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, param3, param4, param5); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__III_3IJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jlong param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)param4, (uintptr_t)param5); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__III_3IJ_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jlong param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__II_3II_3I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jintArray param2, jint param3, jintArray param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2, param3, (uintptr_t)paramArray4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__I_3IIJI_3IJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jint param2, jlong param3, jint param4, jintArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2, (uintptr_t)param3, param4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJII_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jfloatArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJII_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jintArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIJJII_3SJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jlong param3, jint param4, jint param5, jshortArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JIJIII_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jint param5, jintArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jint, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, param4, param5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIII_3II_3I_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jintArray param4, jint param5, jintArray param6, jfloatArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4, param5, (uintptr_t)paramArray6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param7, paramArray7, 0); } - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__IIII_3II_3I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jintArray param4, jint param5, jintArray param6, jintArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (jint, jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4, param5, (uintptr_t)paramArray6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param7, paramArray7, 0); } - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPV__JIIIII_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jint param3, jint param4, jint param5, jintArray param6, jlong param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, param5, (uintptr_t)paramArray6, (uintptr_t)param7); - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPPV__JJ_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, (uintptr_t)param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__JJ_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jintArray param2, jlong param3, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, (uintptr_t)param1, (uintptr_t)paramArray2, (uintptr_t)param3); - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJPV__JIJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlong param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__JIJ_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jintArray param3, jlong param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3, (uintptr_t)param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV___3J_3I_3I_3IIJ(JNIEnv *__env, jclass clazz, jlongArray param0, jintArray param1, jintArray param2, jintArray param3, jint param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray0 = param0 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param0, NULL); - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - ((void (APIENTRY *) (uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)((uintptr_t)paramArray0, (uintptr_t)paramArray1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, param4); - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - if (param0 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param0, paramArray0, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__IJ_3I_3I_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jintArray param2, jintArray param3, jintArray param4, jint param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param2, NULL); - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, (uintptr_t)paramArray2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, param5); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } - if (param2 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__JII_3J_3J_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlongArray param3, jlongArray param4, jlongArray param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5); - if (param5 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPPV__JIJII_3I_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jintArray param5, jlongArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jlong, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)paramArray5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param6, paramArray6, 0); } - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__III_3I_3I_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jintArray param3, jintArray param4, jintArray param5, jlong param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5, (uintptr_t)param6); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPV__IIJ_3I_3I_3IIJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jintArray param3, jintArray param4, jintArray param5, jint param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, jint))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5, param6); - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJPPV__JIJII_3JI_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jint param3, jint param4, jlongArray param5, jint param6, jintArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param5, NULL); - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param7, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jlong, jint, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, param4, (uintptr_t)paramArray5, param6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param7, paramArray7, 0); } - if (param5 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param5, paramArray5, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJPV__JJJJ_3DJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jdoubleArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetDoubleArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseDoubleArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJPV__JJJJ_3FJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jfloatArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJPV__JJJJ_3IJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jintArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJPV__JJJJ_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jlongArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPJJJPV__JJJJ_3SJ(JNIEnv *__env, jclass clazz, jlong param0, jlong param1, jlong param2, jlong param3, jshortArray param4, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jlong, jlong, jlong, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, param3, (uintptr_t)paramArray4); - if (param4 != NULL) { (*__env)->ReleaseShortArrayElements(__env, param4, paramArray4, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__JIJ_3J_3IJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlong param2, jlongArray param3, jintArray param4, jlong param5, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)param5); - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__IIJ_3I_3I_3I_3IJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jlong param2, jintArray param3, jintArray param4, jintArray param5, jintArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param5, NULL); - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } - if (param5 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__JII_3J_3J_3J_3JJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jint param2, jlongArray param3, jlongArray param4, jlongArray param5, jlongArray param6, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray3 = param3 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param3, NULL); - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param5, NULL); - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param6, NULL); - ((void (APIENTRY *) (uintptr_t, jint, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2, (uintptr_t)paramArray3, (uintptr_t)paramArray4, (uintptr_t)paramArray5, (uintptr_t)paramArray6); - if (param6 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param6, paramArray6, 0); } - if (param5 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param4, paramArray4, 0); } - if (param3 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param3, paramArray3, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPV__JI_3JIIIJIJIJJ(JNIEnv *__env, jclass clazz, jlong param0, jint param1, jlongArray param2, jint param3, jint param4, jint param5, jlong param6, jint param7, jlong param8, jint param9, jlong param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param2, NULL); - ((void (APIENTRY *) (uintptr_t, jint, uintptr_t, jint, jint, jint, uintptr_t, jint, uintptr_t, jint, uintptr_t))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)paramArray2, param3, param4, param5, (uintptr_t)param6, param7, (uintptr_t)param8, param9, (uintptr_t)param10); - if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } -} -JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_callPPPPPPPV__IIIJIJ_3I_3I_3I_3I_3JJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jlong param3, jint param4, jlong param5, jintArray param6, jintArray param7, jintArray param8, jintArray param9, jlongArray param10, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param6, NULL); - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param7, NULL); - void *paramArray8 = param8 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param8, NULL); - void *paramArray9 = param9 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param9, NULL); - void *paramArray10 = param10 == NULL ? NULL : (*__env)->GetLongArrayElements(__env, param10, NULL); - ((void (APIENTRY *) (jint, jint, jint, uintptr_t, jint, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, param4, (uintptr_t)param5, (uintptr_t)paramArray6, (uintptr_t)paramArray7, (uintptr_t)paramArray8, (uintptr_t)paramArray9, (uintptr_t)paramArray10); - if (param10 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param10, paramArray10, 0); } - if (param9 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param9, paramArray9, 0); } - if (param8 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param8, paramArray8, 0); } - if (param7 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param7, paramArray7, 0); } - if (param6 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param6, paramArray6, 0); } -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callPPZ__I_3IJJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jlong param2, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); - jboolean __result = ((jboolean (APIENTRY *) (jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, (uintptr_t)param2); - if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } - return __result; -} -JNIEXPORT jboolean JNICALL Java_org_lwjgl_system_JNI_callPPPPZ__IIIF_3F_3F_3F_3FJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jfloat param3, jfloatArray param4, jfloatArray param5, jfloatArray param6, jfloatArray param7, jlong __functionAddress) { - UNUSED_PARAMS(__env, clazz) - void *paramArray4 = param4 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param4, NULL); - void *paramArray5 = param5 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param5, NULL); - void *paramArray6 = param6 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param6, NULL); - void *paramArray7 = param7 == NULL ? NULL : (*__env)->GetFloatArrayElements(__env, param7, NULL); - jboolean __result = ((jboolean (APIENTRY *) (jint, jint, jint, jfloat, uintptr_t, uintptr_t, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)paramArray4, (uintptr_t)paramArray5, (uintptr_t)paramArray6, (uintptr_t)paramArray7); - if (param7 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param7, paramArray7, 0); } - if (param6 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param6, paramArray6, 0); } - if (param5 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param5, paramArray5, 0); } - if (param4 != NULL) { (*__env)->ReleaseFloatArrayElements(__env, param4, paramArray4, 0); } - return __result; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_MemoryAccessJNI.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_MemoryAccessJNI.c deleted file mode 100644 index 62cfd0c9..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_MemoryAccessJNI.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" -#include -#include -#ifdef LWJGL_WINDOWS - static void* __aligned_alloc(size_t alignment, size_t size) { - return _aligned_malloc(size, alignment); - } - #define __aligned_free _aligned_free -#else - #if defined(__USE_ISOC11) - #define __aligned_alloc aligned_alloc - #else - static void* __aligned_alloc(size_t alignment, size_t size) { - void *p; - return posix_memalign(&p, alignment, size) ? NULL : p; - } - #endif - #define __aligned_free free -#endif - -// ----------- - -static inline int8_t getByte(void *ptr) { return *(int8_t *)ptr; } -static inline int16_t getShort(void *ptr) { return *(int16_t *)ptr; } -static inline int32_t getInt(void *ptr) { return *(int32_t *)ptr; } -static inline int64_t getLong(void *ptr) { return *(int64_t *)ptr; } -static inline float getFloat(void *ptr) { return *(float *)ptr; } -static inline double getDouble(void *ptr) { return *(double *)ptr; } -static inline uintptr_t getAddress(void *ptr) { return *(uintptr_t *)ptr; } - -// ----------- - -static inline void putByte(void *ptr, int8_t value) { *(int8_t *)ptr = value; } -static inline void putShort(void *ptr, int16_t value) { *(int16_t *)ptr = value; } -static inline void putInt(void *ptr, int32_t value) { *(int32_t *)ptr = value; } -static inline void putLong(void *ptr, int64_t value) { *(int64_t *)ptr = value; } -static inline void putFloat(void *ptr, float value) { *(float *)ptr = value; } -static inline void putDouble(void *ptr, double value) { *(double *)ptr = value; } -static inline void putAddress(void *ptr, uintptr_t value) { *(uintptr_t *)ptr = value; } - -// ----------- - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_MemoryAccessJNI_getPointerSize(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)sizeof(void *); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_MemoryAccessJNI_malloc(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&malloc; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_MemoryAccessJNI_calloc(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&calloc; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_MemoryAccessJNI_realloc(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&realloc; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_MemoryAccessJNI_free(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&free; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_MemoryAccessJNI_aligned_1alloc(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&__aligned_alloc; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_MemoryAccessJNI_aligned_1free(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&__aligned_free; -} - -JNIEXPORT jbyte JNICALL Java_org_lwjgl_system_MemoryAccessJNI_ngetByte(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - return (jbyte)getByte(ptr); -} - -JNIEXPORT jshort JNICALL Java_org_lwjgl_system_MemoryAccessJNI_ngetShort(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - return (jshort)getShort(ptr); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_MemoryAccessJNI_ngetInt(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)getInt(ptr); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_MemoryAccessJNI_ngetLong(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)getLong(ptr); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_system_MemoryAccessJNI_ngetFloat(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - return (jfloat)getFloat(ptr); -} - -JNIEXPORT jdouble JNICALL Java_org_lwjgl_system_MemoryAccessJNI_ngetDouble(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - return (jdouble)getDouble(ptr); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_MemoryAccessJNI_ngetAddress(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)getAddress(ptr); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_MemoryAccessJNI_nputByte(JNIEnv *__env, jclass clazz, jlong ptrAddress, jbyte value) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - putByte(ptr, (int8_t)value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_MemoryAccessJNI_nputShort(JNIEnv *__env, jclass clazz, jlong ptrAddress, jshort value) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - putShort(ptr, (int16_t)value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_MemoryAccessJNI_nputInt(JNIEnv *__env, jclass clazz, jlong ptrAddress, jint value) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - putInt(ptr, (int32_t)value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_MemoryAccessJNI_nputLong(JNIEnv *__env, jclass clazz, jlong ptrAddress, jlong value) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - putLong(ptr, (int64_t)value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_MemoryAccessJNI_nputFloat(JNIEnv *__env, jclass clazz, jlong ptrAddress, jfloat value) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - putFloat(ptr, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_MemoryAccessJNI_nputDouble(JNIEnv *__env, jclass clazz, jlong ptrAddress, jdouble value) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - putDouble(ptr, value); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_MemoryAccessJNI_nputAddress(JNIEnv *__env, jclass clazz, jlong ptrAddress, jlong value) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - putAddress(ptr, (uintptr_t)value); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_MemoryUtil.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_MemoryUtil.c deleted file mode 100644 index 881c6fcc..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_MemoryUtil.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ -#include "common_tools.h" - -EXTERN_C_ENTER - -// memGlobalRefToObject(J)Ljava/lang/Object; -JNIEXPORT jobject JNICALL Java_org_lwjgl_system_MemoryUtil_memGlobalRefToObject(JNIEnv *env, jclass clazz, - jlong globalRef -) { - UNUSED_PARAMS(env, clazz) - return (jobject)(uintptr_t)globalRef; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_SharedLibraryUtil.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_SharedLibraryUtil.c deleted file mode 100644 index e387b873..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_SharedLibraryUtil.c +++ /dev/null @@ -1,349 +0,0 @@ -// dyncall's dynload JNIfied for LWJGL. - -/* - - Package: dyncall - Library: autovar - File: autovar/autovar_OS.h - Description: - License: - - Copyright (c) 2011-2018 Daniel Adler , - Tassilo Philipp - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -*/ - -#ifndef AUTOVAR_OS_H -#define AUTOVAR_OS_H - -#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) -# define OS_Win64 -#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(__WINDOWS__) || defined(_WINDOWS) -# define OS_Win32 -#elif defined(__APPLE__) || defined(__Darwin__) -# define OS_Darwin -# if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) -# define OS_IOS -# else /* defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) */ -# define OS_MacOSX -# endif -#elif defined(__linux__) || defined(__linux) || defined(__gnu_linux__) -# define OS_Linux -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* latter is (also) used by systems using FreeBSD kernel, e.g. Debian/kFreeBSD, which could be detected specifically by also checking for __GLIBC__ */ -# define OS_FreeBSD -#elif defined(__OpenBSD__) -# define OS_OpenBSD -#elif defined(__NetBSD__) -# define OS_NetBSD -#elif defined(__DragonFly__) -# define OS_DragonFlyBSD -#elif defined(__sun__) || defined(__sun) || defined(sun) -# define OS_SunOS -#elif defined(__CYGWIN__) -# define OS_Cygwin -#elif defined(__MINGW__) -# define OS_MinGW -#elif defined(__nds__) -# define OS_NDS -#elif defined(__psp__) || defined(PSP) -# define OS_PSP -#elif defined(__HAIKU__) || defined(__BEOS__) -# define OS_BeOS -#elif defined(Plan9) || defined(__Plan9__) -# define OS_Plan9 -#elif defined(__vms) -# define OS_VMS -#elif defined(__minix) -# define OS_Minix -#else -# define OS_Unknown -#endif - -/** Platforms. */ - -#if defined(__ANDROID__) -# define OS_Android -#endif - -#endif /* AUTOVAR_OS */ - -/* - - Package: dyncall - Library: dynload - File: dynload/dynload_unix.c - Description: - License: - - Copyright (c) 2007-2018 Daniel Adler , - Tassilo Philipp - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -*/ - - -/* - - dynload_unix.c - - dynload module for .so (unix) and .dylib (mach-o darwin/OS X) files - -*/ - - -#include "common_tools.h" - -#include - -#if defined(__GLIBC__) -/* @@@ version check glibc more precisely... dl_iterate_phdr(): glibc ver >= 2.2.4*/ -# if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 3) -# define DL_USE_GLIBC_ITER_PHDR -# endif -/* to access dl_iterate_phdr(), and related w/ glibc */ -# ifndef _GNU_SOURCE -# define _GNU_SOURCE -# define __USE_GNU -# endif -#endif - -#include - - -/* for dlopen-based dlGetLibraryPath impls below, prefer RTLD_NOLOAD that - * merely checks lib names */ -#if defined(RTLD_NOLOAD) -# define RTLD_LIGHTEST RTLD_LAZY|RTLD_NOLOAD -#else -# define RTLD_LIGHTEST RTLD_LAZY -#endif - - -/* helper copying string if buffer big enough, returning length (without \0) */ -static int dl_strlen_strcpy(char* dst, const char* src, int dstSize) -{ - int l = strlen(src); - if(l < dstSize) /* l+'\0' <= bufSize */ - strcpy(dst, src); - return l; -} - -/* code for dlGetLibraryPath() is platform specific */ - -/* if dlinfo() exists use it (except on glibc, where it exists since version - * 2.3.3, but its implementation is dangerous, as no checks are done whether - * the handle is valid, thus rendering the returned values useless) check for - * RTLD_DI_LINKMAP and RTLD_SELF, which are #defines used by dlinfo() on most - * supported targets, or specifically check the OS (e.g. dlinfo() is originally - * from Solaris) */ -#if ((defined(RTLD_DI_LINKMAP) && defined(RTLD_SELF)) || defined(OS_SunOS)) && !defined(DL_USE_GLIBC_ITER_PHDR) - -#include - -EXTERN_C_ENTER - -JNIEXPORT int JNICALL Java_org_lwjgl_system_SharedLibraryUtil_getLibraryPath(JNIEnv *env, jclass clazz, jlong pLibAddress, jlong sOutAddress, int bufSize) -{ - UNUSED_PARAMS(env, clazz) - void *pLib = (void *)(uintptr_t)pLibAddress; - char *sOut = (char *)(uintptr_t)sOutAddress; - - struct link_map* p = NULL; - int l = -1; - if(dlinfo(pLib ? pLib : RTLD_SELF, RTLD_DI_LINKMAP, &p) == 0) - l = dl_strlen_strcpy(sOut, p->l_name, bufSize); - - return l+1; /* strlen + '\0' */ -} - -EXTERN_C_EXIT - -/* specific implementation needed on Darwin -----> */ -#elif defined(OS_Darwin) - -#include -#include - -EXTERN_C_ENTER - -JNIEXPORT int JNICALL Java_org_lwjgl_system_SharedLibraryUtil_getLibraryPath(JNIEnv *env, jclass clazz, jlong pLibAddress, jlong sOutAddress, jint bufSize) -{ - UNUSED_PARAMS(env, clazz) - void *pLib = (void *)(uintptr_t)pLibAddress; - char *sOut = (char *)(uintptr_t)sOutAddress; - - uint32_t i; - int l = -1; - - UNUSED_PARAMS(env, clazz) - - /* request info about own process? lookup first loaded image */ - if(pLib == NULL) { - const char* libPath = _dyld_get_image_name(0); //@@@ consider using _NSGetExecutablePath() - if(libPath) - l = dl_strlen_strcpy(sOut, libPath, bufSize); - } - else { - /* Darwin's code doesn't come with (non-standard) dlinfo(), so use dyld(1) - * code. There doesn't seem to be a direct way to query the library path, - * so "double-load" temporarily all already loaded images (just increases - * ref count) and compare handles until we found ours. Return the name. */ - for(i=_dyld_image_count(); i>0;) /* backwards, ours is more likely at end */ - { - const char* libPath = _dyld_get_image_name(--i); - void* lib = dlopen(libPath, RTLD_LIGHTEST); - if(lib) { - dlclose(lib); - - /* compare handle pointers' high bits (in low 2 bits some flags might */ - /* be stored - should be safe b/c address needs alignment, anyways) */ - if(((uintptr_t)pLib ^ (uintptr_t)lib) < 4) { - l = dl_strlen_strcpy(sOut, libPath, bufSize); - break; - } - } - } - } - - return l+1; /* strlen + '\0' */ -} - -EXTERN_C_EXIT - - -/* - OpenBSD >= 3.7 has dl_iterate_phdr(), as well as glibc >= 2.2.4 - - also some libc impls (like musl) provide dlinfo(), but not RTLD_SELF (see above), however they might come - with dl_iterate_phdr (which comes from ELF program header iteration), so base it on that - - skip and use dladdr()-based guessing (see below) if explicitly requested, e.g. by ./configure */ -#elif !defined(DL_DLADDR_TO_LIBPATH) && (defined(OS_OpenBSD) || defined(DL_USE_GLIBC_ITER_PHDR) || (!defined(RTLD_SELF) && defined(__ELF__))) - -#include -#include - -typedef struct { - void* pLib; - char* sOut; - int bufSize; -} iter_phdr_data; - -static int iter_phdr_cb(struct dl_phdr_info* info, size_t size, void* data) -{ - UNUSED_PARAM(size); - int l = -1; - iter_phdr_data* d = (iter_phdr_data*)data; - void* lib = NULL; - - /* get loaded object's handle if not requesting info about process itself */ - if(d->pLib != NULL) { - /* unable to relate info->dlpi_addr directly to our dlopen handle, let's - * do what we do on macOS above, re-dlopen the already loaded lib (just - * increases ref count) and compare handles */ - /* @@@ might be b/c it's the reloc addr... see below */ - lib = dlopen(info->dlpi_name, RTLD_LIGHTEST); - if(lib) - dlclose(lib); - } - - /* compare handles and get name if found; if d->pLib == NULL this will - enter info on first iterated object, which is the process itself */ - if(lib == (void*)d->pLib) { - l = dl_strlen_strcpy(d->sOut, info->dlpi_name, d->bufSize); - - /* if dlpi_name is empty, lookup name via dladdr(proc_load_addr, ...) */ - if(l == 0 && d->pLib == NULL) { - /* dlpi_addr is the reloc base (0 if PIE), find real virtual load addr */ - void* vladdr = (void*)info->dlpi_addr; - int i = 0; - for(; i < info->dlpi_phnum; ++i) { - if(info->dlpi_phdr[i].p_type == PT_LOAD) { - vladdr = (void*)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr); - break; - } - } - Dl_info di; - if(dladdr(vladdr, &di) != 0) - l = dl_strlen_strcpy(d->sOut, di.dli_fname, d->bufSize); - } - } - - return l+1; /* strlen + '\0'; is 0 if lib not found, which continues iter */ -} - -EXTERN_C_ENTER - -JNIEXPORT int JNICALL Java_org_lwjgl_system_SharedLibraryUtil_getLibraryPath(JNIEnv *env, jclass clazz, jlong pLibAddress, jlong sOutAddress, jint bufSize) -{ - UNUSED_PARAMS(env, clazz) - void *pLib = (void *)(uintptr_t)pLibAddress; - char *sOut = (char *)(uintptr_t)sOutAddress; - - iter_phdr_data d = { pLib, sOut, bufSize }; - return dl_iterate_phdr(iter_phdr_cb, &d); -} - -EXTERN_C_EXIT - -/* glibc with neither dl_iterate_phdr() nor dlinfo() (latter introduced after former) @@@ -#elif defined(__GLIBC__) && !defined(DL_USE_GLIBC_ITER_PHDR) - -@@@impl */ - -/* fallback to dladdr() hack */ -#else - -#warning "Using non-optimal code for dlGetLibraryPath() b/c of platform limitations." - -/* if nothing else is available, fall back to guessing using dladdr() - this */ -/* might not always work, as it's trying to getit via the _fini() symbol, */ -/* which is usually defined in ELF files, but not guaranteed */ - -/* @@@Note: On some platforms this might be improved, e.g. on BeOS we have */ -/* lt_dlgetinfo, which requires iterating over ltdl stuff, but was unable */ -/* to get that to work (would also introduce a link dependency on libltdl) */ - -EXTERN_C_ENTER - -JNIEXPORT int JNICALL Java_org_lwjgl_system_SharedLibraryUtil_getLibraryPath(JNIEnv *env, jclass clazz, jlong pLibAddress, jlong sOutAddress, jint bufSize) -{ - UNUSED_PARAMS(env, clazz) - void *pLib = (void *)(uintptr_t)pLibAddress; - char *sOut = (char *)(uintptr_t)sOutAddress; - -/*@@@ missing handler for pLib == NULL*/ - /* cross fingers that shared object is standard ELF and look for _fini */ - int l = -1; - void* s = dlsym((void*)pLib, "_fini"); - if(s) { - Dl_info i; - if(dladdr(s, &i) != 0) - l = dl_strlen_strcpy(sOut, i.dli_fname, bufSize); - } - return l+1; /* strlen + '\0' */ -} - -EXTERN_C_EXIT - -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_ThreadLocalUtil.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_ThreadLocalUtil.c deleted file mode 100644 index b771d345..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_ThreadLocalUtil.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - */ -#include "common_tools.h" -#include - -static void JNICALL functionMissingAbort(void) { -} - -EXTERN_C_ENTER - -// getThreadJNIEnv()J -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_ThreadLocalUtil_getThreadJNIEnv(JNIEnv *env, jclass clazz) { - UNUSED_PARAM(clazz) - - return (jlong)(uintptr_t)env; -} - -// getFunctionMissingAbort()J -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_ThreadLocalUtil_getFunctionMissingAbort(JNIEnv *env, jclass clazz) { - UNUSED_PARAMS(env, clazz) - return (jlong)(uintptr_t)functionMissingAbort; -} - -extern EnvData* tlsCreateEnvDataWithCopy(JNIEnv* env); -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_ThreadLocalUtil_nsetupEnvData(JNIEnv *env, jclass clazz, jint functionCount) { - UNUSED_PARAM(clazz) - - void *envCopy = malloc(functionCount * sizeof(void *)); - memcpy(envCopy, *env, functionCount * sizeof(void *)); - *(void **)env = envCopy; - - return (jlong)(uintptr_t)tlsCreateEnvDataWithCopy(env); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_jni_JNINativeInterface.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_jni_JNINativeInterface.c deleted file mode 100644 index c5a3a355..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_jni_JNINativeInterface.c +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_GetVersion(JNIEnv *__env, jclass clazz) { - UNUSED_PARAM(clazz) - return (*__env)->GetVersion(__env); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_FromReflectedMethod(JNIEnv *__env, jclass clazz, jobject method) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->FromReflectedMethod(__env, method); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_FromReflectedField(JNIEnv *__env, jclass clazz, jobject field) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->FromReflectedField(__env, field); -} - -JNIEXPORT jobject JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nToReflectedMethod(JNIEnv *__env, jclass clazz, jclass cls, jlong methodIDAddress, jboolean isStatic) { - jmethodID methodID = (jmethodID)(uintptr_t)methodIDAddress; - UNUSED_PARAM(clazz) - return (*__env)->ToReflectedMethod(__env, cls, methodID, isStatic); -} - -JNIEXPORT jobject JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nToReflectedField(JNIEnv *__env, jclass clazz, jclass cls, jlong fieldIDAddress, jboolean isStatic) { - jfieldID fieldID = (jfieldID)(uintptr_t)fieldIDAddress; - UNUSED_PARAM(clazz) - return (*__env)->ToReflectedField(__env, cls, fieldID, isStatic); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_NewGlobalRef(JNIEnv *__env, jclass clazz, jobject obj) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->NewGlobalRef(__env, obj); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nDeleteGlobalRef(JNIEnv *__env, jclass clazz, jlong globalRefAddress) { - void *globalRef = (void *)(uintptr_t)globalRefAddress; - UNUSED_PARAM(clazz) - (*__env)->DeleteGlobalRef(__env, globalRef); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetBooleanArrayElements(JNIEnv *__env, jclass clazz, jbooleanArray array, jlong isCopyAddress) { - jboolean *isCopy = (jboolean *)(uintptr_t)isCopyAddress; - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetBooleanArrayElements(__env, array, isCopy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nReleaseBooleanArrayElements(JNIEnv *__env, jclass clazz, jbooleanArray array, jlong elemsAddress, jint mode) { - jboolean *elems = (jboolean *)(uintptr_t)elemsAddress; - UNUSED_PARAM(clazz) - (*__env)->ReleaseBooleanArrayElements(__env, array, elems, mode); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetByteArrayElements(JNIEnv *__env, jclass clazz, jbyteArray array, jlong isCopyAddress) { - jboolean *isCopy = (jboolean *)(uintptr_t)isCopyAddress; - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetByteArrayElements(__env, array, isCopy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nReleaseByteArrayElements(JNIEnv *__env, jclass clazz, jbyteArray array, jlong elemsAddress, jint mode) { - jbyte *elems = (jbyte *)(uintptr_t)elemsAddress; - UNUSED_PARAM(clazz) - (*__env)->ReleaseByteArrayElements(__env, array, elems, mode); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetCharArrayElements(JNIEnv *__env, jclass clazz, jcharArray array, jlong isCopyAddress) { - jboolean *isCopy = (jboolean *)(uintptr_t)isCopyAddress; - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetCharArrayElements(__env, array, isCopy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nReleaseCharArrayElements(JNIEnv *__env, jclass clazz, jcharArray array, jlong elemsAddress, jint mode) { - jchar *elems = (jchar *)(uintptr_t)elemsAddress; - UNUSED_PARAM(clazz) - (*__env)->ReleaseCharArrayElements(__env, array, elems, mode); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetShortArrayElements(JNIEnv *__env, jclass clazz, jshortArray array, jlong isCopyAddress) { - jboolean *isCopy = (jboolean *)(uintptr_t)isCopyAddress; - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetShortArrayElements(__env, array, isCopy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nReleaseShortArrayElements(JNIEnv *__env, jclass clazz, jshortArray array, jlong elemsAddress, jint mode) { - jshort *elems = (jshort *)(uintptr_t)elemsAddress; - UNUSED_PARAM(clazz) - (*__env)->ReleaseShortArrayElements(__env, array, elems, mode); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetIntArrayElements(JNIEnv *__env, jclass clazz, jintArray array, jlong isCopyAddress) { - jboolean *isCopy = (jboolean *)(uintptr_t)isCopyAddress; - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetIntArrayElements(__env, array, isCopy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nReleaseIntArrayElements(JNIEnv *__env, jclass clazz, jintArray array, jlong elemsAddress, jint mode) { - jint *elems = (jint *)(uintptr_t)elemsAddress; - UNUSED_PARAM(clazz) - (*__env)->ReleaseIntArrayElements(__env, array, elems, mode); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetLongArrayElements(JNIEnv *__env, jclass clazz, jlongArray array, jlong isCopyAddress) { - jboolean *isCopy = (jboolean *)(uintptr_t)isCopyAddress; - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetLongArrayElements(__env, array, isCopy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nReleaseLongArrayElements(JNIEnv *__env, jclass clazz, jlongArray array, jlong elemsAddress, jint mode) { - jlong *elems = (jlong *)(uintptr_t)elemsAddress; - UNUSED_PARAM(clazz) - (*__env)->ReleaseLongArrayElements(__env, array, elems, mode); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetFloatArrayElements(JNIEnv *__env, jclass clazz, jfloatArray array, jlong isCopyAddress) { - jboolean *isCopy = (jboolean *)(uintptr_t)isCopyAddress; - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetFloatArrayElements(__env, array, isCopy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nReleaseFloatArrayElements(JNIEnv *__env, jclass clazz, jfloatArray array, jlong elemsAddress, jint mode) { - jfloat *elems = (jfloat *)(uintptr_t)elemsAddress; - UNUSED_PARAM(clazz) - (*__env)->ReleaseFloatArrayElements(__env, array, elems, mode); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetDoubleArrayElements(JNIEnv *__env, jclass clazz, jdoubleArray array, jlong isCopyAddress) { - jboolean *isCopy = (jboolean *)(uintptr_t)isCopyAddress; - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetDoubleArrayElements(__env, array, isCopy); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nReleaseDoubleArrayElements(JNIEnv *__env, jclass clazz, jdoubleArray array, jlong elemsAddress, jint mode) { - jdouble *elems = (jdouble *)(uintptr_t)elemsAddress; - UNUSED_PARAM(clazz) - (*__env)->ReleaseDoubleArrayElements(__env, array, elems, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetBooleanArrayRegion(JNIEnv *__env, jclass clazz, jbooleanArray array, jint start, jint len, jlong bufAddress) { - jboolean *buf = (jboolean *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetBooleanArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nSetBooleanArrayRegion(JNIEnv *__env, jclass clazz, jbooleanArray array, jint start, jint len, jlong bufAddress) { - jboolean const *buf = (jboolean const *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->SetBooleanArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetByteArrayRegion(JNIEnv *__env, jclass clazz, jbyteArray array, jint start, jint len, jlong bufAddress) { - jbyte *buf = (jbyte *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetByteArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nSetByteArrayRegion(JNIEnv *__env, jclass clazz, jbyteArray array, jint start, jint len, jlong bufAddress) { - jbyte const *buf = (jbyte const *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->SetByteArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetCharArrayRegion(JNIEnv *__env, jclass clazz, jcharArray array, jint start, jint len, jlong bufAddress) { - jchar *buf = (jchar *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetCharArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nSetCharArrayRegion(JNIEnv *__env, jclass clazz, jcharArray array, jint start, jint len, jlong bufAddress) { - jchar const *buf = (jchar const *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->SetCharArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetShortArrayRegion(JNIEnv *__env, jclass clazz, jshortArray array, jint start, jint len, jlong bufAddress) { - jshort *buf = (jshort *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetShortArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nSetShortArrayRegion(JNIEnv *__env, jclass clazz, jshortArray array, jint start, jint len, jlong bufAddress) { - jshort const *buf = (jshort const *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->SetShortArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetIntArrayRegion(JNIEnv *__env, jclass clazz, jintArray array, jint start, jint len, jlong bufAddress) { - jint *buf = (jint *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetIntArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nSetIntArrayRegion(JNIEnv *__env, jclass clazz, jintArray array, jint start, jint len, jlong bufAddress) { - jint const *buf = (jint const *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->SetIntArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetLongArrayRegion(JNIEnv *__env, jclass clazz, jlongArray array, jint start, jint len, jlong bufAddress) { - jlong *buf = (jlong *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetLongArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nSetLongArrayRegion(JNIEnv *__env, jclass clazz, jlongArray array, jint start, jint len, jlong bufAddress) { - jlong const *buf = (jlong const *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->SetLongArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetFloatArrayRegion(JNIEnv *__env, jclass clazz, jfloatArray array, jint start, jint len, jlong bufAddress) { - jfloat *buf = (jfloat *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetFloatArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nSetFloatArrayRegion(JNIEnv *__env, jclass clazz, jfloatArray array, jint start, jint len, jlong bufAddress) { - jfloat const *buf = (jfloat const *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->SetFloatArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetDoubleArrayRegion(JNIEnv *__env, jclass clazz, jdoubleArray array, jint start, jint len, jlong bufAddress) { - jdouble *buf = (jdouble *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetDoubleArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nSetDoubleArrayRegion(JNIEnv *__env, jclass clazz, jdoubleArray array, jint start, jint len, jlong bufAddress) { - jdouble const *buf = (jdouble const *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->SetDoubleArrayRegion(__env, array, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nRegisterNatives(JNIEnv *__env, jclass clazz, jclass targetClass, jlong methodsAddress, jint nMethods) { - JNINativeMethod const *methods = (JNINativeMethod const *)(uintptr_t)methodsAddress; - UNUSED_PARAM(clazz) - return (*__env)->RegisterNatives(__env, targetClass, methods, nMethods); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_UnregisterNatives(JNIEnv *__env, jclass clazz, jclass targetClass) { - UNUSED_PARAM(clazz) - return (*__env)->UnregisterNatives(__env, targetClass); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetJavaVM(JNIEnv *__env, jclass clazz, jlong vmAddress) { - JavaVM **vm = (JavaVM **)(uintptr_t)vmAddress; - UNUSED_PARAM(clazz) - return (*__env)->GetJavaVM(__env, vm); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetStringRegion(JNIEnv *__env, jclass clazz, jstring str, jint start, jint len, jlong bufAddress) { - jchar *buf = (jchar *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetStringRegion(__env, str, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nGetStringUTFRegion(JNIEnv *__env, jclass clazz, jstring str, jint start, jint len, jlong bufAddress) { - char *buf = (char *)(uintptr_t)bufAddress; - UNUSED_PARAM(clazz) - (*__env)->GetStringUTFRegion(__env, str, (jsize)start, (jsize)len, buf); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_NewWeakGlobalRef(JNIEnv *__env, jclass clazz, jobject obj) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->NewWeakGlobalRef(__env, obj); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nDeleteWeakGlobalRef(JNIEnv *__env, jclass clazz, jlong weakGlobalRefAddress) { - void *weakGlobalRef = (void *)(uintptr_t)weakGlobalRefAddress; - UNUSED_PARAM(clazz) - (*__env)->DeleteWeakGlobalRef(__env, weakGlobalRef); -} - -JNIEXPORT jobject JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_nNewDirectByteBuffer(JNIEnv *__env, jclass clazz, jlong addressAddress, jlong capacity) { - void *address = (void *)(uintptr_t)addressAddress; - UNUSED_PARAM(clazz) - return (*__env)->NewDirectByteBuffer(__env, address, capacity); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_GetDirectBufferAddress(JNIEnv *__env, jclass clazz, jobject buf) { - UNUSED_PARAM(clazz) - return (jlong)(uintptr_t)(*__env)->GetDirectBufferAddress(__env, buf); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_GetObjectRefType(JNIEnv *__env, jclass clazz, jobject obj) { - UNUSED_PARAM(clazz) - return (jint)(*__env)->GetObjectRefType(__env, obj); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_jni_JNINativeInterface_noop(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCErrno.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCErrno.c deleted file mode 100644 index 16f5e699..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCErrno.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" -#include - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCErrno_errno(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)errno; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCErrno_getErrno(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - EnvData *envData = (EnvData *)(*__env)->reserved2; - return envData == (*__env)->reserved0 ? 0 : envData->errnum; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCLocale.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCLocale.c deleted file mode 100644 index 99857903..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCLocale.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" -#include - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCLocale_LC_1ALL(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)LC_ALL; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCLocale_LC_1COLLATE(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)LC_COLLATE; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCLocale_LC_1CTYPE(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)LC_CTYPE; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCLocale_LC_1MONETARY(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)LC_MONETARY; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCLocale_LC_1NUMERIC(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)LC_NUMERIC; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCLocale_LC_1TIME(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)LC_TIME; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCLocale_nsetlocale(JNIEnv *__env, jclass clazz, jint category, jlong localeAddress) { - char const *locale = (char const *)(uintptr_t)localeAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)setlocale(category, locale); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCStdio.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCStdio.c deleted file mode 100644 index 65943c73..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCStdio.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#ifdef LWJGL_WINDOWS - #define _CRT_SECURE_NO_WARNINGS -#endif -#include "common_tools.h" -#include - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCStdio_sscanf(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)sscanf; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCStdio_nvsscanf(JNIEnv *__env, jclass clazz, jlong bufferAddress, jlong formatAddress, jlong vlistAddress) { - char const *buffer = (char const *)(uintptr_t)bufferAddress; - char const *format = (char const *)(uintptr_t)formatAddress; - va_list *vlist = VA_LIST_CAST(uintptr_t)vlistAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)vsscanf(buffer, format, *vlist); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCStdio_snprintf(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)snprintf; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libc_LibCStdio_nvsnprintf(JNIEnv *__env, jclass clazz, jlong bufferAddress, jlong buf_size, jlong formatAddress, jlong vlistAddress) { - char *buffer = (char *)(uintptr_t)bufferAddress; - char const *format = (char const *)(uintptr_t)formatAddress; - va_list *vlist = VA_LIST_CAST(uintptr_t)vlistAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)vsnprintf(buffer, (size_t)buf_size, format, *vlist); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCStdlib.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCStdlib.c deleted file mode 100644 index d5d5560c..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCStdlib.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" -#include -#ifdef LWJGL_WINDOWS - #define __aligned_alloc(alignment, size) _aligned_malloc(size, alignment) - #define __aligned_free _aligned_free -#else - #if defined(__USE_ISOC11) - #define __aligned_alloc aligned_alloc - #else - inline void* __aligned_alloc(size_t alignment, size_t size) { - void *p; - return posix_memalign(&p, alignment, size) ? NULL : p; - } - #endif - #define __aligned_free free -#endif - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCStdlib_nmalloc(JNIEnv *__env, jclass clazz, jlong size) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)malloc((size_t)size); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCStdlib_ncalloc(JNIEnv *__env, jclass clazz, jlong nmemb, jlong size) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)calloc((size_t)nmemb, (size_t)size); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCStdlib_nrealloc(JNIEnv *__env, jclass clazz, jlong ptrAddress, jlong size) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)realloc(ptr, (size_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_libc_LibCStdlib_nfree(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - free(ptr); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCStdlib_naligned_1alloc(JNIEnv *__env, jclass clazz, jlong alignment, jlong size) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)__aligned_alloc((size_t)alignment, (size_t)size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_libc_LibCStdlib_naligned_1free(JNIEnv *__env, jclass clazz, jlong ptrAddress) { - void *ptr = (void *)(uintptr_t)ptrAddress; - UNUSED_PARAMS(__env, clazz) - __aligned_free(ptr); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCString.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCString.c deleted file mode 100644 index 9acc6f3a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libc_LibCString.c +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#ifdef LWJGL_WINDOWS - #define _CRT_SECURE_NO_WARNINGS -#endif -#include "common_tools.h" -#include - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemset__JIJ(JNIEnv *__env, jclass clazz, jlong destAddress, jint c, jlong count) { - void *dest = (void *)(uintptr_t)destAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)memset(dest, c, (size_t)count); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemcpy__JJJ(JNIEnv *__env, jclass clazz, jlong destAddress, jlong srcAddress, jlong count) { - void *dest = (void *)(uintptr_t)destAddress; - void const *src = (void const *)(uintptr_t)srcAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)memcpy(dest, src, (size_t)count); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemmove__JJJ(JNIEnv *__env, jclass clazz, jlong destAddress, jlong srcAddress, jlong count) { - void *dest = (void *)(uintptr_t)destAddress; - void const *src = (void const *)(uintptr_t)srcAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)memmove(dest, src, (size_t)count); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nstrlen(JNIEnv *__env, jclass clazz, jlong strAddress) { - char const *str = (char const *)(uintptr_t)strAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)strlen(str); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nstrerror(JNIEnv *__env, jclass clazz, jint errnum) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)strerror(errnum); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemset___3BIJ(JNIEnv *__env, jclass clazz, jbyteArray destAddress, jint c, jlong count) { - jlong __result; - jbyte *dest = (*__env)->GetByteArrayElements(__env, destAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memset((void *)dest, c, (size_t)count); - (*__env)->ReleaseByteArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemset___3SIJ(JNIEnv *__env, jclass clazz, jshortArray destAddress, jint c, jlong count) { - jlong __result; - jshort *dest = (*__env)->GetShortArrayElements(__env, destAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memset((void *)dest, c, (size_t)count); - (*__env)->ReleaseShortArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemset___3IIJ(JNIEnv *__env, jclass clazz, jintArray destAddress, jint c, jlong count) { - jlong __result; - jint *dest = (*__env)->GetIntArrayElements(__env, destAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memset((void *)dest, c, (size_t)count); - (*__env)->ReleaseIntArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemset___3JIJ(JNIEnv *__env, jclass clazz, jlongArray destAddress, jint c, jlong count) { - jlong __result; - jlong *dest = (*__env)->GetLongArrayElements(__env, destAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memset((void *)dest, c, (size_t)count); - (*__env)->ReleaseLongArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemset___3FIJ(JNIEnv *__env, jclass clazz, jfloatArray destAddress, jint c, jlong count) { - jlong __result; - jfloat *dest = (*__env)->GetFloatArrayElements(__env, destAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memset((void *)dest, c, (size_t)count); - (*__env)->ReleaseFloatArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemset___3DIJ(JNIEnv *__env, jclass clazz, jdoubleArray destAddress, jint c, jlong count) { - jlong __result; - jdouble *dest = (*__env)->GetDoubleArrayElements(__env, destAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memset((void *)dest, c, (size_t)count); - (*__env)->ReleaseDoubleArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemcpy___3B_3BJ(JNIEnv *__env, jclass clazz, jbyteArray destAddress, jbyteArray srcAddress, jlong count) { - jlong __result; - jbyte *dest = (*__env)->GetByteArrayElements(__env, destAddress, NULL); - jbyte *src = (*__env)->GetByteArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memcpy((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseByteArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseByteArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemcpy___3S_3SJ(JNIEnv *__env, jclass clazz, jshortArray destAddress, jshortArray srcAddress, jlong count) { - jlong __result; - jshort *dest = (*__env)->GetShortArrayElements(__env, destAddress, NULL); - jshort *src = (*__env)->GetShortArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memcpy((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseShortArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseShortArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemcpy___3I_3IJ(JNIEnv *__env, jclass clazz, jintArray destAddress, jintArray srcAddress, jlong count) { - jlong __result; - jint *dest = (*__env)->GetIntArrayElements(__env, destAddress, NULL); - jint *src = (*__env)->GetIntArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memcpy((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseIntArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseIntArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemcpy___3J_3JJ(JNIEnv *__env, jclass clazz, jlongArray destAddress, jlongArray srcAddress, jlong count) { - jlong __result; - jlong *dest = (*__env)->GetLongArrayElements(__env, destAddress, NULL); - jlong *src = (*__env)->GetLongArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memcpy((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseLongArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseLongArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemcpy___3F_3FJ(JNIEnv *__env, jclass clazz, jfloatArray destAddress, jfloatArray srcAddress, jlong count) { - jlong __result; - jfloat *dest = (*__env)->GetFloatArrayElements(__env, destAddress, NULL); - jfloat *src = (*__env)->GetFloatArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memcpy((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseFloatArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseFloatArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemcpy___3D_3DJ(JNIEnv *__env, jclass clazz, jdoubleArray destAddress, jdoubleArray srcAddress, jlong count) { - jlong __result; - jdouble *dest = (*__env)->GetDoubleArrayElements(__env, destAddress, NULL); - jdouble *src = (*__env)->GetDoubleArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memcpy((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseDoubleArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseDoubleArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemmove___3B_3BJ(JNIEnv *__env, jclass clazz, jbyteArray destAddress, jbyteArray srcAddress, jlong count) { - jlong __result; - jbyte *dest = (*__env)->GetByteArrayElements(__env, destAddress, NULL); - jbyte *src = (*__env)->GetByteArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memmove((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseByteArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseByteArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemmove___3S_3SJ(JNIEnv *__env, jclass clazz, jshortArray destAddress, jshortArray srcAddress, jlong count) { - jlong __result; - jshort *dest = (*__env)->GetShortArrayElements(__env, destAddress, NULL); - jshort *src = (*__env)->GetShortArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memmove((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseShortArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseShortArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemmove___3I_3IJ(JNIEnv *__env, jclass clazz, jintArray destAddress, jintArray srcAddress, jlong count) { - jlong __result; - jint *dest = (*__env)->GetIntArrayElements(__env, destAddress, NULL); - jint *src = (*__env)->GetIntArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memmove((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseIntArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseIntArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemmove___3J_3JJ(JNIEnv *__env, jclass clazz, jlongArray destAddress, jlongArray srcAddress, jlong count) { - jlong __result; - jlong *dest = (*__env)->GetLongArrayElements(__env, destAddress, NULL); - jlong *src = (*__env)->GetLongArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memmove((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseLongArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseLongArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemmove___3F_3FJ(JNIEnv *__env, jclass clazz, jfloatArray destAddress, jfloatArray srcAddress, jlong count) { - jlong __result; - jfloat *dest = (*__env)->GetFloatArrayElements(__env, destAddress, NULL); - jfloat *src = (*__env)->GetFloatArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memmove((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseFloatArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseFloatArrayElements(__env, destAddress, dest, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libc_LibCString_nmemmove___3D_3DJ(JNIEnv *__env, jclass clazz, jdoubleArray destAddress, jdoubleArray srcAddress, jlong count) { - jlong __result; - jdouble *dest = (*__env)->GetDoubleArrayElements(__env, destAddress, NULL); - jdouble *src = (*__env)->GetDoubleArrayElements(__env, srcAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)memmove((void *)dest, (void const *)src, (size_t)count); - (*__env)->ReleaseDoubleArrayElements(__env, srcAddress, src, 0); - (*__env)->ReleaseDoubleArrayElements(__env, destAddress, dest, 0); - return __result; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_FFICIF.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_FFICIF.c deleted file mode 100644 index d948727f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_FFICIF.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" -#include - -DISABLE_WARNINGS() -#include "ffi.h" -ENABLE_WARNINGS() -#ifdef LWJGL_WINDOWS - #define alignof __alignof -#else - #include -#endif - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_FFICIF_offsets(JNIEnv *__env, jclass clazz, jlong bufferAddress) { - jint *buffer = (jint *)(uintptr_t)bufferAddress; - - UNUSED_PARAMS(__env, clazz) - - buffer[0] = (jint)offsetof(ffi_cif, abi); - buffer[1] = (jint)offsetof(ffi_cif, nargs); - buffer[2] = (jint)offsetof(ffi_cif, arg_types); - buffer[3] = (jint)offsetof(ffi_cif, rtype); - buffer[4] = (jint)offsetof(ffi_cif, bytes); - buffer[5] = (jint)offsetof(ffi_cif, flags); - - buffer[6] = alignof(ffi_cif); - - return sizeof(ffi_cif); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_FFIClosure.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_FFIClosure.c deleted file mode 100644 index 9f3305d9..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_FFIClosure.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" -#include - -DISABLE_WARNINGS() -#include "ffi.h" -ENABLE_WARNINGS() -#ifdef LWJGL_WINDOWS - #define alignof __alignof -#else - #include -#endif - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_FFIClosure_offsets(JNIEnv *__env, jclass clazz, jlong bufferAddress) { - jint *buffer = (jint *)(uintptr_t)bufferAddress; - - UNUSED_PARAMS(__env, clazz) - - buffer[0] = (jint)offsetof(ffi_closure, cif); - buffer[1] = (jint)offsetof(ffi_closure, fun); - buffer[2] = (jint)offsetof(ffi_closure, user_data); - - buffer[3] = alignof(ffi_closure); - - return sizeof(ffi_closure); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_LibFFI.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_LibFFI.c deleted file mode 100644 index 304d76dd..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_libffi_LibFFI.c +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" - -DISABLE_WARNINGS() -#define FFI_BUILDING -#include "ffi.h" -ENABLE_WARNINGS() -typedef void (*FFI_FN_TYPE)(void); -typedef void (*FFI_CLOSURE_FUN)(ffi_cif*, void*, void**, void*); - -EXTERN_C_ENTER - -JNIEXPORT jshort JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1TYPE_1DOUBLE(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jshort)FFI_TYPE_DOUBLE; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1WIN64(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_WIN64; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1GNUW64(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_GNUW64; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1UNIX64(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_UNIX64; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1EFI64(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_EFI64; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1SYSV(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_SYSV; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1STDCALL(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_STDCALL; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1THISCALL(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_THISCALL; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1FASTCALL(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_FASTCALL; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1MS_1CDECL(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_MS_CDECL; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1PASCAL(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_PASCAL; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1REGISTER(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_REGISTER; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1VFP(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_VFP; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1FIRST_1ABI(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_FIRST_ABI; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1LAST_1ABI(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_LAST_ABI; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_FFI_1DEFAULT_1ABI(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jint)FFI_DEFAULT_ABI; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1void(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_void; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1uint8(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_uint8; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1sint8(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_sint8; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1uint16(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_uint16; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1sint16(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_sint16; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1uint32(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_uint32; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1sint32(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_sint32; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1uint64(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_uint64; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1sint64(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_sint64; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1uchar(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_uchar; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1schar(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_schar; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1ushort(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_ushort; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1sshort(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_sshort; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1uint(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_uint; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1sint(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_sint; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1ulong(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_ulong; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1slong(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_slong; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1float(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_float; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1double(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_double; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1longdouble(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_longdouble; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1type_1pointer(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&ffi_type_pointer; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1prep_1cif(JNIEnv *__env, jclass clazz, jlong cifAddress, jint abi, jint nargs, jlong rtypeAddress, jlong atypesAddress) { - ffi_cif *cif = (ffi_cif *)(uintptr_t)cifAddress; - ffi_type *rtype = (ffi_type *)(uintptr_t)rtypeAddress; - ffi_type **atypes = (ffi_type **)(uintptr_t)atypesAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)ffi_prep_cif(cif, (ffi_abi)abi, (unsigned int)nargs, rtype, atypes); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1prep_1cif_1var(JNIEnv *__env, jclass clazz, jlong cifAddress, jint abi, jint nfixedargs, jint ntotalargs, jlong rtypeAddress, jlong atypesAddress) { - ffi_cif *cif = (ffi_cif *)(uintptr_t)cifAddress; - ffi_type *rtype = (ffi_type *)(uintptr_t)rtypeAddress; - ffi_type **atypes = (ffi_type **)(uintptr_t)atypesAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)ffi_prep_cif_var(cif, (ffi_abi)abi, (unsigned int)nfixedargs, (unsigned int)ntotalargs, rtype, atypes); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1call(JNIEnv *__env, jclass clazz, jlong cifAddress, jlong fnAddress, jlong rvalueAddress, jlong avaluesAddress) { - ffi_cif *cif = (ffi_cif *)(uintptr_t)cifAddress; - FFI_FN_TYPE fn = (FFI_FN_TYPE)(uintptr_t)fnAddress; - void *rvalue = (void *)(uintptr_t)rvalueAddress; - void **avalues = (void **)(uintptr_t)avaluesAddress; - UNUSED_PARAMS(__env, clazz) - ffi_call(cif, fn, rvalue, avalues); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1get_1struct_1offsets(JNIEnv *__env, jclass clazz, jint abi, jlong struct_typeAddress, jlong offsetsAddress) { - ffi_type *struct_type = (ffi_type *)(uintptr_t)struct_typeAddress; - size_t *offsets = (size_t *)(uintptr_t)offsetsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)ffi_get_struct_offsets((ffi_abi)abi, struct_type, offsets); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1closure_1alloc(JNIEnv *__env, jclass clazz, jlong size, jlong codeAddress) { - void **code = (void **)(uintptr_t)codeAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)ffi_closure_alloc((size_t)size, code); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1closure_1free(JNIEnv *__env, jclass clazz, jlong writableAddress) { - ffi_closure *writable = (ffi_closure *)(uintptr_t)writableAddress; - UNUSED_PARAMS(__env, clazz) - ffi_closure_free(writable); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_libffi_LibFFI_nffi_1prep_1closure_1loc(JNIEnv *__env, jclass clazz, jlong closureAddress, jlong cifAddress, jlong funAddress, jlong user_dataAddress, jlong codelocAddress) { - ffi_closure *closure = (ffi_closure *)(uintptr_t)closureAddress; - ffi_cif *cif = (ffi_cif *)(uintptr_t)cifAddress; - FFI_CLOSURE_FUN fun = (FFI_CLOSURE_FUN)(uintptr_t)funAddress; - void *user_data = (void *)(uintptr_t)user_dataAddress; - void *codeloc = (void *)(uintptr_t)codelocAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)ffi_prep_closure_loc(closure, cif, fun, user_data, codeloc); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_linux_DynamicLinkLoader.c b/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_linux_DynamicLinkLoader.c deleted file mode 100644 index 952c1a59..00000000 --- a/FCLauncher/src/main/jni/lwjgl/org_lwjgl_system_linux_DynamicLinkLoader.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "common_tools.h" -#include "FCLLWJGL.h" -#include - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_DynamicLinkLoader_ndlopen(JNIEnv *__env, jclass clazz, jlong filenameAddress, jint mode) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)dlopen(filename, mode); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_DynamicLinkLoader_ndlerror(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)dlerror(); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_system_linux_DynamicLinkLoader_ndlsym(JNIEnv *__env, jclass clazz, jlong handleAddress, jlong nameAddress) { - void *handle = (void *)(uintptr_t)handleAddress; - char const *name = (char const *)(uintptr_t)nameAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)dlsym(handle, name); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_system_linux_DynamicLinkLoader_ndlclose(JNIEnv *__env, jclass clazz, jlong handleAddress) { - void *handle = (void *)(uintptr_t)handleAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)dlclose(handle); -} - -EXTERN_C_EXIT \ No newline at end of file diff --git a/FCLauncher/src/main/jni/lwjgl/oui.h b/FCLauncher/src/main/jni/lwjgl/oui.h deleted file mode 100644 index 8fe110e8..00000000 --- a/FCLauncher/src/main/jni/lwjgl/oui.h +++ /dev/null @@ -1,2033 +0,0 @@ -/* -OUI - A minimal semi-immediate GUI handling & layouting library - -Copyright (c) 2014 Leonard Ritter - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - */ - -#ifndef _OUI_H_ -#define _OUI_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -Revision 4 (2014-12-17) - -OUI (short for "Open UI", spoken like the french "oui" for "yes") is a -platform agnostic single-header C library for layouting GUI elements and -handling related user input. Together with a set of widget drawing and logic -routines it can be used to build complex user interfaces. - -OUI is a semi-immediate GUI. Widget declarations are persistent for the duration -of the setup and evaluation, but do not need to be kept around longer than one -frame. - -OUI has no widget types; instead, it provides only one kind of element, "Items", -which can be tailored to the application by the user and expanded with custom -buffers and event handlers to behave as containers, buttons, sliders, radio -buttons, and so on. - -OUI also does not draw anything; Instead it provides a set of functions to -iterate and query the layouted items in order to allow client code to render -each widget with its current state using a preferred graphics library. - -See example.cpp in the repository for a full usage example. - -A basic setup for OUI usage in C looks like this: -================================================= - -// a header for each widget -typedef struct Data { - int type; - UIhandler handler; -} Data; - -/// global event dispatch -void ui_handler(int item, UIevent event) { - Data *data = (Data *)uiGetHandle(item); - if (data && data->handler) { - data->handler(item, event); - } -} - -void app_main(...) { - UIcontext *context = uiCreateContext(4096, 1<<20); - uiMakeCurrent(context); - uiSetHandler(ui_handler); - - while (app_running()) { - // update position of mouse cursor; the ui can also be updated - // from received events. - uiSetCursor(app_get_mouse_x(), app_get_mouse_y()); - - // update button state - for (int i = 0; i < 3; ++i) - uiSetButton(i, app_get_button_state(i)); - - // you can also send keys and scroll events; see example.cpp for more - - // -------------- - // this section does not have to be regenerated on frame; a good - // policy is to invalidate it on events, as this usually alters - // structure and layout. - - // begin new UI declarations - uiBeginLayout(); - - // - UI setup code goes here - - app_setup_ui(); - - // layout UI - uiEndLayout(); - - // -------------- - - // draw UI, starting with the first item, index 0 - app_draw_ui(render_context,0); - - // update states and fire handlers - uiProcess(get_time_ms()); - } - - uiDestroyContext(context); -} - -Here's an example setup for a checkbox control: -=============================================== - -typedef struct CheckBoxData { - Data head; - const char *label; - bool *checked; -} CheckBoxData; - -// called when the item is clicked (see checkbox()) -void app_checkbox_handler(int item, UIevent event) { - // retrieve custom data (see checkbox()) - CheckBoxData *data = (CheckBoxData *)uiGetHandle(item); - - switch(event) { - default: break; - case UI_BUTTON0_DOWN: { - // toggle value - *data->checked = !(*data->checked); - } break; - } -} - -// creates a checkbox control for a pointer to a boolean -int checkbox(const char *label, bool *checked) { - - // create new ui item - int item = uiItem(); - - // set minimum size of wiget; horizontal size is dynamic, vertical is fixed - uiSetSize(item, 0, APP_WIDGET_HEIGHT); - - // store some custom data with the checkbox that we use for rendering - // and value changes. - CheckBoxData *data = (CheckBoxData *)uiAllocHandle(item, sizeof(CheckBoxData)); - - // assign a custom typeid to the data so the renderer knows how to - // render this control, and our event handler - data->head.type = APP_WIDGET_CHECKBOX; - data->head.handler = app_checkbox_handler; - data->label = label; - data->checked = checked; - - // set to fire as soon as the left button is - // pressed; UI_BUTTON0_HOT_UP is also a popular alternative. - uiSetEvents(item, UI_BUTTON0_DOWN); - - return item; -} - -A simple recursive drawing routine can look like this: -====================================================== - -void app_draw_ui(AppRenderContext *ctx, int item) { - // retrieve custom data and cast it to Data; we assume the first member - // of every widget data item to be a Data field. - Data *head = (Data *)uiGetHandle(item); - - // if a handle is set, this is a specialized widget - if (head) { - // get the widgets absolute rectangle - UIrect rect = uiGetRect(item); - - switch(head->type) { - default: break; - case APP_WIDGET_LABEL: { - // ... - } break; - case APP_WIDGET_BUTTON: { - // ... - } break; - case APP_WIDGET_CHECKBOX: { - // cast to the full data type - CheckBoxData *data = (CheckBoxData*)head; - - // get the widgets current state - int state = uiGetState(item); - - // if the value is set, the state is always active - if (*data->checked) - state = UI_ACTIVE; - - // draw the checkbox - app_draw_checkbox(ctx, rect, state, data->label); - } break; - } - } - - // iterate through all children and draw - int kid = uiFirstChild(item); - while (kid != -1) { - app_draw_ui(ctx, kid); - kid = uiNextSibling(kid); - } -} - -Layouting items works like this: -================================ - -void layout_window(int w, int h) { - // create root item; the first item always has index 0 - int parent = uiItem(); - // assign fixed size - uiSetSize(parent, w, h); - - // create column box and use as new parent - parent = uiInsert(parent, uiItem()); - // configure as column - uiSetBox(parent, UI_COLUMN); - // span horizontally, attach to top - uiSetLayout(parent, UI_HFILL | UI_TOP); - - // add a label - we're assuming custom control functions to exist - int item = uiInsert(parent, label("Hello World")); - // set a fixed height for the label - uiSetSize(item, 0, APP_WIDGET_HEIGHT); - // span the label horizontally - uiSetLayout(item, UI_HFILL); - - static bool checked = false; - - // add a checkbox to the same parent as item; this is faster than - // calling uiInsert on the same parent repeatedly. - item = uiAppend(item, checkbox("Checked:", &checked)); - // set a fixed height for the checkbox - uiSetSize(item, 0, APP_WIDGET_HEIGHT); - // span the checkbox in the same way as the label - uiSetLayout(item, UI_HFILL); -} - - - - */ - -// you can override this from the outside to pick -// the export level you need -#ifndef OUI_EXPORT -#define OUI_EXPORT -#endif - -// some language bindings (e.g. terra) have no good support -// for unions or unnamed structs; -// #define OUI_USE_UNION_VECTORS 0 to disable. -#ifndef OUI_USE_UNION_VECTORS -#define OUI_USE_UNION_VECTORS 1 -#endif - -// limits - -enum { - // maximum size in bytes of a single data buffer passed to uiAllocData(). - UI_MAX_DATASIZE = 4096, - // maximum depth of nested containers - UI_MAX_DEPTH = 64, - // maximum number of buffered input events - UI_MAX_INPUT_EVENTS = 64, - // consecutive click threshold in ms - UI_CLICK_THRESHOLD = 250, -}; - -typedef unsigned int UIuint; - -// opaque UI context -typedef struct UIcontext UIcontext; - -// item states as returned by uiGetState() - -typedef enum UIitemState { - // the item is inactive - UI_COLD = 0, - // the item is inactive, but the cursor is hovering over this item - UI_HOT = 1, - // the item is toggled, activated, focused (depends on item kind) - UI_ACTIVE = 2, - // the item is unresponsive - UI_FROZEN = 3, -} UIitemState; - -// container flags to pass to uiSetBox() -typedef enum UIboxFlags { - // flex-direction (bit 0+1) - - // left to right - UI_ROW = 0x002, - // top to bottom - UI_COLUMN = 0x003, - - // model (bit 1) - - // free layout - UI_LAYOUT = 0x000, - // flex model - UI_FLEX = 0x002, - - // flex-wrap (bit 2) - - // single-line - UI_NOWRAP = 0x000, - // multi-line, wrap left to right - UI_WRAP = 0x004, - - - // justify-content (start, end, center, space-between) - // at start of row/column - UI_START = 0x008, - // at center of row/column - UI_MIDDLE = 0x000, - // at end of row/column - UI_END = 0x010, - // insert spacing to stretch across whole row/column - UI_JUSTIFY = 0x018, - - // align-items - // can be implemented by putting a flex container in a layout container, - // then using UI_TOP, UI_DOWN, UI_VFILL, UI_VCENTER, etc. - // FILL is equivalent to stretch/grow - - // align-content (start, end, center, stretch) - // can be implemented by putting a flex container in a layout container, - // then using UI_TOP, UI_DOWN, UI_VFILL, UI_VCENTER, etc. - // FILL is equivalent to stretch; space-between is not supported. -} UIboxFlags; - -// child layout flags to pass to uiSetLayout() -typedef enum UIlayoutFlags { - // attachments (bit 5-8) - // fully valid when parent uses UI_LAYOUT model - // partially valid when in UI_FLEX model - - // anchor to left item or left side of parent - UI_LEFT = 0x020, - // anchor to top item or top side of parent - UI_TOP = 0x040, - // anchor to right item or right side of parent - UI_RIGHT = 0x080, - // anchor to bottom item or bottom side of parent - UI_DOWN = 0x100, - // anchor to both left and right item or parent borders - UI_HFILL = 0x0a0, - // anchor to both top and bottom item or parent borders - UI_VFILL = 0x140, - // center horizontally, with left margin as offset - UI_HCENTER = 0x000, - // center vertically, with top margin as offset - UI_VCENTER = 0x000, - // center in both directions, with left/top margin as offset - UI_CENTER = 0x000, - // anchor to all four directions - UI_FILL = 0x1e0, - // when wrapping, put this element on a new line - // wrapping layout code auto-inserts UI_BREAK flags, - // drawing routines can read them with uiGetLayout() - UI_BREAK = 0x200 -} UIlayoutFlags; - -// event flags -typedef enum UIevent { - // on button 0 down - UI_BUTTON0_DOWN = 0x0400, - // on button 0 up - // when this event has a handler, uiGetState() will return UI_ACTIVE as - // long as button 0 is down. - UI_BUTTON0_UP = 0x0800, - // on button 0 up while item is hovered - // when this event has a handler, uiGetState() will return UI_ACTIVE - // when the cursor is hovering the items rectangle; this is the - // behavior expected for buttons. - UI_BUTTON0_HOT_UP = 0x1000, - // item is being captured (button 0 constantly pressed); - // when this event has a handler, uiGetState() will return UI_ACTIVE as - // long as button 0 is down. - UI_BUTTON0_CAPTURE = 0x2000, - // on button 2 down (right mouse button, usually triggers context menu) - UI_BUTTON2_DOWN = 0x4000, - // item has received a scrollwheel event - // the accumulated wheel offset can be queried with uiGetScroll() - UI_SCROLL = 0x8000, - // item is focused and has received a key-down event - // the respective key can be queried using uiGetKey() and uiGetModifier() - UI_KEY_DOWN = 0x10000, - // item is focused and has received a key-up event - // the respective key can be queried using uiGetKey() and uiGetModifier() - UI_KEY_UP = 0x20000, - // item is focused and has received a character event - // the respective character can be queried using uiGetKey() - UI_CHAR = 0x40000, -} UIevent; - -enum { - // these bits, starting at bit 24, can be safely assigned by the - // application, e.g. as item types, other event types, drop targets, etc. - // they can be set and queried using uiSetFlags() and uiGetFlags() - UI_USERMASK = 0xff000000, - - // a special mask passed to uiFindItem() - UI_ANY = 0xffffffff, -}; - -// handler callback; event is one of UI_EVENT_* -typedef void (*UIhandler)(int item, UIevent event); - -// for cursor positions, mainly -typedef struct UIvec2 { -#if OUI_USE_UNION_VECTORS || defined(OUI_IMPLEMENTATION) - union { - int v[2]; - struct { int x, y; }; - }; -#else - int x, y; -#endif -} UIvec2; - -// layout rectangle -typedef struct UIrect { -#if OUI_USE_UNION_VECTORS || defined(OUI_IMPLEMENTATION) - union { - int v[4]; - struct { int x, y, w, h; }; - }; -#else - int x, y, w, h; -#endif -} UIrect; - -// unless declared otherwise, all operations have the complexity O(1). - -// Context Management -// ------------------ - -// create a new UI context; call uiMakeCurrent() to make this context the -// current context. The context is managed by the client and must be released -// using uiDestroyContext() -// item_capacity is the maximum of number of items that can be declared. -// buffer_capacity is the maximum total size of bytes that can be allocated -// using uiAllocHandle(); you may pass 0 if you don't need to allocate -// handles. -// 4096 and (1<<20) are good starting values. -OUI_EXPORT UIcontext *uiCreateContext( - unsigned int item_capacity, - unsigned int buffer_capacity); - -// select an UI context as the current context; a context must always be -// selected before using any of the other UI functions -OUI_EXPORT void uiMakeCurrent(UIcontext *ctx); - -// release the memory of an UI context created with uiCreateContext(); if the -// context is the current context, the current context will be set to NULL -OUI_EXPORT void uiDestroyContext(UIcontext *ctx); - -// returns the currently selected context or NULL -OUI_EXPORT UIcontext *uiGetContext(); - -// Input Control -// ------------- - -// sets the current cursor position (usually belonging to a mouse) to the -// screen coordinates at (x,y) -OUI_EXPORT void uiSetCursor(int x, int y); - -// returns the current cursor position in screen coordinates as set by -// uiSetCursor() -OUI_EXPORT UIvec2 uiGetCursor(); - -// returns the offset of the cursor relative to the last call to uiProcess() -OUI_EXPORT UIvec2 uiGetCursorDelta(); - -// returns the beginning point of a drag operation. -OUI_EXPORT UIvec2 uiGetCursorStart(); - -// returns the offset of the cursor relative to the beginning point of a drag -// operation. -OUI_EXPORT UIvec2 uiGetCursorStartDelta(); - -// sets a mouse or gamepad button as pressed/released -// button is in the range 0..63 and maps to an application defined input -// source. -// mod is an application defined set of flags for modifier keys -// enabled is 1 for pressed, 0 for released -OUI_EXPORT void uiSetButton(unsigned int button, unsigned int mod, int enabled); - -// returns the current state of an application dependent input button -// as set by uiSetButton(). -// the function returns 1 if the button has been set to pressed, 0 for released. -OUI_EXPORT int uiGetButton(unsigned int button); - -// returns the number of chained clicks; 1 is a single click, -// 2 is a double click, etc. -OUI_EXPORT int uiGetClicks(); - -// sets a key as down/up; the key can be any application defined keycode -// mod is an application defined set of flags for modifier keys -// enabled is 1 for key down, 0 for key up -// all key events are being buffered until the next call to uiProcess() -OUI_EXPORT void uiSetKey(unsigned int key, unsigned int mod, int enabled); - -// sends a single character for text input; the character is usually in the -// unicode range, but can be application defined. -// all char events are being buffered until the next call to uiProcess() -OUI_EXPORT void uiSetChar(unsigned int value); - -// accumulates scroll wheel offsets for the current frame -// all offsets are being accumulated until the next call to uiProcess() -OUI_EXPORT void uiSetScroll(int x, int y); - -// returns the currently accumulated scroll wheel offsets for this frame -OUI_EXPORT UIvec2 uiGetScroll(); - - - - - -// Stages -// ------ - -// clear the item buffer; uiBeginLayout() should be called before the first -// UI declaration for this frame to avoid concatenation of the same UI multiple -// times. -// After the call, all previously declared item IDs are invalid, and all -// application dependent context data has been freed. -// uiBeginLayout() must be followed by uiEndLayout(). -OUI_EXPORT void uiBeginLayout(); - -// layout all added items starting from the root item 0. -// after calling uiEndLayout(), no further modifications to the item tree should -// be done until the next call to uiBeginLayout(). -// It is safe to immediately draw the items after a call to uiEndLayout(). -// this is an O(N) operation for N = number of declared items. -OUI_EXPORT void uiEndLayout(); - -// update the current hot item; this only needs to be called if items are kept -// for more than one frame and uiEndLayout() is not called -OUI_EXPORT void uiUpdateHotItem(); - -// update the internal state according to the current cursor position and -// button states, and call all registered handlers. -// timestamp is the time in milliseconds relative to the last call to uiProcess() -// and is used to estimate the threshold for double-clicks -// after calling uiProcess(), no further modifications to the item tree should -// be done until the next call to uiBeginLayout(). -// Items should be drawn before a call to uiProcess() -// this is an O(N) operation for N = number of declared items. -OUI_EXPORT void uiProcess(int timestamp); - -// reset the currently stored hot/active etc. handles; this should be called when -// a re-declaration of the UI changes the item indices, to avoid state -// related glitches because item identities have changed. -OUI_EXPORT void uiClearState(); - -// UI Declaration -// -------------- - -// create a new UI item and return the new items ID. -OUI_EXPORT int uiItem(); - -// set an items state to frozen; the UI will not recurse into frozen items -// when searching for hot or active items; subsequently, frozen items and -// their child items will not cause mouse event notifications. -// The frozen state is not applied recursively; uiGetState() will report -// UI_COLD for child items. Upon encountering a frozen item, the drawing -// routine needs to handle rendering of child items appropriately. -// see example.cpp for a demonstration. -OUI_EXPORT void uiSetFrozen(int item, int enable); - -// set the application-dependent handle of an item. -// handle is an application defined 64-bit handle. If handle is NULL, the item -// will not be interactive. -OUI_EXPORT void uiSetHandle(int item, void *handle); - -// allocate space for application-dependent context data and assign it -// as the handle to the item. -// The memory of the pointer is managed by the UI context and released -// upon the next call to uiBeginLayout() -OUI_EXPORT void *uiAllocHandle(int item, unsigned int size); - -// set the global handler callback for interactive items. -// the handler will be called for each item whose event flags are set using -// uiSetEvents. -OUI_EXPORT void uiSetHandler(UIhandler handler); - -// flags is a combination of UI_EVENT_* and designates for which events the -// handler should be called. -OUI_EXPORT void uiSetEvents(int item, unsigned int flags); - -// flags is a user-defined set of flags defined by UI_USERMASK. -OUI_EXPORT void uiSetFlags(int item, unsigned int flags); - -// assign an item to a container. -// an item ID of 0 refers to the root item. -// the function returns the child item ID -// if the container has already added items, the function searches -// for the last item and calls uiAppend() on it, which is an -// O(N) operation for N siblings. -// it is usually more efficient to call uiInsert() for the first child, -// then chain additional siblings using uiAppend(). -OUI_EXPORT int uiInsert(int item, int child); - -// assign an item to the same container as another item -// sibling is inserted after item. -OUI_EXPORT int uiAppend(int item, int sibling); - -// insert child into container item like uiInsert(), but prepend -// it to the first child item, effectively putting it in -// the background. -// it is efficient to call uiInsertBack() repeatedly -// in cases where drawing or layout order doesn't matter. -OUI_EXPORT int uiInsertBack(int item, int child); - -// same as uiInsert() -OUI_EXPORT int uiInsertFront(int item, int child); - -// set the size of the item; a size of 0 indicates the dimension to be -// dynamic; if the size is set, the item can not expand beyond that size. -OUI_EXPORT void uiSetSize(int item, int w, int h); - -// set the anchoring behavior of the item to one or multiple UIlayoutFlags -OUI_EXPORT void uiSetLayout(int item, unsigned int flags); - -// set the box model behavior of the item to one or multiple UIboxFlags -OUI_EXPORT void uiSetBox(int item, unsigned int flags); - -// set the left, top, right and bottom margins of an item; when the item is -// anchored to the parent or another item, the margin controls the distance -// from the neighboring element. -OUI_EXPORT void uiSetMargins(int item, short l, short t, short r, short b); - -// set item as recipient of all keyboard events; if item is -1, no item will -// be focused. -OUI_EXPORT void uiFocus(int item); - -// Iteration -// --------- - -// returns the first child item of a container item. If the item is not -// a container or does not contain any items, -1 is returned. -// if item is 0, the first child item of the root item will be returned. -OUI_EXPORT int uiFirstChild(int item); - -// returns an items next sibling in the list of the parent containers children. -// if item is 0 or the item is the last child item, -1 will be returned. -OUI_EXPORT int uiNextSibling(int item); - -// Querying -// -------- - -// return the total number of allocated items -OUI_EXPORT int uiGetItemCount(); - -// return the total bytes that have been allocated by uiAllocHandle() -OUI_EXPORT unsigned int uiGetAllocSize(); - -// return the current state of the item. This state is only valid after -// a call to uiProcess(). -// The returned value is one of UI_COLD, UI_HOT, UI_ACTIVE, UI_FROZEN. -OUI_EXPORT UIitemState uiGetState(int item); - -// return the application-dependent handle of the item as passed to uiSetHandle() -// or uiAllocHandle(). -OUI_EXPORT void *uiGetHandle(int item); - -// return the item that is currently under the cursor or -1 for none -OUI_EXPORT int uiGetHotItem(); - -// return the item that is currently focused or -1 for none -OUI_EXPORT int uiGetFocusedItem(); - -// returns the topmost item containing absolute location (x,y), starting with -// item as parent, using a set of flags and masks as filter: -// if both flags and mask are UI_ANY, the first topmost item is returned. -// if mask is UI_ANY, the first topmost item matching *any* of flags is returned. -// otherwise the first item matching (item.flags & flags) == mask is returned. -// you may combine box, layout, event and user flags. -// frozen items will always be ignored. -OUI_EXPORT int uiFindItem(int item, int x, int y, - unsigned int flags, unsigned int mask); - -// return the handler callback as passed to uiSetHandler() -OUI_EXPORT UIhandler uiGetHandler(); -// return the event flags for an item as passed to uiSetEvents() -OUI_EXPORT unsigned int uiGetEvents(int item); -// return the user-defined flags for an item as passed to uiSetFlags() -OUI_EXPORT unsigned int uiGetFlags(int item); - -// when handling a KEY_DOWN/KEY_UP event: the key that triggered this event -OUI_EXPORT unsigned int uiGetKey(); -// when handling a keyboard or mouse event: the active modifier keys -OUI_EXPORT unsigned int uiGetModifier(); - -// returns the items layout rectangle in absolute coordinates. If -// uiGetRect() is called before uiEndLayout(), the values of the returned -// rectangle are undefined. -OUI_EXPORT UIrect uiGetRect(int item); - -// returns 1 if an items absolute rectangle contains a given coordinate -// otherwise 0 -OUI_EXPORT int uiContains(int item, int x, int y); - -// return the width of the item as set by uiSetSize() -OUI_EXPORT int uiGetWidth(int item); -// return the height of the item as set by uiSetSize() -OUI_EXPORT int uiGetHeight(int item); - -// return the anchoring behavior as set by uiSetLayout() -OUI_EXPORT unsigned int uiGetLayout(int item); -// return the box model as set by uiSetBox() -OUI_EXPORT unsigned int uiGetBox(int item); - -// return the left margin of the item as set with uiSetMargins() -OUI_EXPORT short uiGetMarginLeft(int item); -// return the top margin of the item as set with uiSetMargins() -OUI_EXPORT short uiGetMarginTop(int item); -// return the right margin of the item as set with uiSetMargins() -OUI_EXPORT short uiGetMarginRight(int item); -// return the bottom margin of the item as set with uiSetMargins() -OUI_EXPORT short uiGetMarginDown(int item); - -// when uiBeginLayout() is called, the most recently declared items are retained. -// when uiEndLayout() completes, it matches the old item hierarchy to the new one -// and attempts to map old items to new items as well as possible. -// when passed an item Id from the previous frame, uiRecoverItem() returns the -// items new assumed Id, or -1 if the item could not be mapped. -// it is valid to pass -1 as item. -OUI_EXPORT int uiRecoverItem(int olditem); - -// in cases where it is important to recover old state over changes in -// the view, and the built-in remapping fails, the UI declaration can manually -// remap old items to new IDs in cases where e.g. the previous item ID has been -// temporarily saved; uiRemapItem() would then be called after creating the -// new item using uiItem(). -OUI_EXPORT void uiRemapItem(int olditem, int newitem); - -// returns the number if items that have been allocated in the last frame -OUI_EXPORT int uiGetLastItemCount(); - -#ifdef __cplusplus -}; -#endif - -#endif // _OUI_H_ - -#ifdef OUI_IMPLEMENTATION - -#include - -#ifdef _MSC_VER - #pragma warning (disable: 4996) // Switch off security warnings - #pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings - #pragma warning (disable: 4244) - #pragma warning (disable: 4305) - - #ifdef __cplusplus - #define UI_INLINE inline - #else - #define UI_INLINE static inline - #endif -#else - #define UI_INLINE static inline -#endif - -#define UI_MAX_KIND 16 - -#define UI_ANY_BUTTON0_INPUT (UI_BUTTON0_DOWN \ - |UI_BUTTON0_UP \ - |UI_BUTTON0_HOT_UP \ - |UI_BUTTON0_CAPTURE) - -#define UI_ANY_BUTTON2_INPUT (UI_BUTTON2_DOWN) - -#define UI_ANY_MOUSE_INPUT (UI_ANY_BUTTON0_INPUT \ - |UI_ANY_BUTTON2_INPUT) - -#define UI_ANY_KEY_INPUT (UI_KEY_DOWN \ - |UI_KEY_UP \ - |UI_CHAR) - -#define UI_ANY_INPUT (UI_ANY_MOUSE_INPUT \ - |UI_ANY_KEY_INPUT) - -enum { - // extra item flags - - // bit 0-2 - UI_ITEM_BOX_MODEL_MASK = 0x000007, - // bit 0-4 - UI_ITEM_BOX_MASK = 0x00001F, - // bit 5-8 - UI_ITEM_LAYOUT_MASK = 0x0003E0, - // bit 9-18 - UI_ITEM_EVENT_MASK = 0x07FC00, - // item is frozen (bit 19) - UI_ITEM_FROZEN = 0x080000, - // item handle is pointer to data (bit 20) - UI_ITEM_DATA = 0x100000, - // item has been inserted (bit 21) - UI_ITEM_INSERTED = 0x200000, - // horizontal size has been explicitly set (bit 22) - UI_ITEM_HFIXED = 0x400000, - // vertical size has been explicitly set (bit 23) - UI_ITEM_VFIXED = 0x800000, - // bit 22-23 - UI_ITEM_FIXED_MASK = 0xC00000, - - // which flag bits will be compared - UI_ITEM_COMPARE_MASK = UI_ITEM_BOX_MODEL_MASK - | (UI_ITEM_LAYOUT_MASK & ~UI_BREAK) - | UI_ITEM_EVENT_MASK - | UI_USERMASK, -}; - -typedef struct UIitem { - // data handle - void *handle; - - // about 27 bits worth of flags - unsigned int flags; - - // index of first kid - // if old item: index of equivalent new item - int firstkid; - // index of next sibling with same parent - int nextitem; - - // margin offsets, interpretation depends on flags - // after layouting, the first two components are absolute coordinates - short margins[4]; - // size - short size[2]; -} UIitem; - -typedef enum UIstate { - UI_STATE_IDLE = 0, - UI_STATE_CAPTURE, -} UIstate; - -typedef enum UIstage { - UI_STAGE_LAYOUT = 0, - UI_STAGE_POST_LAYOUT, - UI_STAGE_PROCESS, -} UIstage; - -typedef struct UIhandleEntry { - unsigned int key; - int item; -} UIhandleEntry; - -typedef struct UIinputEvent { - unsigned int key; - unsigned int mod; - UIevent event; -} UIinputEvent; - -struct UIcontext { - unsigned int item_capacity; - unsigned int buffer_capacity; - - // handler - UIhandler handler; - - // button state in this frame - unsigned long long buttons; - // button state in the previous frame - unsigned long long last_buttons; - - // where the cursor was at the beginning of the active state - UIvec2 start_cursor; - // where the cursor was last frame - UIvec2 last_cursor; - // where the cursor is currently - UIvec2 cursor; - // accumulated scroll wheel offsets - UIvec2 scroll; - - int active_item; - int focus_item; - int last_hot_item; - int last_click_item; - int hot_item; - - UIstate state; - UIstage stage; - unsigned int active_key; - unsigned int active_modifier; - unsigned int active_button_modifier; - int last_timestamp; - int last_click_timestamp; - int clicks; - - int count; - int last_count; - int eventcount; - unsigned int datasize; - - UIitem *items; - unsigned char *data; - UIitem *last_items; - int *item_map; - UIinputEvent events[UI_MAX_INPUT_EVENTS]; -}; - -UI_INLINE int ui_max(int a, int b) { - return (a>b)?a:b; -} - -UI_INLINE int ui_min(int a, int b) { - return (ab)?a:b; -} - -UI_INLINE float ui_minf(float a, float b) { - return (alast_count = ui_context->count; - ui_context->count = 0; - ui_context->datasize = 0; - ui_context->hot_item = -1; - // swap buffers - UIitem *items = ui_context->items; - ui_context->items = ui_context->last_items; - ui_context->last_items = items; - for (int i = 0; i < ui_context->last_count; ++i) { - ui_context->item_map[i] = -1; - } -} - -UIcontext *uiCreateContext( - unsigned int item_capacity, - unsigned int buffer_capacity) { - assert(item_capacity); - UIcontext *ctx = (UIcontext *)org_lwjgl_malloc(sizeof(UIcontext)); - memset(ctx, 0, sizeof(UIcontext)); - ctx->item_capacity = item_capacity; - ctx->buffer_capacity = buffer_capacity; - ctx->stage = UI_STAGE_PROCESS; - ctx->items = (UIitem *)org_lwjgl_malloc(sizeof(UIitem) * item_capacity); - ctx->last_items = (UIitem *)org_lwjgl_malloc(sizeof(UIitem) * item_capacity); - ctx->item_map = (int *)org_lwjgl_malloc(sizeof(int) * item_capacity); - if (buffer_capacity) { - ctx->data = (unsigned char *)org_lwjgl_malloc(buffer_capacity); - } - - UIcontext *oldctx = ui_context; - uiMakeCurrent(ctx); - uiClear(); - uiClearState(); - uiMakeCurrent(oldctx); - return ctx; -} - -void uiMakeCurrent(UIcontext *ctx) { - ui_context = ctx; -} - -void uiDestroyContext(UIcontext *ctx) { - if (ui_context == ctx) - uiMakeCurrent(NULL); - org_lwjgl_free(ctx->items); - org_lwjgl_free(ctx->last_items); - org_lwjgl_free(ctx->item_map); - org_lwjgl_free(ctx->data); - org_lwjgl_free(ctx); -} - -OUI_EXPORT UIcontext *uiGetContext() { - return ui_context; -} - -void uiSetButton(unsigned int button, unsigned int mod, int enabled) { - assert(ui_context); - unsigned long long mask = 1ull<buttons = (enabled)? - (ui_context->buttons | mask): - (ui_context->buttons & ~mask); - ui_context->active_button_modifier = mod; -} - -static void uiAddInputEvent(UIinputEvent event) { - assert(ui_context); - if (ui_context->eventcount == UI_MAX_INPUT_EVENTS) return; - ui_context->events[ui_context->eventcount++] = event; -} - -static void uiClearInputEvents() { - assert(ui_context); - ui_context->eventcount = 0; - ui_context->scroll.x = 0; - ui_context->scroll.y = 0; -} - -void uiSetKey(unsigned int key, unsigned int mod, int enabled) { - assert(ui_context); - UIinputEvent event = { key, mod, enabled?UI_KEY_DOWN:UI_KEY_UP }; - uiAddInputEvent(event); -} - -void uiSetChar(unsigned int value) { - assert(ui_context); - UIinputEvent event = { value, 0, UI_CHAR }; - uiAddInputEvent(event); -} - -void uiSetScroll(int x, int y) { - assert(ui_context); - ui_context->scroll.x += x; - ui_context->scroll.y += y; -} - -UIvec2 uiGetScroll() { - assert(ui_context); - return ui_context->scroll; -} - -int uiGetLastButton(int button) { - assert(ui_context); - return (ui_context->last_buttons & (1ull<buttons & (1ull<cursor.x = x; - ui_context->cursor.y = y; -} - -UIvec2 uiGetCursor() { - assert(ui_context); - return ui_context->cursor; -} - -UIvec2 uiGetCursorStart() { - assert(ui_context); - return ui_context->start_cursor; -} - -UIvec2 uiGetCursorDelta() { - assert(ui_context); - UIvec2 result = {{{ - ui_context->cursor.x - ui_context->last_cursor.x, - ui_context->cursor.y - ui_context->last_cursor.y - }}}; - return result; -} - -UIvec2 uiGetCursorStartDelta() { - assert(ui_context); - UIvec2 result = {{{ - ui_context->cursor.x - ui_context->start_cursor.x, - ui_context->cursor.y - ui_context->start_cursor.y - }}}; - return result; -} - -unsigned int uiGetKey() { - assert(ui_context); - return ui_context->active_key; -} - -unsigned int uiGetModifier() { - assert(ui_context); - return ui_context->active_modifier; -} - -int uiGetItemCount() { - assert(ui_context); - return ui_context->count; -} - -int uiGetLastItemCount() { - assert(ui_context); - return ui_context->last_count; -} - -unsigned int uiGetAllocSize() { - assert(ui_context); - return ui_context->datasize; -} - -UIitem *uiItemPtr(int item) { - assert(ui_context && (item >= 0) && (item < ui_context->count)); - return ui_context->items + item; -} - -UIitem *uiLastItemPtr(int item) { - assert(ui_context && (item >= 0) && (item < ui_context->last_count)); - return ui_context->last_items + item; -} - -int uiGetHotItem() { - assert(ui_context); - return ui_context->hot_item; -} - -void uiFocus(int item) { - assert(ui_context && (item >= -1) && (item < ui_context->count)); - assert(ui_context->stage != UI_STAGE_LAYOUT); - ui_context->focus_item = item; -} - -static void uiValidateStateItems() { - assert(ui_context); - ui_context->last_hot_item = uiRecoverItem(ui_context->last_hot_item); - ui_context->active_item = uiRecoverItem(ui_context->active_item); - ui_context->focus_item = uiRecoverItem(ui_context->focus_item); - ui_context->last_click_item = uiRecoverItem(ui_context->last_click_item); -} - -int uiGetFocusedItem() { - assert(ui_context); - return ui_context->focus_item; -} - - -void uiBeginLayout() { - assert(ui_context); - assert(ui_context->stage == UI_STAGE_PROCESS); // must run uiEndLayout(), uiProcess() first - uiClear(); - ui_context->stage = UI_STAGE_LAYOUT; -} - -void uiClearState() { - assert(ui_context); - ui_context->last_hot_item = -1; - ui_context->active_item = -1; - ui_context->focus_item = -1; - ui_context->last_click_item = -1; -} - -int uiItem() { - assert(ui_context); - assert(ui_context->stage == UI_STAGE_LAYOUT); // must run between uiBeginLayout() and uiEndLayout() - assert(ui_context->count < (int)ui_context->item_capacity); - int idx = ui_context->count++; - UIitem *item = uiItemPtr(idx); - memset(item, 0, sizeof(UIitem)); - item->firstkid = -1; - item->nextitem = -1; - return idx; -} - -void uiNotifyItem(int item, UIevent event) { - assert(ui_context); - if (!ui_context->handler) - return; - assert((event & UI_ITEM_EVENT_MASK) == event); - UIitem *pitem = uiItemPtr(item); - if (pitem->flags & event) { - ui_context->handler(item, event); - } -} - -UI_INLINE int uiLastChild(int item) { - item = uiFirstChild(item); - if (item < 0) - return -1; - while (true) { - int nextitem = uiNextSibling(item); - if (nextitem < 0) - return item; - item = nextitem; - } -} - -int uiAppend(int item, int sibling) { - assert(sibling > 0); - UIitem *pitem = uiItemPtr(item); - UIitem *psibling = uiItemPtr(sibling); - assert(!(psibling->flags & UI_ITEM_INSERTED)); - psibling->nextitem = pitem->nextitem; - psibling->flags |= UI_ITEM_INSERTED; - pitem->nextitem = sibling; - return sibling; -} - -int uiInsert(int item, int child) { - assert(child > 0); - UIitem *pparent = uiItemPtr(item); - UIitem *pchild = uiItemPtr(child); - assert(!(pchild->flags & UI_ITEM_INSERTED)); - if (pparent->firstkid < 0) { - pparent->firstkid = child; - pchild->flags |= UI_ITEM_INSERTED; - } else { - uiAppend(uiLastChild(item), child); - } - return child; -} - -int uiInsertFront(int item, int child) { - return uiInsert(item, child); -} - -int uiInsertBack(int item, int child) { - assert(child > 0); - UIitem *pparent = uiItemPtr(item); - UIitem *pchild = uiItemPtr(child); - assert(!(pchild->flags & UI_ITEM_INSERTED)); - pchild->nextitem = pparent->firstkid; - pparent->firstkid = child; - pchild->flags |= UI_ITEM_INSERTED; - return child; -} - -void uiSetFrozen(int item, int enable) { - UIitem *pitem = uiItemPtr(item); - if (enable) - pitem->flags |= UI_ITEM_FROZEN; - else - pitem->flags &= ~UI_ITEM_FROZEN; -} - -void uiSetSize(int item, int w, int h) { - UIitem *pitem = uiItemPtr(item); - pitem->size[0] = w; - pitem->size[1] = h; - if (!w) - pitem->flags &= ~UI_ITEM_HFIXED; - else - pitem->flags |= UI_ITEM_HFIXED; - if (!h) - pitem->flags &= ~UI_ITEM_VFIXED; - else - pitem->flags |= UI_ITEM_VFIXED; -} - -int uiGetWidth(int item) { - return uiItemPtr(item)->size[0]; -} - -int uiGetHeight(int item) { - return uiItemPtr(item)->size[1]; -} - -void uiSetLayout(int item, unsigned int flags) { - UIitem *pitem = uiItemPtr(item); - assert((flags & UI_ITEM_LAYOUT_MASK) == (unsigned int)flags); - pitem->flags &= ~UI_ITEM_LAYOUT_MASK; - pitem->flags |= flags & UI_ITEM_LAYOUT_MASK; -} - -unsigned int uiGetLayout(int item) { - return uiItemPtr(item)->flags & UI_ITEM_LAYOUT_MASK; -} - -void uiSetBox(int item, unsigned int flags) { - UIitem *pitem = uiItemPtr(item); - assert((flags & UI_ITEM_BOX_MASK) == (unsigned int)flags); - pitem->flags &= ~UI_ITEM_BOX_MASK; - pitem->flags |= flags & UI_ITEM_BOX_MASK; -} - -unsigned int uiGetBox(int item) { - return uiItemPtr(item)->flags & UI_ITEM_BOX_MASK; -} - -void uiSetMargins(int item, short l, short t, short r, short b) { - UIitem *pitem = uiItemPtr(item); - pitem->margins[0] = l; - pitem->margins[1] = t; - pitem->margins[2] = r; - pitem->margins[3] = b; -} - -short uiGetMarginLeft(int item) { - return uiItemPtr(item)->margins[0]; -} -short uiGetMarginTop(int item) { - return uiItemPtr(item)->margins[1]; -} -short uiGetMarginRight(int item) { - return uiItemPtr(item)->margins[2]; -} -short uiGetMarginDown(int item) { - return uiItemPtr(item)->margins[3]; -} - -// compute bounding box of all items super-imposed -UI_INLINE void uiComputeImposedSize(UIitem *pitem, int dim) { - int wdim = dim+2; - // largest size is required size - short need_size = 0; - int kid = pitem->firstkid; - while (kid >= 0) { - UIitem *pkid = uiItemPtr(kid); - - // width = start margin + calculated width + end margin - int kidsize = pkid->margins[dim] + pkid->size[dim] + pkid->margins[wdim]; - need_size = ui_max(need_size, kidsize); - kid = uiNextSibling(kid); - } - pitem->size[dim] = need_size; -} - -// compute bounding box of all items stacked -UI_INLINE void uiComputeStackedSize(UIitem *pitem, int dim) { - int wdim = dim+2; - short need_size = 0; - int kid = pitem->firstkid; - while (kid >= 0) { - UIitem *pkid = uiItemPtr(kid); - // width += start margin + calculated width + end margin - need_size += pkid->margins[dim] + pkid->size[dim] + pkid->margins[wdim]; - kid = uiNextSibling(kid); - } - pitem->size[dim] = need_size; -} - -// compute bounding box of all items stacked, repeating when breaking -UI_INLINE void uiComputeWrappedStackedSize(UIitem *pitem, int dim) { - int wdim = dim+2; - - short need_size = 0; - short need_size2 = 0; - int kid = pitem->firstkid; - while (kid >= 0) { - UIitem *pkid = uiItemPtr(kid); - - // if next position moved back, we assume a new line - if (pkid->flags & UI_BREAK) { - need_size2 = ui_max(need_size2, need_size); - // newline - need_size = 0; - } - - // width = start margin + calculated width + end margin - need_size += pkid->margins[dim] + pkid->size[dim] + pkid->margins[wdim]; - kid = uiNextSibling(kid); - } - pitem->size[dim] = ui_max(need_size2, need_size); -} - -// compute bounding box of all items stacked + wrapped -UI_INLINE void uiComputeWrappedSize(UIitem *pitem, int dim) { - int wdim = dim+2; - - short need_size = 0; - short need_size2 = 0; - int kid = pitem->firstkid; - while (kid >= 0) { - UIitem *pkid = uiItemPtr(kid); - - // if next position moved back, we assume a new line - if (pkid->flags & UI_BREAK) { - need_size2 += need_size; - // newline - need_size = 0; - } - - // width = start margin + calculated width + end margin - int kidsize = pkid->margins[dim] + pkid->size[dim] + pkid->margins[wdim]; - need_size = ui_max(need_size, kidsize); - kid = uiNextSibling(kid); - } - pitem->size[dim] = need_size2 + need_size; -} - -static void uiComputeSize(int item, int dim) { - UIitem *pitem = uiItemPtr(item); - - // children expand the size - int kid = pitem->firstkid; - while (kid >= 0) { - uiComputeSize(kid, dim); - kid = uiNextSibling(kid); - } - - if (pitem->size[dim]) - return; - switch(pitem->flags & UI_ITEM_BOX_MODEL_MASK) { - case UI_COLUMN|UI_WRAP: { - // flex model - if (dim) // direction - uiComputeStackedSize(pitem, 1); - else - uiComputeImposedSize(pitem, 0); - } break; - case UI_ROW|UI_WRAP: { - // flex model - if (!dim) // direction - uiComputeWrappedStackedSize(pitem, 0); - else - uiComputeWrappedSize(pitem, 1); - } break; - case UI_COLUMN: - case UI_ROW: { - // flex model - if ((pitem->flags & 1) == (unsigned int)dim) // direction - uiComputeStackedSize(pitem, dim); - else - uiComputeImposedSize(pitem, dim); - } break; - default: { - // layout model - uiComputeImposedSize(pitem, dim); - } break; - } -} - -// stack all items according to their alignment -UI_INLINE void uiArrangeStacked(UIitem *pitem, int dim, bool wrap) { - int wdim = dim+2; - - short space = pitem->size[dim]; - float max_x2 = (float)pitem->margins[dim] + (float)space; - - int start_kid = pitem->firstkid; - while (start_kid >= 0) { - short used = 0; - - int count = 0; // count of fillers - int squeezed_count = 0; // count of squeezable elements - int total = 0; - bool hardbreak = false; - // first pass: count items that need to be expanded, - // and the space that is used - int kid = start_kid; - int end_kid = -1; - while (kid >= 0) { - UIitem *pkid = uiItemPtr(kid); - int flags = (pkid->flags & UI_ITEM_LAYOUT_MASK) >> dim; - int fflags = (pkid->flags & UI_ITEM_FIXED_MASK) >> dim; - short extend = used; - if ((flags & UI_HFILL) == UI_HFILL) { // grow - count++; - extend += pkid->margins[dim] + pkid->margins[wdim]; - } else { - if ((fflags & UI_ITEM_HFIXED) != UI_ITEM_HFIXED) - squeezed_count++; - extend += pkid->margins[dim] + pkid->size[dim] + pkid->margins[wdim]; - } - // wrap on end of line or manual flag - if (wrap && (total && ((extend > space) || (pkid->flags & UI_BREAK)))) { - end_kid = kid; - hardbreak = ((pkid->flags & UI_BREAK) == UI_BREAK); - // add marker for subsequent queries - pkid->flags |= UI_BREAK; - break; - } else { - used = extend; - kid = uiNextSibling(kid); - } - total++; - } - - int extra_space = space - used; - float filler = 0.0f; - float spacer = 0.0f; - float extra_margin = 0.0f; - float eater = 0.0f; - - if (extra_space > 0) { - if (count) { - filler = (float)extra_space / (float)count; - } else if (total) { - switch(pitem->flags & UI_JUSTIFY) { - default: { - extra_margin = extra_space / 2.0f; - } break; - case UI_JUSTIFY: { - // justify when not wrapping or not in last line, - // or not manually breaking - if (!wrap || ((end_kid != -1) && !hardbreak)) - spacer = (float)extra_space / (float)(total-1); - } break; - case UI_START: { - } break; - case UI_END: { - extra_margin = extra_space; - } break; - } - } - } else if (!wrap && (extra_space < 0)) { - eater = (float)extra_space / (float)squeezed_count; - } - - // distribute width among items - float x = (float)pitem->margins[dim]; - float x1; - // second pass: distribute and rescale - kid = start_kid; - while (kid != end_kid) { - short ix0,ix1; - UIitem *pkid = uiItemPtr(kid); - int flags = (pkid->flags & UI_ITEM_LAYOUT_MASK) >> dim; - int fflags = (pkid->flags & UI_ITEM_FIXED_MASK) >> dim; - - x += (float)pkid->margins[dim] + extra_margin; - if ((flags & UI_HFILL) == UI_HFILL) { // grow - x1 = x+filler; - } else if ((fflags & UI_ITEM_HFIXED) == UI_ITEM_HFIXED) { - x1 = x+(float)pkid->size[dim]; - } else { - // squeeze - x1 = x+ui_maxf(0.0f,(float)pkid->size[dim]+eater); - } - ix0 = (short)x; - if (wrap) - ix1 = (short)ui_minf(max_x2-(float)pkid->margins[wdim], x1); - else - ix1 = (short)x1; - pkid->margins[dim] = ix0; - pkid->size[dim] = ix1-ix0; - x = x1 + (float)pkid->margins[wdim]; - - kid = uiNextSibling(kid); - extra_margin = spacer; - } - - start_kid = end_kid; - } -} - -// superimpose all items according to their alignment -UI_INLINE void uiArrangeImposedRange(UIitem *pitem, int dim, - int start_kid, int end_kid, short offset, short space) { - int wdim = dim+2; - - int kid = start_kid; - while (kid != end_kid) { - UIitem *pkid = uiItemPtr(kid); - - int flags = (pkid->flags & UI_ITEM_LAYOUT_MASK) >> dim; - - switch(flags & UI_HFILL) { - default: break; - case UI_HCENTER: { - pkid->margins[dim] += (space-pkid->size[dim])/2 - pkid->margins[wdim]; - } break; - case UI_RIGHT: { - pkid->margins[dim] = space-pkid->size[dim]-pkid->margins[wdim]; - } break; - case UI_HFILL: { - pkid->size[dim] = ui_max(0,space-pkid->margins[dim]-pkid->margins[wdim]); - } break; - } - pkid->margins[dim] += offset; - - kid = uiNextSibling(kid); - } -} - -UI_INLINE void uiArrangeImposed(UIitem *pitem, int dim) { - uiArrangeImposedRange(pitem, dim, pitem->firstkid, -1, pitem->margins[dim], pitem->size[dim]); -} - -// superimpose all items according to their alignment, -// squeeze items that expand the available space -UI_INLINE void uiArrangeImposedSqueezedRange(UIitem *pitem, int dim, - int start_kid, int end_kid, short offset, short space) { - int wdim = dim+2; - - int kid = start_kid; - while (kid != end_kid) { - UIitem *pkid = uiItemPtr(kid); - - int flags = (pkid->flags & UI_ITEM_LAYOUT_MASK) >> dim; - - short min_size = ui_max(0,space-pkid->margins[dim]-pkid->margins[wdim]); - switch(flags & UI_HFILL) { - default: { - pkid->size[dim] = ui_min(pkid->size[dim], min_size); - } break; - case UI_HCENTER: { - pkid->size[dim] = ui_min(pkid->size[dim], min_size); - pkid->margins[dim] += (space-pkid->size[dim])/2 - pkid->margins[wdim]; - } break; - case UI_RIGHT: { - pkid->size[dim] = ui_min(pkid->size[dim], min_size); - pkid->margins[dim] = space-pkid->size[dim]-pkid->margins[wdim]; - } break; - case UI_HFILL: { - pkid->size[dim] = min_size; - } break; - } - pkid->margins[dim] += offset; - - kid = uiNextSibling(kid); - } -} - -UI_INLINE void uiArrangeImposedSqueezed(UIitem *pitem, int dim) { - uiArrangeImposedSqueezedRange(pitem, dim, pitem->firstkid, -1, pitem->margins[dim], pitem->size[dim]); -} - -// superimpose all items according to their alignment -UI_INLINE short uiArrangeWrappedImposedSqueezed(UIitem *pitem, int dim) { - int wdim = dim+2; - - short offset = pitem->margins[dim]; - - short need_size = 0; - int kid = pitem->firstkid; - int start_kid = kid; - while (kid >= 0) { - UIitem *pkid = uiItemPtr(kid); - - if (pkid->flags & UI_BREAK) { - uiArrangeImposedSqueezedRange(pitem, dim, start_kid, kid, offset, need_size); - offset += need_size; - start_kid = kid; - // newline - need_size = 0; - } - - // width = start margin + calculated width + end margin - int kidsize = pkid->margins[dim] + pkid->size[dim] + pkid->margins[wdim]; - need_size = ui_max(need_size, kidsize); - kid = uiNextSibling(kid); - } - - uiArrangeImposedSqueezedRange(pitem, dim, start_kid, -1, offset, need_size); - offset += need_size; - return offset; -} - -static void uiArrange(int item, int dim) { - UIitem *pitem = uiItemPtr(item); - - switch(pitem->flags & UI_ITEM_BOX_MODEL_MASK) { - case UI_COLUMN|UI_WRAP: { - // flex model, wrapping - if (dim) { // direction - uiArrangeStacked(pitem, 1, true); - // this retroactive resize will not effect parent widths - short offset = uiArrangeWrappedImposedSqueezed(pitem, 0); - pitem->size[0] = offset - pitem->margins[0]; - } - } break; - case UI_ROW|UI_WRAP: { - // flex model, wrapping - if (!dim) { // direction - uiArrangeStacked(pitem, 0, true); - } else { - uiArrangeWrappedImposedSqueezed(pitem, 1); - } - } break; - case UI_COLUMN: - case UI_ROW: { - // flex model - if ((pitem->flags & 1) == (unsigned int)dim) // direction - uiArrangeStacked(pitem, dim, false); - else - uiArrangeImposedSqueezed(pitem, dim); - } break; - default: { - // layout model - uiArrangeImposed(pitem, dim); - } break; - } - - int kid = uiFirstChild(item); - while (kid >= 0) { - uiArrange(kid, dim); - kid = uiNextSibling(kid); - } -} - -UI_INLINE bool uiCompareItems(UIitem *item1, UIitem *item2) { - return ((item1->flags & UI_ITEM_COMPARE_MASK) == (item2->flags & UI_ITEM_COMPARE_MASK)); - -} - -static bool uiMapItems(int item1, int item2) { - UIitem *pitem1 = uiLastItemPtr(item1); - if (item2 == -1) { - return false; - } - - UIitem *pitem2 = uiItemPtr(item2); - if (!uiCompareItems(pitem1, pitem2)) { - return false; - } - - int count = 0; - int failed = 0; - int kid1 = pitem1->firstkid; - int kid2 = pitem2->firstkid; - while (kid1 != -1) { - UIitem *pkid1 = uiLastItemPtr(kid1); - count++; - if (!uiMapItems(kid1, kid2)) { - failed = count; - break; - } - kid1 = pkid1->nextitem; - if (kid2 != -1) { - kid2 = uiItemPtr(kid2)->nextitem; - } - } - - if (count && (failed == 1)) { - return false; - } - - ui_context->item_map[item1] = item2; - return true; -} - -int uiRecoverItem(int olditem) { - assert(ui_context); - assert((olditem >= -1) && (olditem < ui_context->last_count)); - if (olditem == -1) return -1; - return ui_context->item_map[olditem]; -} - -void uiRemapItem(int olditem, int newitem) { - assert(ui_context); - assert((olditem >= 0) && (olditem < ui_context->last_count)); - assert((newitem >= -1) && (newitem < ui_context->count)); - ui_context->item_map[olditem] = newitem; -} - -void uiEndLayout() { - assert(ui_context); - assert(ui_context->stage == UI_STAGE_LAYOUT); // must run uiBeginLayout() first - - if (ui_context->count) { - uiComputeSize(0,0); - uiArrange(0,0); - uiComputeSize(0,1); - uiArrange(0,1); - - if (ui_context->last_count) { - // map old item id to new item id - uiMapItems(0,0); - } - } - - uiValidateStateItems(); - if (ui_context->count) { - // drawing routines may require this to be set already - uiUpdateHotItem(); - } - - ui_context->stage = UI_STAGE_POST_LAYOUT; -} - -UIrect uiGetRect(int item) { - UIitem *pitem = uiItemPtr(item); - UIrect rc = {{{ - pitem->margins[0], pitem->margins[1], - pitem->size[0], pitem->size[1] - }}}; - return rc; -} - -int uiFirstChild(int item) { - return uiItemPtr(item)->firstkid; -} - -int uiNextSibling(int item) { - return uiItemPtr(item)->nextitem; -} - -void *uiAllocHandle(int item, unsigned int size) { - assert((size > 0) && (size < UI_MAX_DATASIZE)); - UIitem *pitem = uiItemPtr(item); - assert(pitem->handle == NULL); - assert((ui_context->datasize+size) <= ui_context->buffer_capacity); - pitem->handle = ui_context->data + ui_context->datasize; - pitem->flags |= UI_ITEM_DATA; - ui_context->datasize += size; - return pitem->handle; -} - -void uiSetHandle(int item, void *handle) { - UIitem *pitem = uiItemPtr(item); - assert(pitem->handle == NULL); - pitem->handle = handle; -} - -void *uiGetHandle(int item) { - return uiItemPtr(item)->handle; -} - -void uiSetHandler(UIhandler handler) { - assert(ui_context); - ui_context->handler = handler; -} - -UIhandler uiGetHandler() { - assert(ui_context); - return ui_context->handler; -} - -void uiSetEvents(int item, unsigned int flags) { - UIitem *pitem = uiItemPtr(item); - pitem->flags &= ~UI_ITEM_EVENT_MASK; - pitem->flags |= flags & UI_ITEM_EVENT_MASK; -} - -unsigned int uiGetEvents(int item) { - return uiItemPtr(item)->flags & UI_ITEM_EVENT_MASK; -} - -void uiSetFlags(int item, unsigned int flags) { - UIitem *pitem = uiItemPtr(item); - pitem->flags &= ~UI_USERMASK; - pitem->flags |= flags & UI_USERMASK; -} - -unsigned int uiGetFlags(int item) { - return uiItemPtr(item)->flags & UI_USERMASK; -} - -int uiContains(int item, int x, int y) { - UIrect rect = uiGetRect(item); - x -= rect.x; - y -= rect.y; - if ((x>=0) - && (y>=0) - && (xflags & UI_ITEM_FROZEN) return -1; - if (uiContains(item, x, y)) { - int best_hit = -1; - int kid = uiFirstChild(item); - while (kid >= 0) { - int hit = uiFindItem(kid, x, y, flags, mask); - if (hit >= 0) { - best_hit = hit; - } - kid = uiNextSibling(kid); - } - if (best_hit >= 0) { - return best_hit; - } - if (((mask == UI_ANY) && ((flags == UI_ANY) - || (pitem->flags & flags))) - || ((pitem->flags & flags) == mask)) { - return item; - } - } - return -1; -} - -void uiUpdateHotItem() { - assert(ui_context); - if (!ui_context->count) return; - ui_context->hot_item = uiFindItem(0, - ui_context->cursor.x, ui_context->cursor.y, - UI_ANY_MOUSE_INPUT, UI_ANY); -} - -int uiGetClicks() { - return ui_context->clicks; -} - -void uiProcess(int timestamp) { - assert(ui_context); - - assert(ui_context->stage != UI_STAGE_LAYOUT); // must run uiBeginLayout(), uiEndLayout() first - - if (ui_context->stage == UI_STAGE_PROCESS) { - uiUpdateHotItem(); - } - ui_context->stage = UI_STAGE_PROCESS; - - if (!ui_context->count) { - uiClearInputEvents(); - return; - } - - int hot_item = ui_context->last_hot_item; - int active_item = ui_context->active_item; - int focus_item = ui_context->focus_item; - - // send all keyboard events - if (focus_item >= 0) { - for (int i = 0; i < ui_context->eventcount; ++i) { - ui_context->active_key = ui_context->events[i].key; - ui_context->active_modifier = ui_context->events[i].mod; - uiNotifyItem(focus_item, - ui_context->events[i].event); - } - } else { - ui_context->focus_item = -1; - } - if (ui_context->scroll.x || ui_context->scroll.y) { - int scroll_item = uiFindItem(0, - ui_context->cursor.x, ui_context->cursor.y, - UI_SCROLL, UI_ANY); - if (scroll_item >= 0) { - uiNotifyItem(scroll_item, UI_SCROLL); - } - } - - uiClearInputEvents(); - - int hot = ui_context->hot_item; - - switch(ui_context->state) { - default: - case UI_STATE_IDLE: { - ui_context->start_cursor = ui_context->cursor; - if (uiGetButton(0)) { - hot_item = -1; - active_item = hot; - - if (active_item != focus_item) { - focus_item = -1; - ui_context->focus_item = -1; - } - - if (active_item >= 0) { - if ( - ((timestamp - ui_context->last_click_timestamp) > UI_CLICK_THRESHOLD) - || (ui_context->last_click_item != active_item)) { - ui_context->clicks = 0; - } - ui_context->clicks++; - - ui_context->last_click_timestamp = timestamp; - ui_context->last_click_item = active_item; - ui_context->active_modifier = ui_context->active_button_modifier; - uiNotifyItem(active_item, UI_BUTTON0_DOWN); - } - ui_context->state = UI_STATE_CAPTURE; - } else if (uiGetButton(2) && !uiGetLastButton(2)) { - hot_item = -1; - hot = uiFindItem(0, ui_context->cursor.x, ui_context->cursor.y, - UI_BUTTON2_DOWN, UI_ANY); - if (hot >= 0) { - ui_context->active_modifier = ui_context->active_button_modifier; - uiNotifyItem(hot, UI_BUTTON2_DOWN); - } - } else { - hot_item = hot; - } - } break; - case UI_STATE_CAPTURE: { - if (!uiGetButton(0)) { - if (active_item >= 0) { - ui_context->active_modifier = ui_context->active_button_modifier; - uiNotifyItem(active_item, UI_BUTTON0_UP); - if (active_item == hot) { - uiNotifyItem(active_item, UI_BUTTON0_HOT_UP); - } - } - active_item = -1; - ui_context->state = UI_STATE_IDLE; - } else { - if (active_item >= 0) { - ui_context->active_modifier = ui_context->active_button_modifier; - uiNotifyItem(active_item, UI_BUTTON0_CAPTURE); - } - if (hot == active_item) - hot_item = hot; - else - hot_item = -1; - } - } break; - } - - ui_context->last_cursor = ui_context->cursor; - ui_context->last_hot_item = hot_item; - ui_context->active_item = active_item; - - ui_context->last_timestamp = timestamp; - ui_context->last_buttons = ui_context->buttons; -} - -static int uiIsActive(int item) { - assert(ui_context); - return ui_context->active_item == item; -} - -static int uiIsHot(int item) { - assert(ui_context); - return ui_context->last_hot_item == item; -} - -static int uiIsFocused(int item) { - assert(ui_context); - return ui_context->focus_item == item; -} - -UIitemState uiGetState(int item) { - UIitem *pitem = uiItemPtr(item); - if (pitem->flags & UI_ITEM_FROZEN) return UI_FROZEN; - if (uiIsFocused(item)) { - if (pitem->flags & (UI_KEY_DOWN|UI_CHAR|UI_KEY_UP)) return UI_ACTIVE; - } - if (uiIsActive(item)) { - if (pitem->flags & (UI_BUTTON0_CAPTURE|UI_BUTTON0_UP)) return UI_ACTIVE; - if ((pitem->flags & UI_BUTTON0_HOT_UP) - && uiIsHot(item)) return UI_ACTIVE; - return UI_COLD; - } else if (uiIsHot(item)) { - return UI_HOT; - } - return UI_COLD; -} - -#endif // OUI_IMPLEMENTATION diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_LibSTB.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_LibSTB.c deleted file mode 100644 index e1179805..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_LibSTB.c +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#define LWJGL_MALLOC_LIB org_lwjgl_stb_LibSTB -#include "lwjgl/lwjgl_malloc.h" diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBDXT.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBDXT.c deleted file mode 100644 index 7101d27a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBDXT.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#define STB_DXT_IMPLEMENTATION -#define STB_DXT_STATIC -#include "stb_dxt.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBDXT_nstb_1compress_1dxt_1block(JNIEnv *__env, jclass clazz, jlong destAddress, jlong src_rgba_four_bytes_per_pixelAddress, jint alpha, jint mode) { - unsigned char *dest = (unsigned char *)(uintptr_t)destAddress; - unsigned char const *src_rgba_four_bytes_per_pixel = (unsigned char const *)(uintptr_t)src_rgba_four_bytes_per_pixelAddress; - UNUSED_PARAMS(__env, clazz) - stb_compress_dxt_block(dest, src_rgba_four_bytes_per_pixel, alpha, mode); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBDXT_nstb_1compress_1bc4_1block(JNIEnv *__env, jclass clazz, jlong destAddress, jlong src_r_one_byte_per_pixelAddress) { - unsigned char *dest = (unsigned char *)(uintptr_t)destAddress; - unsigned char const *src_r_one_byte_per_pixel = (unsigned char const *)(uintptr_t)src_r_one_byte_per_pixelAddress; - UNUSED_PARAMS(__env, clazz) - stb_compress_bc4_block(dest, src_r_one_byte_per_pixel); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBDXT_nstb_1compress_1bc5_1block(JNIEnv *__env, jclass clazz, jlong destAddress, jlong src_rg_two_byte_per_pixelAddress) { - unsigned char *dest = (unsigned char *)(uintptr_t)destAddress; - unsigned char const *src_rg_two_byte_per_pixel = (unsigned char const *)(uintptr_t)src_rg_two_byte_per_pixelAddress; - UNUSED_PARAMS(__env, clazz) - stb_compress_bc5_block(dest, src_rg_two_byte_per_pixel); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBEasyFont.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBEasyFont.c deleted file mode 100644 index bfeacc2e..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBEasyFont.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#include "stb_easy_font.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBEasyFont_nstb_1easy_1font_1width(JNIEnv *__env, jclass clazz, jlong textAddress) { - char *text = (char *)(uintptr_t)textAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_easy_font_width(text); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBEasyFont_nstb_1easy_1font_1height(JNIEnv *__env, jclass clazz, jlong textAddress) { - char *text = (char *)(uintptr_t)textAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_easy_font_height(text); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBEasyFont_nstb_1easy_1font_1print(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jlong textAddress, jlong colorAddress, jlong vertex_bufferAddress, jint vbuf_size) { - char *text = (char *)(uintptr_t)textAddress; - unsigned char *color = (unsigned char *)(uintptr_t)colorAddress; - void *vertex_buffer = (void *)(uintptr_t)vertex_bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_easy_font_print(x, y, text, color, vertex_buffer, vbuf_size); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBEasyFont_stb_1easy_1font_1spacing(JNIEnv *__env, jclass clazz, jfloat spacing) { - UNUSED_PARAMS(__env, clazz) - stb_easy_font_spacing(spacing); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImage.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImage.c deleted file mode 100644 index bc6ad3a5..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImage.c +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#include "lwjgl/lwjgl_malloc.h" -#define STBI_MALLOC(sz) org_lwjgl_malloc(sz) -#define STBI_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define STBI_FREE(p) org_lwjgl_free(p) -#define STBI_FAILURE_USERMSG -#define STBI_ASSERT(x) -#define STB_IMAGE_IMPLEMENTATION -#define STB_IMAGE_STATIC -#ifdef LWJGL_WINDOWS - #define STBI_WINDOWS_UTF8 -#endif -#include "stb_image.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load__JJJJI(JNIEnv *__env, jclass clazz, jlong filenameAddress, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_load(filename, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_1from_1memory__JIJJJI(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_load_from_memory(buffer, len, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_1from_1callbacks__JJJJJI(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_load_from_callbacks(clbk, user, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_1gif_1from_1memory__JIJJJJJI(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jlong delaysAddress, jlong xAddress, jlong yAddress, jlong zAddress, jlong channels_in_fileAddress, jint desired_channels) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - int **delays = (int **)(uintptr_t)delaysAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *z = (int *)(uintptr_t)zAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_load_gif_from_memory(buffer, len, delays, x, y, z, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_116__JJJJI(JNIEnv *__env, jclass clazz, jlong filenameAddress, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_load_16(filename, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_116_1from_1memory__JIJJJI(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_load_16_from_memory(buffer, len, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_116_1from_1callbacks__JJJJJI(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_load_16_from_callbacks(clbk, user, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1loadf__JJJJI(JNIEnv *__env, jclass clazz, jlong filenameAddress, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_loadf(filename, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1loadf_1from_1memory__JIJJJI(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_loadf_from_memory(buffer, len, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1loadf_1from_1callbacks__JJJJJI(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress, jlong xAddress, jlong yAddress, jlong channels_in_fileAddress, jint desired_channels) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *channels_in_file = (int *)(uintptr_t)channels_in_fileAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_loadf_from_callbacks(clbk, user, x, y, channels_in_file, desired_channels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_stbi_1hdr_1to_1ldr_1gamma(JNIEnv *__env, jclass clazz, jfloat gamma) { - UNUSED_PARAMS(__env, clazz) - stbi_hdr_to_ldr_gamma(gamma); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_stbi_1hdr_1to_1ldr_1scale(JNIEnv *__env, jclass clazz, jfloat scale) { - UNUSED_PARAMS(__env, clazz) - stbi_hdr_to_ldr_scale(scale); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_stbi_1ldr_1to_1hdr_1gamma(JNIEnv *__env, jclass clazz, jfloat gamma) { - UNUSED_PARAMS(__env, clazz) - stbi_ldr_to_hdr_gamma(gamma); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_stbi_1ldr_1to_1hdr_1scale(JNIEnv *__env, jclass clazz, jfloat scale) { - UNUSED_PARAMS(__env, clazz) - stbi_ldr_to_hdr_scale(scale); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1is_1hdr(JNIEnv *__env, jclass clazz, jlong filenameAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_is_hdr(filename); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1is_1hdr_1from_1memory(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_is_hdr_from_memory(buffer, len); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1is_1hdr_1from_1callbacks(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_is_hdr_from_callbacks(clbk, user); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1failure_1reason(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_failure_reason(); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1image_1free(JNIEnv *__env, jclass clazz, jlong retval_from_stbi_loadAddress) { - void *retval_from_stbi_load = (void *)(uintptr_t)retval_from_stbi_loadAddress; - UNUSED_PARAMS(__env, clazz) - stbi_image_free(retval_from_stbi_load); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1info__JJJJ(JNIEnv *__env, jclass clazz, jlong filenameAddress, jlong xAddress, jlong yAddress, jlong compAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *comp = (int *)(uintptr_t)compAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_info(filename, x, y, comp); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1info_1from_1memory__JIJJJ(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jlong xAddress, jlong yAddress, jlong compAddress) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *comp = (int *)(uintptr_t)compAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_info_from_memory(buffer, len, x, y, comp); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1info_1from_1callbacks__JJJJJ(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress, jlong xAddress, jlong yAddress, jlong compAddress) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - int *x = (int *)(uintptr_t)xAddress; - int *y = (int *)(uintptr_t)yAddress; - int *comp = (int *)(uintptr_t)compAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_info_from_callbacks(clbk, user, x, y, comp); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1is_116_1bit(JNIEnv *__env, jclass clazz, jlong filenameAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_is_16_bit(filename); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1is_116_1bit_1from_1memory(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_is_16_bit_from_memory(buffer, len); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1is_116_1bit_1from_1callbacks(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_is_16_bit_from_callbacks(clbk, user); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1set_1unpremultiply_1on_1load(JNIEnv *__env, jclass clazz, jint flag_true_if_should_unpremultiply) { - UNUSED_PARAMS(__env, clazz) - stbi_set_unpremultiply_on_load(flag_true_if_should_unpremultiply); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1convert_1iphone_1png_1to_1rgb(JNIEnv *__env, jclass clazz, jint flag_true_if_should_convert) { - UNUSED_PARAMS(__env, clazz) - stbi_convert_iphone_png_to_rgb(flag_true_if_should_convert); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1set_1flip_1vertically_1on_1load(JNIEnv *__env, jclass clazz, jint flag_true_if_should_flip) { - UNUSED_PARAMS(__env, clazz) - stbi_set_flip_vertically_on_load(flag_true_if_should_flip); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1set_1unpremultiply_1on_1load_1thread(JNIEnv *__env, jclass clazz, jint flag_true_if_should_unpremultiply) { - UNUSED_PARAMS(__env, clazz) - stbi_set_unpremultiply_on_load_thread(flag_true_if_should_unpremultiply); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1convert_1iphone_1png_1to_1rgb_1thread(JNIEnv *__env, jclass clazz, jint flag_true_if_should_convert) { - UNUSED_PARAMS(__env, clazz) - stbi_convert_iphone_png_to_rgb_thread(flag_true_if_should_convert); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImage_stbi_1set_1flip_1vertically_1on_1load_1thread(JNIEnv *__env, jclass clazz, jint flag_true_if_should_flip) { - UNUSED_PARAMS(__env, clazz) - stbi_set_flip_vertically_on_load_thread(flag_true_if_should_flip); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1zlib_1decode_1malloc_1guesssize(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jint initial_size, jlong outlenAddress) { - char const *buffer = (char const *)(uintptr_t)bufferAddress; - int *outlen = (int *)(uintptr_t)outlenAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_zlib_decode_malloc_guesssize(buffer, len, initial_size, outlen); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1zlib_1decode_1malloc_1guesssize_1headerflag(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jint initial_size, jlong outlenAddress, jint parse_header) { - char const *buffer = (char const *)(uintptr_t)bufferAddress; - int *outlen = (int *)(uintptr_t)outlenAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_zlib_decode_malloc_guesssize_headerflag(buffer, len, initial_size, outlen, parse_header); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1zlib_1decode_1malloc(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jlong outlenAddress) { - char const *buffer = (char const *)(uintptr_t)bufferAddress; - int *outlen = (int *)(uintptr_t)outlenAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_zlib_decode_malloc(buffer, len, outlen); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1zlib_1decode_1buffer(JNIEnv *__env, jclass clazz, jlong obufferAddress, jint olen, jlong ibufferAddress, jint ilen) { - char *obuffer = (char *)(uintptr_t)obufferAddress; - char const *ibuffer = (char const *)(uintptr_t)ibufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_zlib_decode_buffer(obuffer, olen, ibuffer, ilen); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1zlib_1decode_1noheader_1malloc(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jlong outlenAddress) { - char const *buffer = (char const *)(uintptr_t)bufferAddress; - int *outlen = (int *)(uintptr_t)outlenAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbi_zlib_decode_noheader_malloc(buffer, len, outlen); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1zlib_1decode_1noheader_1buffer(JNIEnv *__env, jclass clazz, jlong obufferAddress, jint olen, jlong ibufferAddress, jint ilen) { - char *obuffer = (char *)(uintptr_t)obufferAddress; - char const *ibuffer = (char const *)(uintptr_t)ibufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_zlib_decode_noheader_buffer(obuffer, olen, ibuffer, ilen); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load__J_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong filenameAddress, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_load(filename, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_1from_1memory__JI_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_load_from_memory(buffer, len, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_1from_1callbacks__JJ_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_load_from_callbacks(clbk, user, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_1gif_1from_1memory__JIJ_3I_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jlong delaysAddress, jintArray xAddress, jintArray yAddress, jintArray zAddress, jintArray channels_in_fileAddress, jint desired_channels) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - int **delays = (int **)(uintptr_t)delaysAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *z = (*__env)->GetIntArrayElements(__env, zAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_load_gif_from_memory(buffer, len, delays, (int *)x, (int *)y, (int *)z, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, zAddress, z, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_116__J_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong filenameAddress, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_load_16(filename, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_116_1from_1memory__JI_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_load_16_from_memory(buffer, len, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1load_116_1from_1callbacks__JJ_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_load_16_from_callbacks(clbk, user, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1loadf__J_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong filenameAddress, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_loadf(filename, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1loadf_1from_1memory__JI_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_loadf_from_memory(buffer, len, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1loadf_1from_1callbacks__JJ_3I_3I_3II(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress, jintArray xAddress, jintArray yAddress, jintArray channels_in_fileAddress, jint desired_channels) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - jlong __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *channels_in_file = (*__env)->GetIntArrayElements(__env, channels_in_fileAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbi_loadf_from_callbacks(clbk, user, (int *)x, (int *)y, (int *)channels_in_file, desired_channels); - (*__env)->ReleaseIntArrayElements(__env, channels_in_fileAddress, channels_in_file, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1info__J_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong filenameAddress, jintArray xAddress, jintArray yAddress, jintArray compAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - jint __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *comp = (*__env)->GetIntArrayElements(__env, compAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbi_info(filename, (int *)x, (int *)y, (int *)comp); - (*__env)->ReleaseIntArrayElements(__env, compAddress, comp, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1info_1from_1memory__JI_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong bufferAddress, jint len, jintArray xAddress, jintArray yAddress, jintArray compAddress) { - stbi_uc const *buffer = (stbi_uc const *)(uintptr_t)bufferAddress; - jint __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *comp = (*__env)->GetIntArrayElements(__env, compAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbi_info_from_memory(buffer, len, (int *)x, (int *)y, (int *)comp); - (*__env)->ReleaseIntArrayElements(__env, compAddress, comp, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImage_nstbi_1info_1from_1callbacks__JJ_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong clbkAddress, jlong userAddress, jintArray xAddress, jintArray yAddress, jintArray compAddress) { - stbi_io_callbacks const *clbk = (stbi_io_callbacks const *)(uintptr_t)clbkAddress; - void *user = (void *)(uintptr_t)userAddress; - jint __result; - jint *x = (*__env)->GetIntArrayElements(__env, xAddress, NULL); - jint *y = (*__env)->GetIntArrayElements(__env, yAddress, NULL); - jint *comp = (*__env)->GetIntArrayElements(__env, compAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbi_info_from_callbacks(clbk, user, (int *)x, (int *)y, (int *)comp); - (*__env)->ReleaseIntArrayElements(__env, compAddress, comp, 0); - (*__env)->ReleaseIntArrayElements(__env, yAddress, y, 0); - (*__env)->ReleaseIntArrayElements(__env, xAddress, x, 0); - return __result; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImageResize.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImageResize.c deleted file mode 100644 index 79709103..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImageResize.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#include "lwjgl/lwjgl_malloc.h" -#define STBIR_MALLOC(size,c) org_lwjgl_malloc(size) -#define STBIR_FREE(ptr,c) org_lwjgl_free(ptr) -#define STBIR_ASSERT(x) -#define STB_IMAGE_RESIZE_IMPLEMENTATION -#define STB_IMAGE_RESIZE_STATIC -#include "stb_image_resize.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1uint8(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels) { - unsigned char const *input_pixels = (unsigned char const *)(uintptr_t)input_pixelsAddress; - unsigned char *output_pixels = (unsigned char *)(uintptr_t)output_pixelsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_resize_uint8(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, num_channels); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1float__JIIIJIIII(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels) { - float const *input_pixels = (float const *)(uintptr_t)input_pixelsAddress; - float *output_pixels = (float *)(uintptr_t)output_pixelsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_resize_float(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, num_channels); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1uint8_1srgb(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels, jint alpha_channel, jint flags) { - unsigned char const *input_pixels = (unsigned char const *)(uintptr_t)input_pixelsAddress; - unsigned char *output_pixels = (unsigned char *)(uintptr_t)output_pixelsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_resize_uint8_srgb(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); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1uint8_1srgb_1edgemode(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels, jint alpha_channel, jint flags, jint edge_wrap_mode) { - unsigned char const *input_pixels = (unsigned char const *)(uintptr_t)input_pixelsAddress; - unsigned char *output_pixels = (unsigned char *)(uintptr_t)output_pixelsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_resize_uint8_srgb_edgemode(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, (stbir_edge)edge_wrap_mode); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1uint8_1generic(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels, jint alpha_channel, jint flags, jint edge_wrap_mode, jint filter, jint space, jlong alloc_contextAddress) { - unsigned char const *input_pixels = (unsigned char const *)(uintptr_t)input_pixelsAddress; - unsigned char *output_pixels = (unsigned char *)(uintptr_t)output_pixelsAddress; - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_resize_uint8_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, (stbir_edge)edge_wrap_mode, (stbir_filter)filter, (stbir_colorspace)space, alloc_context); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1uint16_1generic__JIIIJIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels, jint alpha_channel, jint flags, jint edge_wrap_mode, jint filter, jint space, jlong alloc_contextAddress) { - stbir_uint16 const *input_pixels = (stbir_uint16 const *)(uintptr_t)input_pixelsAddress; - stbir_uint16 *output_pixels = (stbir_uint16 *)(uintptr_t)output_pixelsAddress; - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_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, (stbir_edge)edge_wrap_mode, (stbir_filter)filter, (stbir_colorspace)space, alloc_context); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1float_1generic__JIIIJIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels, jint alpha_channel, jint flags, jint edge_wrap_mode, jint filter, jint space, jlong alloc_contextAddress) { - float const *input_pixels = (float const *)(uintptr_t)input_pixelsAddress; - float *output_pixels = (float *)(uintptr_t)output_pixelsAddress; - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_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, (stbir_edge)edge_wrap_mode, (stbir_filter)filter, (stbir_colorspace)space, alloc_context); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint datatype, jint num_channels, jint alpha_channel, jint flags, jint edge_mode_horizontal, jint edge_mode_vertical, jint filter_horizontal, jint filter_vertical, jint space, jlong alloc_contextAddress) { - void const *input_pixels = (void const *)(uintptr_t)input_pixelsAddress; - void *output_pixels = (void *)(uintptr_t)output_pixelsAddress; - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_resize(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, (stbir_datatype)datatype, num_channels, alpha_channel, flags, (stbir_edge)edge_mode_horizontal, (stbir_edge)edge_mode_vertical, (stbir_filter)filter_horizontal, (stbir_filter)filter_vertical, (stbir_colorspace)space, alloc_context); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1subpixel(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint datatype, jint num_channels, jint alpha_channel, jint flags, jint edge_mode_horizontal, jint edge_mode_vertical, jint filter_horizontal, jint filter_vertical, jint space, jlong alloc_contextAddress, jfloat x_scale, jfloat y_scale, jfloat x_offset, jfloat y_offset) { - void const *input_pixels = (void const *)(uintptr_t)input_pixelsAddress; - void *output_pixels = (void *)(uintptr_t)output_pixelsAddress; - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_resize_subpixel(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, (stbir_datatype)datatype, num_channels, alpha_channel, flags, (stbir_edge)edge_mode_horizontal, (stbir_edge)edge_mode_vertical, (stbir_filter)filter_horizontal, (stbir_filter)filter_vertical, (stbir_colorspace)space, alloc_context, x_scale, y_scale, x_offset, y_offset); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1region(JNIEnv *__env, jclass clazz, jlong input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jlong output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint datatype, jint num_channels, jint alpha_channel, jint flags, jint edge_mode_horizontal, jint edge_mode_vertical, jint filter_horizontal, jint filter_vertical, jint space, jlong alloc_contextAddress, jfloat s0, jfloat t0, jfloat s1, jfloat t1) { - void const *input_pixels = (void const *)(uintptr_t)input_pixelsAddress; - void *output_pixels = (void *)(uintptr_t)output_pixelsAddress; - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbir_resize_region(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, (stbir_datatype)datatype, num_channels, alpha_channel, flags, (stbir_edge)edge_mode_horizontal, (stbir_edge)edge_mode_vertical, (stbir_filter)filter_horizontal, (stbir_filter)filter_vertical, (stbir_colorspace)space, alloc_context, s0, t0, s1, t1); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1float___3FIII_3FIIII(JNIEnv *__env, jclass clazz, jfloatArray input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jfloatArray output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels) { - jint __result; - jfloat *input_pixels = (*__env)->GetFloatArrayElements(__env, input_pixelsAddress, NULL); - jfloat *output_pixels = (*__env)->GetFloatArrayElements(__env, output_pixelsAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbir_resize_float((float const *)input_pixels, input_w, input_h, input_stride_in_bytes, (float *)output_pixels, output_w, output_h, output_stride_in_bytes, num_channels); - (*__env)->ReleaseFloatArrayElements(__env, output_pixelsAddress, output_pixels, 0); - (*__env)->ReleaseFloatArrayElements(__env, input_pixelsAddress, input_pixels, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1uint16_1generic___3SIII_3SIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jshortArray input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jshortArray output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels, jint alpha_channel, jint flags, jint edge_wrap_mode, jint filter, jint space, jlong alloc_contextAddress) { - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - jint __result; - jshort *input_pixels = (*__env)->GetShortArrayElements(__env, input_pixelsAddress, NULL); - jshort *output_pixels = (*__env)->GetShortArrayElements(__env, output_pixelsAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbir_resize_uint16_generic((stbir_uint16 const *)input_pixels, input_w, input_h, input_stride_in_bytes, (stbir_uint16 *)output_pixels, output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, (stbir_edge)edge_wrap_mode, (stbir_filter)filter, (stbir_colorspace)space, alloc_context); - (*__env)->ReleaseShortArrayElements(__env, output_pixelsAddress, output_pixels, 0); - (*__env)->ReleaseShortArrayElements(__env, input_pixelsAddress, input_pixels, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageResize_nstbir_1resize_1float_1generic___3FIII_3FIIIIIIIIIJ(JNIEnv *__env, jclass clazz, jfloatArray input_pixelsAddress, jint input_w, jint input_h, jint input_stride_in_bytes, jfloatArray output_pixelsAddress, jint output_w, jint output_h, jint output_stride_in_bytes, jint num_channels, jint alpha_channel, jint flags, jint edge_wrap_mode, jint filter, jint space, jlong alloc_contextAddress) { - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - jint __result; - jfloat *input_pixels = (*__env)->GetFloatArrayElements(__env, input_pixelsAddress, NULL); - jfloat *output_pixels = (*__env)->GetFloatArrayElements(__env, output_pixelsAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbir_resize_float_generic((float const *)input_pixels, input_w, input_h, input_stride_in_bytes, (float *)output_pixels, output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, (stbir_edge)edge_wrap_mode, (stbir_filter)filter, (stbir_colorspace)space, alloc_context); - (*__env)->ReleaseFloatArrayElements(__env, output_pixelsAddress, output_pixels, 0); - (*__env)->ReleaseFloatArrayElements(__env, input_pixelsAddress, input_pixels, 0); - return __result; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImageWrite.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImageWrite.c deleted file mode 100644 index 222c9e31..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBImageWrite.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#include "lwjgl/lwjgl_malloc.h" -#define STBIW_MALLOC(sz) org_lwjgl_malloc(sz) -#define STBIW_REALLOC(p,sz) org_lwjgl_realloc(p,sz) -#define STBIW_FREE(p) org_lwjgl_free(p) -#define STBIW_ASSERT(x) -#define STB_IMAGE_WRITE_IMPLEMENTATION -#define STB_IMAGE_WRITE_STATIC -#ifdef LWJGL_WINDOWS - #define STBIW_WINDOWS_UTF8 - #define STBI_MSC_SECURE_CRT -#endif -#include "stb_image_write.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1png(JNIEnv *__env, jclass clazz, jlong filenameAddress, jint w, jint h, jint comp, jlong dataAddress, jint stride_in_bytes) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - void const *data = (void const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_png(filename, w, h, comp, data, stride_in_bytes); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1png_1compression_1level(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&stbi_write_png_compression_level; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1force_1png_1filter(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&stbi_write_force_png_filter; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1zlib_1compress(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&stbi_zlib_compress; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1bmp(JNIEnv *__env, jclass clazz, jlong filenameAddress, jint w, jint h, jint comp, jlong dataAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - void const *data = (void const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_bmp(filename, w, h, comp, data); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1tga(JNIEnv *__env, jclass clazz, jlong filenameAddress, jint w, jint h, jint comp, jlong dataAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - void const *data = (void const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_tga(filename, w, h, comp, data); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1tga_1with_1rle(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)&stbi_write_tga_with_rle; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1hdr__JIIIJ(JNIEnv *__env, jclass clazz, jlong filenameAddress, jint w, jint h, jint comp, jlong dataAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - float const *data = (float const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_hdr(filename, w, h, comp, data); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1jpg(JNIEnv *__env, jclass clazz, jlong filenameAddress, jint w, jint h, jint comp, jlong dataAddress, jint quality) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - void const *data = (void const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_jpg(filename, w, h, comp, data, quality); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1png_1to_1func(JNIEnv *__env, jclass clazz, jlong funcAddress, jlong contextAddress, jint w, jint h, jint comp, jlong dataAddress, jint stride_in_bytes) { - stbi_write_func *func = (stbi_write_func *)(uintptr_t)funcAddress; - void *context = (void *)(uintptr_t)contextAddress; - void const *data = (void const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_png_to_func(func, context, w, h, comp, data, stride_in_bytes); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1bmp_1to_1func(JNIEnv *__env, jclass clazz, jlong funcAddress, jlong contextAddress, jint w, jint h, jint comp, jlong dataAddress) { - stbi_write_func *func = (stbi_write_func *)(uintptr_t)funcAddress; - void *context = (void *)(uintptr_t)contextAddress; - void const *data = (void const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_bmp_to_func(func, context, w, h, comp, data); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1tga_1to_1func(JNIEnv *__env, jclass clazz, jlong funcAddress, jlong contextAddress, jint w, jint h, jint comp, jlong dataAddress) { - stbi_write_func *func = (stbi_write_func *)(uintptr_t)funcAddress; - void *context = (void *)(uintptr_t)contextAddress; - void const *data = (void const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_tga_to_func(func, context, w, h, comp, data); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1hdr_1to_1func__JJIIIJ(JNIEnv *__env, jclass clazz, jlong funcAddress, jlong contextAddress, jint w, jint h, jint comp, jlong dataAddress) { - stbi_write_func *func = (stbi_write_func *)(uintptr_t)funcAddress; - void *context = (void *)(uintptr_t)contextAddress; - float const *data = (float const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_hdr_to_func(func, context, w, h, comp, data); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1jpg_1to_1func(JNIEnv *__env, jclass clazz, jlong funcAddress, jlong contextAddress, jint w, jint h, jint comp, jlong dataAddress, jint quality) { - stbi_write_func *func = (stbi_write_func *)(uintptr_t)funcAddress; - void *context = (void *)(uintptr_t)contextAddress; - void const *data = (void const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbi_write_jpg_to_func(func, context, w, h, comp, data, quality); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1flip_1vertically_1on_1write(JNIEnv *__env, jclass clazz, jint flip_boolean) { - UNUSED_PARAMS(__env, clazz) - stbi_flip_vertically_on_write(flip_boolean); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1hdr__JIII_3F(JNIEnv *__env, jclass clazz, jlong filenameAddress, jint w, jint h, jint comp, jfloatArray dataAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - jint __result; - jfloat *data = (*__env)->GetFloatArrayElements(__env, dataAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbi_write_hdr(filename, w, h, comp, (float const *)data); - (*__env)->ReleaseFloatArrayElements(__env, dataAddress, data, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBImageWrite_nstbi_1write_1hdr_1to_1func__JJIII_3F(JNIEnv *__env, jclass clazz, jlong funcAddress, jlong contextAddress, jint w, jint h, jint comp, jfloatArray dataAddress) { - stbi_write_func *func = (stbi_write_func *)(uintptr_t)funcAddress; - void *context = (void *)(uintptr_t)contextAddress; - jint __result; - jfloat *data = (*__env)->GetFloatArrayElements(__env, dataAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbi_write_hdr_to_func(func, context, w, h, comp, (float const *)data); - (*__env)->ReleaseFloatArrayElements(__env, dataAddress, data, 0); - return __result; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBPerlin.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBPerlin.c deleted file mode 100644 index fbe52c6d..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBPerlin.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#define STB_PERLIN_IMPLEMENTATION -#include "stb_perlin.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBPerlin_stb_1perlin_1noise3(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z, jint x_wrap, jint y_wrap, jint z_wrap) { - UNUSED_PARAMS(__env, clazz) - return (jfloat)stb_perlin_noise3(x, y, z, x_wrap, y_wrap, z_wrap); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBPerlin_stb_1perlin_1noise3_1seed(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z, jint x_wrap, jint y_wrap, jint z_wrap, jint seed) { - UNUSED_PARAMS(__env, clazz) - return (jfloat)stb_perlin_noise3_seed(x, y, z, x_wrap, y_wrap, z_wrap, seed); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBPerlin_stb_1perlin_1ridge_1noise3(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z, jfloat lacunarity, jfloat gain, jfloat offset, jint octaves) { - UNUSED_PARAMS(__env, clazz) - return (jfloat)stb_perlin_ridge_noise3(x, y, z, lacunarity, gain, offset, octaves); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBPerlin_stb_1perlin_1fbm_1noise3(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z, jfloat lacunarity, jfloat gain, jint octaves) { - UNUSED_PARAMS(__env, clazz) - return (jfloat)stb_perlin_fbm_noise3(x, y, z, lacunarity, gain, octaves); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBPerlin_stb_1perlin_1turbulence_1noise3(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z, jfloat lacunarity, jfloat gain, jint octaves) { - UNUSED_PARAMS(__env, clazz) - return (jfloat)stb_perlin_turbulence_noise3(x, y, z, lacunarity, gain, octaves); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBPerlin_stb_1perlin_1noise3_1wrap_1nonpow2(JNIEnv *__env, jclass clazz, jfloat x, jfloat y, jfloat z, jint x_wrap, jint y_wrap, jint z_wrap, jbyte seed) { - UNUSED_PARAMS(__env, clazz) - return (jfloat)stb_perlin_noise3_wrap_nonpow2(x, y, z, x_wrap, y_wrap, z_wrap, (unsigned char)seed); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBRectPack.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBRectPack.c deleted file mode 100644 index 6bfa8800..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBRectPack.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#define STBRP_ASSERT -#define STB_RECT_PACK_IMPLEMENTATION -#include "stb_rect_pack.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBRectPack_nstbrp_1pack_1rects(JNIEnv *__env, jclass clazz, jlong contextAddress, jlong rectsAddress, jint num_rects) { - stbrp_context *context = (stbrp_context *)(uintptr_t)contextAddress; - stbrp_rect *rects = (stbrp_rect *)(uintptr_t)rectsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbrp_pack_rects(context, rects, num_rects); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBRectPack_nstbrp_1init_1target(JNIEnv *__env, jclass clazz, jlong contextAddress, jint width, jint height, jlong nodesAddress, jint num_nodes) { - stbrp_context *context = (stbrp_context *)(uintptr_t)contextAddress; - stbrp_node *nodes = (stbrp_node *)(uintptr_t)nodesAddress; - UNUSED_PARAMS(__env, clazz) - stbrp_init_target(context, width, height, nodes, num_nodes); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBRectPack_nstbrp_1setup_1allow_1out_1of_1mem(JNIEnv *__env, jclass clazz, jlong contextAddress, jint allow_out_of_mem) { - stbrp_context *context = (stbrp_context *)(uintptr_t)contextAddress; - UNUSED_PARAMS(__env, clazz) - stbrp_setup_allow_out_of_mem(context, allow_out_of_mem); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBRectPack_nstbrp_1setup_1heuristic(JNIEnv *__env, jclass clazz, jlong contextAddress, jint heuristic) { - stbrp_context *context = (stbrp_context *)(uintptr_t)contextAddress; - UNUSED_PARAMS(__env, clazz) - stbrp_setup_heuristic(context, heuristic); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBTTFontinfo.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBTTFontinfo.c deleted file mode 100644 index d90ac874..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBTTFontinfo.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include -DISABLE_WARNINGS() -#include "stb_truetype.h" -ENABLE_WARNINGS() -#ifdef LWJGL_WINDOWS - #define alignof __alignof -#else - #include -#endif - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTTFontinfo_offsets(JNIEnv *__env, jclass clazz, jlong bufferAddress) { - jint *buffer = (jint *)(uintptr_t)bufferAddress; - - UNUSED_PARAMS(__env, clazz) - - buffer[0] = alignof(stbtt_fontinfo); - - return sizeof(stbtt_fontinfo); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBTruetype.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBTruetype.c deleted file mode 100644 index 9d9f76ae..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBTruetype.c +++ /dev/null @@ -1,784 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#include "lwjgl/lwjgl_malloc.h" -#define STBTT_malloc(x,u) ((void)(u),org_lwjgl_malloc(x)) -#define STBTT_free(x,u) ((void)(u),org_lwjgl_free(x)) -#define STBTT_assert -#define STB_TRUETYPE_IMPLEMENTATION -#define STBTT_STATIC -#include "stb_rect_pack.h" -#include "stb_truetype.h" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1BakeFontBitmap(JNIEnv *__env, jclass clazz, jlong dataAddress, jint offset, jfloat pixel_height, jlong pixelsAddress, jint pw, jint ph, jint first_char, jint num_chars, jlong chardataAddress) { - unsigned char const *data = (unsigned char const *)(uintptr_t)dataAddress; - unsigned char *pixels = (unsigned char *)(uintptr_t)pixelsAddress; - stbtt_bakedchar *chardata = (stbtt_bakedchar *)(uintptr_t)chardataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_BakeFontBitmap(data, offset, pixel_height, pixels, pw, ph, first_char, num_chars, chardata); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetBakedQuad__JIIIJJJI(JNIEnv *__env, jclass clazz, jlong chardataAddress, jint pw, jint ph, jint char_index, jlong xposAddress, jlong yposAddress, jlong qAddress, jint opengl_fillrule) { - stbtt_bakedchar const *chardata = (stbtt_bakedchar const *)(uintptr_t)chardataAddress; - float *xpos = (float *)(uintptr_t)xposAddress; - float *ypos = (float *)(uintptr_t)yposAddress; - stbtt_aligned_quad *q = (stbtt_aligned_quad *)(uintptr_t)qAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_GetBakedQuad(chardata, pw, ph, char_index, xpos, ypos, q, opengl_fillrule); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetScaledFontVMetrics__JIFJJJ(JNIEnv *__env, jclass clazz, jlong fontdataAddress, jint index, jfloat size, jlong ascentAddress, jlong descentAddress, jlong lineGapAddress) { - unsigned char const *fontdata = (unsigned char const *)(uintptr_t)fontdataAddress; - float *ascent = (float *)(uintptr_t)ascentAddress; - float *descent = (float *)(uintptr_t)descentAddress; - float *lineGap = (float *)(uintptr_t)lineGapAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_GetScaledFontVMetrics(fontdata, index, size, ascent, descent, lineGap); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackBegin(JNIEnv *__env, jclass clazz, jlong spcAddress, jlong pixelsAddress, jint width, jint height, jint stride_in_bytes, jint padding, jlong alloc_contextAddress) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - unsigned char *pixels = (unsigned char *)(uintptr_t)pixelsAddress; - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_PackBegin(spc, pixels, width, height, stride_in_bytes, padding, alloc_context); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackEnd(JNIEnv *__env, jclass clazz, jlong spcAddress) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_PackEnd(spc); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackFontRange(JNIEnv *__env, jclass clazz, jlong spcAddress, jlong fontdataAddress, jint font_index, jfloat font_size, jint first_unicode_char_in_range, jint num_chars_in_range, jlong chardata_for_rangeAddress) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - unsigned char const *fontdata = (unsigned char const *)(uintptr_t)fontdataAddress; - stbtt_packedchar *chardata_for_range = (stbtt_packedchar *)(uintptr_t)chardata_for_rangeAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_PackFontRange(spc, fontdata, font_index, font_size, first_unicode_char_in_range, num_chars_in_range, chardata_for_range); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackFontRanges(JNIEnv *__env, jclass clazz, jlong spcAddress, jlong fontdataAddress, jint font_index, jlong rangesAddress, jint num_ranges) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - unsigned char const *fontdata = (unsigned char const *)(uintptr_t)fontdataAddress; - stbtt_pack_range *ranges = (stbtt_pack_range *)(uintptr_t)rangesAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_PackFontRanges(spc, fontdata, font_index, ranges, num_ranges); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackSetOversampling(JNIEnv *__env, jclass clazz, jlong spcAddress, jint h_oversample, jint v_oversample) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_PackSetOversampling(spc, (unsigned int)h_oversample, (unsigned int)v_oversample); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackSetSkipMissingCodepoints(JNIEnv *__env, jclass clazz, jlong spcAddress, jint skip) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_PackSetSkipMissingCodepoints(spc, skip); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetPackedQuad__JIIIJJJI(JNIEnv *__env, jclass clazz, jlong chardataAddress, jint pw, jint ph, jint char_index, jlong xposAddress, jlong yposAddress, jlong qAddress, jint align_to_integer) { - stbtt_packedchar const *chardata = (stbtt_packedchar const *)(uintptr_t)chardataAddress; - float *xpos = (float *)(uintptr_t)xposAddress; - float *ypos = (float *)(uintptr_t)yposAddress; - stbtt_aligned_quad *q = (stbtt_aligned_quad *)(uintptr_t)qAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_GetPackedQuad(chardata, pw, ph, char_index, xpos, ypos, q, align_to_integer); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackFontRangesGatherRects(JNIEnv *__env, jclass clazz, jlong spcAddress, jlong infoAddress, jlong rangesAddress, jint num_ranges, jlong rectsAddress) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - stbtt_fontinfo *info = (stbtt_fontinfo *)(uintptr_t)infoAddress; - stbtt_pack_range *ranges = (stbtt_pack_range *)(uintptr_t)rangesAddress; - stbrp_rect *rects = (stbrp_rect *)(uintptr_t)rectsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_PackFontRangesGatherRects(spc, info, ranges, num_ranges, rects); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackFontRangesPackRects(JNIEnv *__env, jclass clazz, jlong spcAddress, jlong rectsAddress, jint num_rects) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - stbrp_rect *rects = (stbrp_rect *)(uintptr_t)rectsAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_PackFontRangesPackRects(spc, rects, num_rects); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1PackFontRangesRenderIntoRects(JNIEnv *__env, jclass clazz, jlong spcAddress, jlong infoAddress, jlong rangesAddress, jint num_ranges, jlong rectsAddress) { - stbtt_pack_context *spc = (stbtt_pack_context *)(uintptr_t)spcAddress; - stbtt_fontinfo *info = (stbtt_fontinfo *)(uintptr_t)infoAddress; - stbtt_pack_range *ranges = (stbtt_pack_range *)(uintptr_t)rangesAddress; - stbrp_rect *rects = (stbrp_rect *)(uintptr_t)rectsAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_PackFontRangesRenderIntoRects(spc, info, ranges, num_ranges, rects); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetNumberOfFonts(JNIEnv *__env, jclass clazz, jlong dataAddress) { - unsigned char const *data = (unsigned char const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetNumberOfFonts(data); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetFontOffsetForIndex(JNIEnv *__env, jclass clazz, jlong dataAddress, jint index) { - unsigned char const *data = (unsigned char const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetFontOffsetForIndex(data, index); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1InitFont(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong dataAddress, jint offset) { - stbtt_fontinfo *info = (stbtt_fontinfo *)(uintptr_t)infoAddress; - unsigned char const *data = (unsigned char const *)(uintptr_t)dataAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_InitFont(info, data, offset); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1FindGlyphIndex(JNIEnv *__env, jclass clazz, jlong infoAddress, jint unicode_codepoint) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_FindGlyphIndex(info, unicode_codepoint); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1ScaleForPixelHeight(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat pixels) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - UNUSED_PARAMS(__env, clazz) - return (jfloat)stbtt_ScaleForPixelHeight(info, pixels); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1ScaleForMappingEmToPixels(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat pixels) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - UNUSED_PARAMS(__env, clazz) - return (jfloat)stbtt_ScaleForMappingEmToPixels(info, pixels); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetFontVMetrics__JJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong ascentAddress, jlong descentAddress, jlong lineGapAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *ascent = (int *)(uintptr_t)ascentAddress; - int *descent = (int *)(uintptr_t)descentAddress; - int *lineGap = (int *)(uintptr_t)lineGapAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_GetFontVMetrics(info, ascent, descent, lineGap); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetFontVMetricsOS2__JJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong typoAscentAddress, jlong typoDescentAddress, jlong typoLineGapAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *typoAscent = (int *)(uintptr_t)typoAscentAddress; - int *typoDescent = (int *)(uintptr_t)typoDescentAddress; - int *typoLineGap = (int *)(uintptr_t)typoLineGapAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetFontVMetricsOS2(info, typoAscent, typoDescent, typoLineGap); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetFontBoundingBox__JJJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong x0Address, jlong y0Address, jlong x1Address, jlong y1Address) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *x0 = (int *)(uintptr_t)x0Address; - int *y0 = (int *)(uintptr_t)y0Address; - int *x1 = (int *)(uintptr_t)x1Address; - int *y1 = (int *)(uintptr_t)y1Address; - UNUSED_PARAMS(__env, clazz) - stbtt_GetFontBoundingBox(info, x0, y0, x1, y1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointHMetrics__JIJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jint codepoint, jlong advanceWidthAddress, jlong leftSideBearingAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *advanceWidth = (int *)(uintptr_t)advanceWidthAddress; - int *leftSideBearing = (int *)(uintptr_t)leftSideBearingAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_GetCodepointHMetrics(info, codepoint, advanceWidth, leftSideBearing); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointKernAdvance(JNIEnv *__env, jclass clazz, jlong infoAddress, jint ch1, jint ch2) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetCodepointKernAdvance(info, ch1, ch2); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBox__JIJJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jint codepoint, jlong x0Address, jlong y0Address, jlong x1Address, jlong y1Address) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *x0 = (int *)(uintptr_t)x0Address; - int *y0 = (int *)(uintptr_t)y0Address; - int *x1 = (int *)(uintptr_t)x1Address; - int *y1 = (int *)(uintptr_t)y1Address; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetCodepointBox(info, codepoint, x0, y0, x1, y1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphHMetrics__JIJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jint glyph_index, jlong advanceWidthAddress, jlong leftSideBearingAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *advanceWidth = (int *)(uintptr_t)advanceWidthAddress; - int *leftSideBearing = (int *)(uintptr_t)leftSideBearingAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_GetGlyphHMetrics(info, glyph_index, advanceWidth, leftSideBearing); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphKernAdvance(JNIEnv *__env, jclass clazz, jlong infoAddress, jint glyph1, jint glyph2) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetGlyphKernAdvance(info, glyph1, glyph2); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBox__JIJJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jint glyph_index, jlong x0Address, jlong y0Address, jlong x1Address, jlong y1Address) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *x0 = (int *)(uintptr_t)x0Address; - int *y0 = (int *)(uintptr_t)y0Address; - int *x1 = (int *)(uintptr_t)x1Address; - int *y1 = (int *)(uintptr_t)y1Address; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetGlyphBox(info, glyph_index, x0, y0, x1, y1); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetKerningTableLength(JNIEnv *__env, jclass clazz, jlong infoAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetKerningTableLength(info); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetKerningTable(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong tableAddress, jint table_length) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - stbtt_kerningentry *table = (stbtt_kerningentry *)(uintptr_t)tableAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetKerningTable(info, table, table_length); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1IsGlyphEmpty(JNIEnv *__env, jclass clazz, jlong infoAddress, jint glyph_index) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_IsGlyphEmpty(info, glyph_index); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointShape(JNIEnv *__env, jclass clazz, jlong infoAddress, jint unicode_codepoint, jlong verticesAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - stbtt_vertex **vertices = (stbtt_vertex **)(uintptr_t)verticesAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetCodepointShape(info, unicode_codepoint, vertices); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphShape(JNIEnv *__env, jclass clazz, jlong infoAddress, jint glyph_index, jlong verticesAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - stbtt_vertex **vertices = (stbtt_vertex **)(uintptr_t)verticesAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetGlyphShape(info, glyph_index, vertices); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1FreeShape(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong verticesAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - stbtt_vertex *vertices = (stbtt_vertex *)(uintptr_t)verticesAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_FreeShape(info, vertices); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1FindSVGDoc(JNIEnv *__env, jclass clazz, jlong infoAddress, jint gl) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbtt_FindSVGDoc(info, gl); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointSVG(JNIEnv *__env, jclass clazz, jlong infoAddress, jint unicode_codepoint, jlong svgAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - char const **svg = (char const **)(uintptr_t)svgAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetCodepointSVG(info, unicode_codepoint, svg); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphSVG(JNIEnv *__env, jclass clazz, jlong infoAddress, jint gl, jlong svgAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - char const **svg = (char const **)(uintptr_t)svgAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_GetGlyphSVG(info, gl, svg); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1FreeBitmap(JNIEnv *__env, jclass clazz, jlong bitmapAddress, jlong userdataAddress) { - unsigned char *bitmap = (unsigned char *)(uintptr_t)bitmapAddress; - void *userdata = (void *)(uintptr_t)userdataAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_FreeBitmap(bitmap, userdata); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBitmap__JFFIJJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat scale_x, jfloat scale_y, jint codepoint, jlong widthAddress, jlong heightAddress, jlong xoffAddress, jlong yoffAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *width = (int *)(uintptr_t)widthAddress; - int *height = (int *)(uintptr_t)heightAddress; - int *xoff = (int *)(uintptr_t)xoffAddress; - int *yoff = (int *)(uintptr_t)yoffAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbtt_GetCodepointBitmap(info, scale_x, scale_y, codepoint, width, height, xoff, yoff); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBitmapSubpixel__JFFFFIJJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint codepoint, jlong widthAddress, jlong heightAddress, jlong xoffAddress, jlong yoffAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *width = (int *)(uintptr_t)widthAddress; - int *height = (int *)(uintptr_t)heightAddress; - int *xoff = (int *)(uintptr_t)xoffAddress; - int *yoff = (int *)(uintptr_t)yoffAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, shift_x, shift_y, codepoint, width, height, xoff, yoff); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1MakeCodepointBitmap(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong outputAddress, jint out_w, jint out_h, jint out_stride, jfloat scale_x, jfloat scale_y, jint codepoint) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - unsigned char *output = (unsigned char *)(uintptr_t)outputAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_MakeCodepointBitmap(info, output, out_w, out_h, out_stride, scale_x, scale_y, codepoint); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1MakeCodepointBitmapSubpixel(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong outputAddress, jint out_w, jint out_h, jint out_stride, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint codepoint) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - unsigned char *output = (unsigned char *)(uintptr_t)outputAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_MakeCodepointBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, codepoint); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1MakeCodepointBitmapSubpixelPrefilter__JJIIIFFFFIIJJI(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong outputAddress, jint out_w, jint out_h, jint out_stride, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint oversample_x, jint oversample_y, jlong sub_xAddress, jlong sub_yAddress, jint codepoint) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - unsigned char *output = (unsigned char *)(uintptr_t)outputAddress; - float *sub_x = (float *)(uintptr_t)sub_xAddress; - float *sub_y = (float *)(uintptr_t)sub_yAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_MakeCodepointBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, codepoint); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBitmapBox__JIFFJJJJ(JNIEnv *__env, jclass clazz, jlong fontAddress, jint codepoint, jfloat scale_x, jfloat scale_y, jlong ix0Address, jlong iy0Address, jlong ix1Address, jlong iy1Address) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - int *ix0 = (int *)(uintptr_t)ix0Address; - int *iy0 = (int *)(uintptr_t)iy0Address; - int *ix1 = (int *)(uintptr_t)ix1Address; - int *iy1 = (int *)(uintptr_t)iy1Address; - UNUSED_PARAMS(__env, clazz) - stbtt_GetCodepointBitmapBox(font, codepoint, scale_x, scale_y, ix0, iy0, ix1, iy1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBitmapBoxSubpixel__JIFFFFJJJJ(JNIEnv *__env, jclass clazz, jlong fontAddress, jint codepoint, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jlong ix0Address, jlong iy0Address, jlong ix1Address, jlong iy1Address) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - int *ix0 = (int *)(uintptr_t)ix0Address; - int *iy0 = (int *)(uintptr_t)iy0Address; - int *ix1 = (int *)(uintptr_t)ix1Address; - int *iy1 = (int *)(uintptr_t)iy1Address; - UNUSED_PARAMS(__env, clazz) - stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y, shift_x, shift_y, ix0, iy0, ix1, iy1); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBitmap__JFFIJJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat scale_x, jfloat scale_y, jint glyph, jlong widthAddress, jlong heightAddress, jlong xoffAddress, jlong yoffAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *width = (int *)(uintptr_t)widthAddress; - int *height = (int *)(uintptr_t)heightAddress; - int *xoff = (int *)(uintptr_t)xoffAddress; - int *yoff = (int *)(uintptr_t)yoffAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbtt_GetGlyphBitmap(info, scale_x, scale_y, glyph, width, height, xoff, yoff); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBitmapSubpixel__JFFFFIJJJJ(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint glyph, jlong widthAddress, jlong heightAddress, jlong xoffAddress, jlong yoffAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - int *width = (int *)(uintptr_t)widthAddress; - int *height = (int *)(uintptr_t)heightAddress; - int *xoff = (int *)(uintptr_t)xoffAddress; - int *yoff = (int *)(uintptr_t)yoffAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, shift_x, shift_y, glyph, width, height, xoff, yoff); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1MakeGlyphBitmap(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong outputAddress, jint out_w, jint out_h, jint out_stride, jfloat scale_x, jfloat scale_y, jint glyph) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - unsigned char *output = (unsigned char *)(uintptr_t)outputAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_MakeGlyphBitmap(info, output, out_w, out_h, out_stride, scale_x, scale_y, glyph); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1MakeGlyphBitmapSubpixel(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong outputAddress, jint out_w, jint out_h, jint out_stride, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint glyph) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - unsigned char *output = (unsigned char *)(uintptr_t)outputAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, glyph); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1MakeGlyphBitmapSubpixelPrefilter__JJIIIFFFFIIJJI(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong outputAddress, jint out_w, jint out_h, jint out_stride, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint oversample_x, jint oversample_y, jlong sub_xAddress, jlong sub_yAddress, jint glyph) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - unsigned char *output = (unsigned char *)(uintptr_t)outputAddress; - float *sub_x = (float *)(uintptr_t)sub_xAddress; - float *sub_y = (float *)(uintptr_t)sub_yAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_MakeGlyphBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, glyph); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBitmapBox__JIFFJJJJ(JNIEnv *__env, jclass clazz, jlong fontAddress, jint glyph, jfloat scale_x, jfloat scale_y, jlong ix0Address, jlong iy0Address, jlong ix1Address, jlong iy1Address) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - int *ix0 = (int *)(uintptr_t)ix0Address; - int *iy0 = (int *)(uintptr_t)iy0Address; - int *ix1 = (int *)(uintptr_t)ix1Address; - int *iy1 = (int *)(uintptr_t)iy1Address; - UNUSED_PARAMS(__env, clazz) - stbtt_GetGlyphBitmapBox(font, glyph, scale_x, scale_y, ix0, iy0, ix1, iy1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBitmapBoxSubpixel__JIFFFFJJJJ(JNIEnv *__env, jclass clazz, jlong fontAddress, jint glyph, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jlong ix0Address, jlong iy0Address, jlong ix1Address, jlong iy1Address) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - int *ix0 = (int *)(uintptr_t)ix0Address; - int *iy0 = (int *)(uintptr_t)iy0Address; - int *ix1 = (int *)(uintptr_t)ix1Address; - int *iy1 = (int *)(uintptr_t)iy1Address; - UNUSED_PARAMS(__env, clazz) - stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y, shift_x, shift_y, ix0, iy0, ix1, iy1); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1Rasterize(JNIEnv *__env, jclass clazz, jlong resultAddress, jfloat flatness_in_pixels, jlong verticesAddress, jint num_verts, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint x_off, jint y_off, jint invert, jlong alloc_contextAddress) { - stbtt__bitmap *result = (stbtt__bitmap *)(uintptr_t)resultAddress; - stbtt_vertex *vertices = (stbtt_vertex *)(uintptr_t)verticesAddress; - void *alloc_context = (void *)(uintptr_t)alloc_contextAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_Rasterize(result, flatness_in_pixels, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, alloc_context); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1FreeSDF(JNIEnv *__env, jclass clazz, jlong bitmapAddress, jlong userdataAddress) { - unsigned char *bitmap = (unsigned char *)(uintptr_t)bitmapAddress; - void *userdata = (void *)(uintptr_t)userdataAddress; - UNUSED_PARAMS(__env, clazz) - stbtt_FreeSDF(bitmap, userdata); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphSDF__JFIIBFJJJJ(JNIEnv *__env, jclass clazz, jlong fontAddress, jfloat scale, jint glyph, jint padding, jbyte onedge_value, jfloat pixel_dist_scale, jlong widthAddress, jlong heightAddress, jlong xoffAddress, jlong yoffAddress) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - int *width = (int *)(uintptr_t)widthAddress; - int *height = (int *)(uintptr_t)heightAddress; - int *xoff = (int *)(uintptr_t)xoffAddress; - int *yoff = (int *)(uintptr_t)yoffAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbtt_GetGlyphSDF(font, scale, glyph, padding, (unsigned char)onedge_value, pixel_dist_scale, width, height, xoff, yoff); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointSDF__JFIIBFJJJJ(JNIEnv *__env, jclass clazz, jlong fontAddress, jfloat scale, jint codepoint, jint padding, jbyte onedge_value, jfloat pixel_dist_scale, jlong widthAddress, jlong heightAddress, jlong xoffAddress, jlong yoffAddress) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - int *width = (int *)(uintptr_t)widthAddress; - int *height = (int *)(uintptr_t)heightAddress; - int *xoff = (int *)(uintptr_t)xoffAddress; - int *yoff = (int *)(uintptr_t)yoffAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbtt_GetCodepointSDF(font, scale, codepoint, padding, (unsigned char)onedge_value, pixel_dist_scale, width, height, xoff, yoff); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1FindMatchingFont(JNIEnv *__env, jclass clazz, jlong fontdataAddress, jlong nameAddress, jint flags) { - unsigned char const *fontdata = (unsigned char const *)(uintptr_t)fontdataAddress; - char const *name = (char const *)(uintptr_t)nameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_FindMatchingFont(fontdata, name, flags); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1CompareUTF8toUTF16_1bigendian(JNIEnv *__env, jclass clazz, jlong s1Address, jint len1, jlong s2Address, jint len2) { - char const *s1 = (char const *)(uintptr_t)s1Address; - char const *s2 = (char const *)(uintptr_t)s2Address; - UNUSED_PARAMS(__env, clazz) - return (jint)stbtt_CompareUTF8toUTF16_bigendian(s1, len1, s2, len2); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetFontNameString(JNIEnv *__env, jclass clazz, jlong fontAddress, jlong lengthAddress, jint platformID, jint encodingID, jint languageID, jint nameID) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - int *length = (int *)(uintptr_t)lengthAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stbtt_GetFontNameString(font, length, platformID, encodingID, languageID, nameID); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetBakedQuad__JIII_3F_3FJI(JNIEnv *__env, jclass clazz, jlong chardataAddress, jint pw, jint ph, jint char_index, jfloatArray xposAddress, jfloatArray yposAddress, jlong qAddress, jint opengl_fillrule) { - stbtt_bakedchar const *chardata = (stbtt_bakedchar const *)(uintptr_t)chardataAddress; - stbtt_aligned_quad *q = (stbtt_aligned_quad *)(uintptr_t)qAddress; - jfloat *xpos = (*__env)->GetFloatArrayElements(__env, xposAddress, NULL); - jfloat *ypos = (*__env)->GetFloatArrayElements(__env, yposAddress, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetBakedQuad(chardata, pw, ph, char_index, (float *)xpos, (float *)ypos, q, opengl_fillrule); - (*__env)->ReleaseFloatArrayElements(__env, yposAddress, ypos, 0); - (*__env)->ReleaseFloatArrayElements(__env, xposAddress, xpos, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetScaledFontVMetrics__JIF_3F_3F_3F(JNIEnv *__env, jclass clazz, jlong fontdataAddress, jint index, jfloat size, jfloatArray ascentAddress, jfloatArray descentAddress, jfloatArray lineGapAddress) { - unsigned char const *fontdata = (unsigned char const *)(uintptr_t)fontdataAddress; - jfloat *ascent = (*__env)->GetFloatArrayElements(__env, ascentAddress, NULL); - jfloat *descent = (*__env)->GetFloatArrayElements(__env, descentAddress, NULL); - jfloat *lineGap = (*__env)->GetFloatArrayElements(__env, lineGapAddress, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetScaledFontVMetrics(fontdata, index, size, (float *)ascent, (float *)descent, (float *)lineGap); - (*__env)->ReleaseFloatArrayElements(__env, lineGapAddress, lineGap, 0); - (*__env)->ReleaseFloatArrayElements(__env, descentAddress, descent, 0); - (*__env)->ReleaseFloatArrayElements(__env, ascentAddress, ascent, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetPackedQuad__JIII_3F_3FJI(JNIEnv *__env, jclass clazz, jlong chardataAddress, jint pw, jint ph, jint char_index, jfloatArray xposAddress, jfloatArray yposAddress, jlong qAddress, jint align_to_integer) { - stbtt_packedchar const *chardata = (stbtt_packedchar const *)(uintptr_t)chardataAddress; - stbtt_aligned_quad *q = (stbtt_aligned_quad *)(uintptr_t)qAddress; - jfloat *xpos = (*__env)->GetFloatArrayElements(__env, xposAddress, NULL); - jfloat *ypos = (*__env)->GetFloatArrayElements(__env, yposAddress, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetPackedQuad(chardata, pw, ph, char_index, (float *)xpos, (float *)ypos, q, align_to_integer); - (*__env)->ReleaseFloatArrayElements(__env, yposAddress, ypos, 0); - (*__env)->ReleaseFloatArrayElements(__env, xposAddress, xpos, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetFontVMetrics__J_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jintArray ascentAddress, jintArray descentAddress, jintArray lineGapAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jint *ascent = ascentAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ascentAddress, NULL); - jint *descent = descentAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, descentAddress, NULL); - jint *lineGap = lineGapAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, lineGapAddress, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetFontVMetrics(info, (int *)ascent, (int *)descent, (int *)lineGap); - if (lineGap != NULL) { (*__env)->ReleaseIntArrayElements(__env, lineGapAddress, lineGap, 0); } - if (descent != NULL) { (*__env)->ReleaseIntArrayElements(__env, descentAddress, descent, 0); } - if (ascent != NULL) { (*__env)->ReleaseIntArrayElements(__env, ascentAddress, ascent, 0); } -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetFontVMetricsOS2__J_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jintArray typoAscentAddress, jintArray typoDescentAddress, jintArray typoLineGapAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jint __result; - jint *typoAscent = typoAscentAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, typoAscentAddress, NULL); - jint *typoDescent = typoDescentAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, typoDescentAddress, NULL); - jint *typoLineGap = typoLineGapAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, typoLineGapAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbtt_GetFontVMetricsOS2(info, (int *)typoAscent, (int *)typoDescent, (int *)typoLineGap); - if (typoLineGap != NULL) { (*__env)->ReleaseIntArrayElements(__env, typoLineGapAddress, typoLineGap, 0); } - if (typoDescent != NULL) { (*__env)->ReleaseIntArrayElements(__env, typoDescentAddress, typoDescent, 0); } - if (typoAscent != NULL) { (*__env)->ReleaseIntArrayElements(__env, typoAscentAddress, typoAscent, 0); } - return __result; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetFontBoundingBox__J_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jintArray x0Address, jintArray y0Address, jintArray x1Address, jintArray y1Address) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jint *x0 = (*__env)->GetIntArrayElements(__env, x0Address, NULL); - jint *y0 = (*__env)->GetIntArrayElements(__env, y0Address, NULL); - jint *x1 = (*__env)->GetIntArrayElements(__env, x1Address, NULL); - jint *y1 = (*__env)->GetIntArrayElements(__env, y1Address, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetFontBoundingBox(info, (int *)x0, (int *)y0, (int *)x1, (int *)y1); - (*__env)->ReleaseIntArrayElements(__env, y1Address, y1, 0); - (*__env)->ReleaseIntArrayElements(__env, x1Address, x1, 0); - (*__env)->ReleaseIntArrayElements(__env, y0Address, y0, 0); - (*__env)->ReleaseIntArrayElements(__env, x0Address, x0, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointHMetrics__JI_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jint codepoint, jintArray advanceWidthAddress, jintArray leftSideBearingAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jint *advanceWidth = advanceWidthAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, advanceWidthAddress, NULL); - jint *leftSideBearing = leftSideBearingAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, leftSideBearingAddress, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetCodepointHMetrics(info, codepoint, (int *)advanceWidth, (int *)leftSideBearing); - if (leftSideBearing != NULL) { (*__env)->ReleaseIntArrayElements(__env, leftSideBearingAddress, leftSideBearing, 0); } - if (advanceWidth != NULL) { (*__env)->ReleaseIntArrayElements(__env, advanceWidthAddress, advanceWidth, 0); } -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBox__JI_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jint codepoint, jintArray x0Address, jintArray y0Address, jintArray x1Address, jintArray y1Address) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jint __result; - jint *x0 = x0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, x0Address, NULL); - jint *y0 = y0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, y0Address, NULL); - jint *x1 = x1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, x1Address, NULL); - jint *y1 = y1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, y1Address, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbtt_GetCodepointBox(info, codepoint, (int *)x0, (int *)y0, (int *)x1, (int *)y1); - if (y1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, y1Address, y1, 0); } - if (x1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, x1Address, x1, 0); } - if (y0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, y0Address, y0, 0); } - if (x0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, x0Address, x0, 0); } - return __result; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphHMetrics__JI_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jint glyph_index, jintArray advanceWidthAddress, jintArray leftSideBearingAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jint *advanceWidth = advanceWidthAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, advanceWidthAddress, NULL); - jint *leftSideBearing = leftSideBearingAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, leftSideBearingAddress, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetGlyphHMetrics(info, glyph_index, (int *)advanceWidth, (int *)leftSideBearing); - if (leftSideBearing != NULL) { (*__env)->ReleaseIntArrayElements(__env, leftSideBearingAddress, leftSideBearing, 0); } - if (advanceWidth != NULL) { (*__env)->ReleaseIntArrayElements(__env, advanceWidthAddress, advanceWidth, 0); } -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBox__JI_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jint glyph_index, jintArray x0Address, jintArray y0Address, jintArray x1Address, jintArray y1Address) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jint __result; - jint *x0 = x0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, x0Address, NULL); - jint *y0 = y0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, y0Address, NULL); - jint *x1 = x1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, x1Address, NULL); - jint *y1 = y1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, y1Address, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stbtt_GetGlyphBox(info, glyph_index, (int *)x0, (int *)y0, (int *)x1, (int *)y1); - if (y1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, y1Address, y1, 0); } - if (x1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, x1Address, x1, 0); } - if (y0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, y0Address, y0, 0); } - if (x0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, x0Address, x0, 0); } - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBitmap__JFFI_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat scale_x, jfloat scale_y, jint codepoint, jintArray widthAddress, jintArray heightAddress, jintArray xoffAddress, jintArray yoffAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jlong __result; - jint *width = (*__env)->GetIntArrayElements(__env, widthAddress, NULL); - jint *height = (*__env)->GetIntArrayElements(__env, heightAddress, NULL); - jint *xoff = xoffAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, xoffAddress, NULL); - jint *yoff = yoffAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, yoffAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbtt_GetCodepointBitmap(info, scale_x, scale_y, codepoint, (int *)width, (int *)height, (int *)xoff, (int *)yoff); - if (yoff != NULL) { (*__env)->ReleaseIntArrayElements(__env, yoffAddress, yoff, 0); } - if (xoff != NULL) { (*__env)->ReleaseIntArrayElements(__env, xoffAddress, xoff, 0); } - (*__env)->ReleaseIntArrayElements(__env, heightAddress, height, 0); - (*__env)->ReleaseIntArrayElements(__env, widthAddress, width, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBitmapSubpixel__JFFFFI_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint codepoint, jintArray widthAddress, jintArray heightAddress, jintArray xoffAddress, jintArray yoffAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jlong __result; - jint *width = (*__env)->GetIntArrayElements(__env, widthAddress, NULL); - jint *height = (*__env)->GetIntArrayElements(__env, heightAddress, NULL); - jint *xoff = xoffAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, xoffAddress, NULL); - jint *yoff = yoffAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, yoffAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, shift_x, shift_y, codepoint, (int *)width, (int *)height, (int *)xoff, (int *)yoff); - if (yoff != NULL) { (*__env)->ReleaseIntArrayElements(__env, yoffAddress, yoff, 0); } - if (xoff != NULL) { (*__env)->ReleaseIntArrayElements(__env, xoffAddress, xoff, 0); } - (*__env)->ReleaseIntArrayElements(__env, heightAddress, height, 0); - (*__env)->ReleaseIntArrayElements(__env, widthAddress, width, 0); - return __result; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1MakeCodepointBitmapSubpixelPrefilter__JJIIIFFFFII_3F_3FI(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong outputAddress, jint out_w, jint out_h, jint out_stride, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint oversample_x, jint oversample_y, jfloatArray sub_xAddress, jfloatArray sub_yAddress, jint codepoint) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - unsigned char *output = (unsigned char *)(uintptr_t)outputAddress; - jfloat *sub_x = (*__env)->GetFloatArrayElements(__env, sub_xAddress, NULL); - jfloat *sub_y = (*__env)->GetFloatArrayElements(__env, sub_yAddress, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_MakeCodepointBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, (float *)sub_x, (float *)sub_y, codepoint); - (*__env)->ReleaseFloatArrayElements(__env, sub_yAddress, sub_y, 0); - (*__env)->ReleaseFloatArrayElements(__env, sub_xAddress, sub_x, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBitmapBox__JIFF_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong fontAddress, jint codepoint, jfloat scale_x, jfloat scale_y, jintArray ix0Address, jintArray iy0Address, jintArray ix1Address, jintArray iy1Address) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - jint *ix0 = ix0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ix0Address, NULL); - jint *iy0 = iy0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, iy0Address, NULL); - jint *ix1 = ix1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ix1Address, NULL); - jint *iy1 = iy1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, iy1Address, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetCodepointBitmapBox(font, codepoint, scale_x, scale_y, (int *)ix0, (int *)iy0, (int *)ix1, (int *)iy1); - if (iy1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, iy1Address, iy1, 0); } - if (ix1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, ix1Address, ix1, 0); } - if (iy0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, iy0Address, iy0, 0); } - if (ix0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, ix0Address, ix0, 0); } -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointBitmapBoxSubpixel__JIFFFF_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong fontAddress, jint codepoint, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jintArray ix0Address, jintArray iy0Address, jintArray ix1Address, jintArray iy1Address) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - jint *ix0 = ix0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ix0Address, NULL); - jint *iy0 = iy0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, iy0Address, NULL); - jint *ix1 = ix1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ix1Address, NULL); - jint *iy1 = iy1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, iy1Address, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y, shift_x, shift_y, (int *)ix0, (int *)iy0, (int *)ix1, (int *)iy1); - if (iy1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, iy1Address, iy1, 0); } - if (ix1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, ix1Address, ix1, 0); } - if (iy0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, iy0Address, iy0, 0); } - if (ix0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, ix0Address, ix0, 0); } -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBitmap__JFFI_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat scale_x, jfloat scale_y, jint glyph, jintArray widthAddress, jintArray heightAddress, jintArray xoffAddress, jintArray yoffAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jlong __result; - jint *width = (*__env)->GetIntArrayElements(__env, widthAddress, NULL); - jint *height = (*__env)->GetIntArrayElements(__env, heightAddress, NULL); - jint *xoff = xoffAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, xoffAddress, NULL); - jint *yoff = yoffAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, yoffAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbtt_GetGlyphBitmap(info, scale_x, scale_y, glyph, (int *)width, (int *)height, (int *)xoff, (int *)yoff); - if (yoff != NULL) { (*__env)->ReleaseIntArrayElements(__env, yoffAddress, yoff, 0); } - if (xoff != NULL) { (*__env)->ReleaseIntArrayElements(__env, xoffAddress, xoff, 0); } - (*__env)->ReleaseIntArrayElements(__env, heightAddress, height, 0); - (*__env)->ReleaseIntArrayElements(__env, widthAddress, width, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBitmapSubpixel__JFFFFI_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong infoAddress, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint glyph, jintArray widthAddress, jintArray heightAddress, jintArray xoffAddress, jintArray yoffAddress) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - jlong __result; - jint *width = (*__env)->GetIntArrayElements(__env, widthAddress, NULL); - jint *height = (*__env)->GetIntArrayElements(__env, heightAddress, NULL); - jint *xoff = xoffAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, xoffAddress, NULL); - jint *yoff = yoffAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, yoffAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, shift_x, shift_y, glyph, (int *)width, (int *)height, (int *)xoff, (int *)yoff); - if (yoff != NULL) { (*__env)->ReleaseIntArrayElements(__env, yoffAddress, yoff, 0); } - if (xoff != NULL) { (*__env)->ReleaseIntArrayElements(__env, xoffAddress, xoff, 0); } - (*__env)->ReleaseIntArrayElements(__env, heightAddress, height, 0); - (*__env)->ReleaseIntArrayElements(__env, widthAddress, width, 0); - return __result; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1MakeGlyphBitmapSubpixelPrefilter__JJIIIFFFFII_3F_3FI(JNIEnv *__env, jclass clazz, jlong infoAddress, jlong outputAddress, jint out_w, jint out_h, jint out_stride, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jint oversample_x, jint oversample_y, jfloatArray sub_xAddress, jfloatArray sub_yAddress, jint glyph) { - stbtt_fontinfo const *info = (stbtt_fontinfo const *)(uintptr_t)infoAddress; - unsigned char *output = (unsigned char *)(uintptr_t)outputAddress; - jfloat *sub_x = (*__env)->GetFloatArrayElements(__env, sub_xAddress, NULL); - jfloat *sub_y = (*__env)->GetFloatArrayElements(__env, sub_yAddress, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_MakeGlyphBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, (float *)sub_x, (float *)sub_y, glyph); - (*__env)->ReleaseFloatArrayElements(__env, sub_yAddress, sub_y, 0); - (*__env)->ReleaseFloatArrayElements(__env, sub_xAddress, sub_x, 0); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBitmapBox__JIFF_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong fontAddress, jint glyph, jfloat scale_x, jfloat scale_y, jintArray ix0Address, jintArray iy0Address, jintArray ix1Address, jintArray iy1Address) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - jint *ix0 = ix0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ix0Address, NULL); - jint *iy0 = iy0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, iy0Address, NULL); - jint *ix1 = ix1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ix1Address, NULL); - jint *iy1 = iy1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, iy1Address, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetGlyphBitmapBox(font, glyph, scale_x, scale_y, (int *)ix0, (int *)iy0, (int *)ix1, (int *)iy1); - if (iy1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, iy1Address, iy1, 0); } - if (ix1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, ix1Address, ix1, 0); } - if (iy0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, iy0Address, iy0, 0); } - if (ix0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, ix0Address, ix0, 0); } -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphBitmapBoxSubpixel__JIFFFF_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong fontAddress, jint glyph, jfloat scale_x, jfloat scale_y, jfloat shift_x, jfloat shift_y, jintArray ix0Address, jintArray iy0Address, jintArray ix1Address, jintArray iy1Address) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - jint *ix0 = ix0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ix0Address, NULL); - jint *iy0 = iy0Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, iy0Address, NULL); - jint *ix1 = ix1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, ix1Address, NULL); - jint *iy1 = iy1Address == NULL ? NULL : (*__env)->GetIntArrayElements(__env, iy1Address, NULL); - UNUSED_PARAMS(__env, clazz) - stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y, shift_x, shift_y, (int *)ix0, (int *)iy0, (int *)ix1, (int *)iy1); - if (iy1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, iy1Address, iy1, 0); } - if (ix1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, ix1Address, ix1, 0); } - if (iy0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, iy0Address, iy0, 0); } - if (ix0 != NULL) { (*__env)->ReleaseIntArrayElements(__env, ix0Address, ix0, 0); } -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetGlyphSDF__JFIIBF_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong fontAddress, jfloat scale, jint glyph, jint padding, jbyte onedge_value, jfloat pixel_dist_scale, jintArray widthAddress, jintArray heightAddress, jintArray xoffAddress, jintArray yoffAddress) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - jlong __result; - jint *width = (*__env)->GetIntArrayElements(__env, widthAddress, NULL); - jint *height = (*__env)->GetIntArrayElements(__env, heightAddress, NULL); - jint *xoff = (*__env)->GetIntArrayElements(__env, xoffAddress, NULL); - jint *yoff = (*__env)->GetIntArrayElements(__env, yoffAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbtt_GetGlyphSDF(font, scale, glyph, padding, (unsigned char)onedge_value, pixel_dist_scale, (int *)width, (int *)height, (int *)xoff, (int *)yoff); - (*__env)->ReleaseIntArrayElements(__env, yoffAddress, yoff, 0); - (*__env)->ReleaseIntArrayElements(__env, xoffAddress, xoff, 0); - (*__env)->ReleaseIntArrayElements(__env, heightAddress, height, 0); - (*__env)->ReleaseIntArrayElements(__env, widthAddress, width, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBTruetype_nstbtt_1GetCodepointSDF__JFIIBF_3I_3I_3I_3I(JNIEnv *__env, jclass clazz, jlong fontAddress, jfloat scale, jint codepoint, jint padding, jbyte onedge_value, jfloat pixel_dist_scale, jintArray widthAddress, jintArray heightAddress, jintArray xoffAddress, jintArray yoffAddress) { - stbtt_fontinfo const *font = (stbtt_fontinfo const *)(uintptr_t)fontAddress; - jlong __result; - jint *width = (*__env)->GetIntArrayElements(__env, widthAddress, NULL); - jint *height = (*__env)->GetIntArrayElements(__env, heightAddress, NULL); - jint *xoff = (*__env)->GetIntArrayElements(__env, xoffAddress, NULL); - jint *yoff = (*__env)->GetIntArrayElements(__env, yoffAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stbtt_GetCodepointSDF(font, scale, codepoint, padding, (unsigned char)onedge_value, pixel_dist_scale, (int *)width, (int *)height, (int *)xoff, (int *)yoff); - (*__env)->ReleaseIntArrayElements(__env, yoffAddress, yoff, 0); - (*__env)->ReleaseIntArrayElements(__env, xoffAddress, xoff, 0); - (*__env)->ReleaseIntArrayElements(__env, heightAddress, height, 0); - (*__env)->ReleaseIntArrayElements(__env, widthAddress, width, 0); - return __result; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBVorbis.c b/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBVorbis.c deleted file mode 100644 index 1a558454..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/org_lwjgl_stb_STBVorbis.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -DISABLE_WARNINGS() -#ifdef LWJGL_LINUX - #include -#endif -#include "stb_vorbis.c" -ENABLE_WARNINGS() - -EXTERN_C_ENTER - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1info(JNIEnv *__env, jclass clazz, jlong fAddress, jlong __result) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - *((stb_vorbis_info*)(uintptr_t)__result) = stb_vorbis_get_info(f); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1comment(JNIEnv *__env, jclass clazz, jlong fAddress, jlong __result) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - *((stb_vorbis_comment*)(uintptr_t)__result) = stb_vorbis_get_comment(f); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1error(JNIEnv *__env, jclass clazz, jlong fAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_error(f); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1close(JNIEnv *__env, jclass clazz, jlong fAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - stb_vorbis_close(f); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1sample_1offset(JNIEnv *__env, jclass clazz, jlong fAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_sample_offset(f); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1file_1offset(JNIEnv *__env, jclass clazz, jlong fAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_file_offset(f); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1open_1pushdata__JIJJJ(JNIEnv *__env, jclass clazz, jlong datablockAddress, jint datablock_length_in_bytes, jlong datablock_memory_consumed_in_bytesAddress, jlong errorAddress, jlong alloc_bufferAddress) { - unsigned char const *datablock = (unsigned char const *)(uintptr_t)datablockAddress; - int *datablock_memory_consumed_in_bytes = (int *)(uintptr_t)datablock_memory_consumed_in_bytesAddress; - int *error = (int *)(uintptr_t)errorAddress; - stb_vorbis_alloc const *alloc_buffer = (stb_vorbis_alloc const *)(uintptr_t)alloc_bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stb_vorbis_open_pushdata(datablock, datablock_length_in_bytes, datablock_memory_consumed_in_bytes, error, alloc_buffer); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1decode_1frame_1pushdata__JJIJJJ(JNIEnv *__env, jclass clazz, jlong fAddress, jlong datablockAddress, jint datablock_length_in_bytes, jlong channelsAddress, jlong outputAddress, jlong samplesAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - unsigned char const *datablock = (unsigned char const *)(uintptr_t)datablockAddress; - int *channels = (int *)(uintptr_t)channelsAddress; - float ***output = (float ***)(uintptr_t)outputAddress; - int *samples = (int *)(uintptr_t)samplesAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_decode_frame_pushdata(f, datablock, datablock_length_in_bytes, channels, output, samples); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1flush_1pushdata(JNIEnv *__env, jclass clazz, jlong fAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - stb_vorbis_flush_pushdata(f); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1decode_1filename__JJJJ(JNIEnv *__env, jclass clazz, jlong filenameAddress, jlong channelsAddress, jlong sample_rateAddress, jlong outputAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - int *channels = (int *)(uintptr_t)channelsAddress; - int *sample_rate = (int *)(uintptr_t)sample_rateAddress; - short **output = (short **)(uintptr_t)outputAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_decode_filename(filename, channels, sample_rate, output); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1decode_1memory__JIJJJ(JNIEnv *__env, jclass clazz, jlong memAddress, jint len, jlong channelsAddress, jlong sample_rateAddress, jlong outputAddress) { - unsigned char const *mem = (unsigned char const *)(uintptr_t)memAddress; - int *channels = (int *)(uintptr_t)channelsAddress; - int *sample_rate = (int *)(uintptr_t)sample_rateAddress; - short **output = (short **)(uintptr_t)outputAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_decode_memory(mem, len, channels, sample_rate, output); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1open_1memory__JIJJ(JNIEnv *__env, jclass clazz, jlong memAddress, jint len, jlong errorAddress, jlong alloc_bufferAddress) { - unsigned char const *mem = (unsigned char const *)(uintptr_t)memAddress; - int *error = (int *)(uintptr_t)errorAddress; - stb_vorbis_alloc const *alloc_buffer = (stb_vorbis_alloc const *)(uintptr_t)alloc_bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stb_vorbis_open_memory(mem, len, error, alloc_buffer); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1open_1filename__JJJ(JNIEnv *__env, jclass clazz, jlong filenameAddress, jlong errorAddress, jlong alloc_bufferAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - int *error = (int *)(uintptr_t)errorAddress; - stb_vorbis_alloc const *alloc_buffer = (stb_vorbis_alloc const *)(uintptr_t)alloc_bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)stb_vorbis_open_filename(filename, error, alloc_buffer); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1seek_1frame(JNIEnv *__env, jclass clazz, jlong fAddress, jint sample_number) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_seek_frame(f, (unsigned int)sample_number); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1seek(JNIEnv *__env, jclass clazz, jlong fAddress, jint sample_number) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_seek(f, (unsigned int)sample_number); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1seek_1start(JNIEnv *__env, jclass clazz, jlong fAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_seek_start(f); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1stream_1length_1in_1samples(JNIEnv *__env, jclass clazz, jlong fAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_stream_length_in_samples(f); -} - -JNIEXPORT jfloat JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1stream_1length_1in_1seconds(JNIEnv *__env, jclass clazz, jlong fAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - UNUSED_PARAMS(__env, clazz) - return (jfloat)stb_vorbis_stream_length_in_seconds(f); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1frame_1float__JJJ(JNIEnv *__env, jclass clazz, jlong fAddress, jlong channelsAddress, jlong outputAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - int *channels = (int *)(uintptr_t)channelsAddress; - float ***output = (float ***)(uintptr_t)outputAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_frame_float(f, channels, output); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1frame_1short(JNIEnv *__env, jclass clazz, jlong fAddress, jint num_c, jlong bufferAddress, jint num_samples) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - short **buffer = (short **)(uintptr_t)bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_frame_short(f, num_c, buffer, num_samples); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1frame_1short_1interleaved__JIJI(JNIEnv *__env, jclass clazz, jlong fAddress, jint num_c, jlong bufferAddress, jint num_shorts) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - short *buffer = (short *)(uintptr_t)bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_frame_short_interleaved(f, num_c, buffer, num_shorts); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1samples_1float(JNIEnv *__env, jclass clazz, jlong fAddress, jint channels, jlong bufferAddress, jint num_samples) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - float **buffer = (float **)(uintptr_t)bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_samples_float(f, channels, buffer, num_samples); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1samples_1float_1interleaved__JIJI(JNIEnv *__env, jclass clazz, jlong fAddress, jint channels, jlong bufferAddress, jint num_floats) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - float *buffer = (float *)(uintptr_t)bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_samples_float_interleaved(f, channels, buffer, num_floats); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1samples_1short(JNIEnv *__env, jclass clazz, jlong fAddress, jint channels, jlong bufferAddress, jint num_samples) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - short **buffer = (short **)(uintptr_t)bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_samples_short(f, channels, buffer, num_samples); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1samples_1short_1interleaved__JIJI(JNIEnv *__env, jclass clazz, jlong fAddress, jint channels, jlong bufferAddress, jint num_shorts) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - short *buffer = (short *)(uintptr_t)bufferAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)stb_vorbis_get_samples_short_interleaved(f, channels, buffer, num_shorts); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1open_1pushdata__JI_3I_3IJ(JNIEnv *__env, jclass clazz, jlong datablockAddress, jint datablock_length_in_bytes, jintArray datablock_memory_consumed_in_bytesAddress, jintArray errorAddress, jlong alloc_bufferAddress) { - unsigned char const *datablock = (unsigned char const *)(uintptr_t)datablockAddress; - stb_vorbis_alloc const *alloc_buffer = (stb_vorbis_alloc const *)(uintptr_t)alloc_bufferAddress; - jlong __result; - jint *datablock_memory_consumed_in_bytes = (*__env)->GetIntArrayElements(__env, datablock_memory_consumed_in_bytesAddress, NULL); - jint *error = (*__env)->GetIntArrayElements(__env, errorAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stb_vorbis_open_pushdata(datablock, datablock_length_in_bytes, (int *)datablock_memory_consumed_in_bytes, (int *)error, alloc_buffer); - (*__env)->ReleaseIntArrayElements(__env, errorAddress, error, 0); - (*__env)->ReleaseIntArrayElements(__env, datablock_memory_consumed_in_bytesAddress, datablock_memory_consumed_in_bytes, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1decode_1frame_1pushdata__JJI_3IJ_3I(JNIEnv *__env, jclass clazz, jlong fAddress, jlong datablockAddress, jint datablock_length_in_bytes, jintArray channelsAddress, jlong outputAddress, jintArray samplesAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - unsigned char const *datablock = (unsigned char const *)(uintptr_t)datablockAddress; - float ***output = (float ***)(uintptr_t)outputAddress; - jint __result; - jint *channels = channelsAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, channelsAddress, NULL); - jint *samples = (*__env)->GetIntArrayElements(__env, samplesAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stb_vorbis_decode_frame_pushdata(f, datablock, datablock_length_in_bytes, (int *)channels, output, (int *)samples); - (*__env)->ReleaseIntArrayElements(__env, samplesAddress, samples, 0); - if (channels != NULL) { (*__env)->ReleaseIntArrayElements(__env, channelsAddress, channels, 0); } - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1decode_1filename__J_3I_3IJ(JNIEnv *__env, jclass clazz, jlong filenameAddress, jintArray channelsAddress, jintArray sample_rateAddress, jlong outputAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - short **output = (short **)(uintptr_t)outputAddress; - jint __result; - jint *channels = (*__env)->GetIntArrayElements(__env, channelsAddress, NULL); - jint *sample_rate = (*__env)->GetIntArrayElements(__env, sample_rateAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stb_vorbis_decode_filename(filename, (int *)channels, (int *)sample_rate, output); - (*__env)->ReleaseIntArrayElements(__env, sample_rateAddress, sample_rate, 0); - (*__env)->ReleaseIntArrayElements(__env, channelsAddress, channels, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1decode_1memory__JI_3I_3IJ(JNIEnv *__env, jclass clazz, jlong memAddress, jint len, jintArray channelsAddress, jintArray sample_rateAddress, jlong outputAddress) { - unsigned char const *mem = (unsigned char const *)(uintptr_t)memAddress; - short **output = (short **)(uintptr_t)outputAddress; - jint __result; - jint *channels = (*__env)->GetIntArrayElements(__env, channelsAddress, NULL); - jint *sample_rate = (*__env)->GetIntArrayElements(__env, sample_rateAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stb_vorbis_decode_memory(mem, len, (int *)channels, (int *)sample_rate, output); - (*__env)->ReleaseIntArrayElements(__env, sample_rateAddress, sample_rate, 0); - (*__env)->ReleaseIntArrayElements(__env, channelsAddress, channels, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1open_1memory__JI_3IJ(JNIEnv *__env, jclass clazz, jlong memAddress, jint len, jintArray errorAddress, jlong alloc_bufferAddress) { - unsigned char const *mem = (unsigned char const *)(uintptr_t)memAddress; - stb_vorbis_alloc const *alloc_buffer = (stb_vorbis_alloc const *)(uintptr_t)alloc_bufferAddress; - jlong __result; - jint *error = (*__env)->GetIntArrayElements(__env, errorAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stb_vorbis_open_memory(mem, len, (int *)error, alloc_buffer); - (*__env)->ReleaseIntArrayElements(__env, errorAddress, error, 0); - return __result; -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1open_1filename__J_3IJ(JNIEnv *__env, jclass clazz, jlong filenameAddress, jintArray errorAddress, jlong alloc_bufferAddress) { - char const *filename = (char const *)(uintptr_t)filenameAddress; - stb_vorbis_alloc const *alloc_buffer = (stb_vorbis_alloc const *)(uintptr_t)alloc_bufferAddress; - jlong __result; - jint *error = (*__env)->GetIntArrayElements(__env, errorAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jlong)(uintptr_t)stb_vorbis_open_filename(filename, (int *)error, alloc_buffer); - (*__env)->ReleaseIntArrayElements(__env, errorAddress, error, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1frame_1float__J_3IJ(JNIEnv *__env, jclass clazz, jlong fAddress, jintArray channelsAddress, jlong outputAddress) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - float ***output = (float ***)(uintptr_t)outputAddress; - jint __result; - jint *channels = channelsAddress == NULL ? NULL : (*__env)->GetIntArrayElements(__env, channelsAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stb_vorbis_get_frame_float(f, (int *)channels, output); - if (channels != NULL) { (*__env)->ReleaseIntArrayElements(__env, channelsAddress, channels, 0); } - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1frame_1short_1interleaved__JI_3SI(JNIEnv *__env, jclass clazz, jlong fAddress, jint num_c, jshortArray bufferAddress, jint num_shorts) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - jint __result; - jshort *buffer = (*__env)->GetShortArrayElements(__env, bufferAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stb_vorbis_get_frame_short_interleaved(f, num_c, (short *)buffer, num_shorts); - (*__env)->ReleaseShortArrayElements(__env, bufferAddress, buffer, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1samples_1float_1interleaved__JI_3FI(JNIEnv *__env, jclass clazz, jlong fAddress, jint channels, jfloatArray bufferAddress, jint num_floats) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - jint __result; - jfloat *buffer = (*__env)->GetFloatArrayElements(__env, bufferAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stb_vorbis_get_samples_float_interleaved(f, channels, (float *)buffer, num_floats); - (*__env)->ReleaseFloatArrayElements(__env, bufferAddress, buffer, 0); - return __result; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_stb_STBVorbis_nstb_1vorbis_1get_1samples_1short_1interleaved__JI_3SI(JNIEnv *__env, jclass clazz, jlong fAddress, jint channels, jshortArray bufferAddress, jint num_shorts) { - stb_vorbis *f = (stb_vorbis *)(uintptr_t)fAddress; - jint __result; - jshort *buffer = (*__env)->GetShortArrayElements(__env, bufferAddress, NULL); - UNUSED_PARAMS(__env, clazz) - __result = (jint)stb_vorbis_get_samples_short_interleaved(f, channels, (short *)buffer, num_shorts); - (*__env)->ReleaseShortArrayElements(__env, bufferAddress, buffer, 0); - return __result; -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_dxt.h b/FCLauncher/src/main/jni/lwjgl/stb/stb_dxt.h deleted file mode 100644 index 6150a87f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_dxt.h +++ /dev/null @@ -1,719 +0,0 @@ -// stb_dxt.h - v1.12 - DXT1/DXT5 compressor - public domain -// original by fabian "ryg" giesen - ported to C by stb -// use '#define STB_DXT_IMPLEMENTATION' before including to create the implementation -// -// USAGE: -// call stb_compress_dxt_block() for every block (you must pad) -// source should be a 4x4 block of RGBA data in row-major order; -// Alpha channel is not stored if you specify alpha=0 (but you -// must supply some constant alpha in the alpha channel). -// You can turn on dithering and "high quality" using mode. -// -// version history: -// v1.12 - (ryg) fix bug in single-color table generator -// v1.11 - (ryg) avoid racy global init, better single-color tables, remove dither -// v1.10 - (i.c) various small quality improvements -// v1.09 - (stb) update documentation re: surprising alpha channel requirement -// v1.08 - (stb) fix bug in dxt-with-alpha block -// v1.07 - (stb) bc4; allow not using libc; add STB_DXT_STATIC -// v1.06 - (stb) fix to known-broken 1.05 -// v1.05 - (stb) support bc5/3dc (Arvids Kokins), use extern "C" in C++ (Pavel Krajcevski) -// v1.04 - (ryg) default to no rounding bias for lerped colors (as per S3TC/DX10 spec); -// single color match fix (allow for inexact color interpolation); -// optimal DXT5 index finder; "high quality" mode that runs multiple refinement steps. -// v1.03 - (stb) endianness support -// v1.02 - (stb) fix alpha encoding bug -// v1.01 - (stb) fix bug converting to RGB that messed up quality, thanks ryg & cbloom -// v1.00 - (stb) first release -// -// contributors: -// Rich Geldreich (more accurate index selection) -// Kevin Schmidt (#defines for "freestanding" compilation) -// github:ppiastucki (BC4 support) -// Ignacio Castano - improve DXT endpoint quantization -// Alan Hickman - static table initialization -// -// LICENSE -// -// See end of file for license information. - -#ifndef STB_INCLUDE_STB_DXT_H -#define STB_INCLUDE_STB_DXT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef STB_DXT_STATIC -#define STBDDEF static -#else -#define STBDDEF extern -#endif - -// compression mode (bitflags) -#define STB_DXT_NORMAL 0 -#define STB_DXT_DITHER 1 // use dithering. was always dubious, now deprecated. does nothing! -#define STB_DXT_HIGHQUAL 2 // high quality mode, does two refinement steps instead of 1. ~30-40% slower. - -STBDDEF void stb_compress_dxt_block(unsigned char *dest, const unsigned char *src_rgba_four_bytes_per_pixel, int alpha, int mode); -STBDDEF void stb_compress_bc4_block(unsigned char *dest, const unsigned char *src_r_one_byte_per_pixel); -STBDDEF void stb_compress_bc5_block(unsigned char *dest, const unsigned char *src_rg_two_byte_per_pixel); - -#define STB_COMPRESS_DXT_BLOCK - -#ifdef __cplusplus -} -#endif -#endif // STB_INCLUDE_STB_DXT_H - -#ifdef STB_DXT_IMPLEMENTATION - -// configuration options for DXT encoder. set them in the project/makefile or just define -// them at the top. - -// STB_DXT_USE_ROUNDING_BIAS -// use a rounding bias during color interpolation. this is closer to what "ideal" -// interpolation would do but doesn't match the S3TC/DX10 spec. old versions (pre-1.03) -// implicitly had this turned on. -// -// in case you're targeting a specific type of hardware (e.g. console programmers): -// NVidia and Intel GPUs (as of 2010) as well as DX9 ref use DXT decoders that are closer -// to STB_DXT_USE_ROUNDING_BIAS. AMD/ATI, S3 and DX10 ref are closer to rounding with no bias. -// you also see "(a*5 + b*3) / 8" on some old GPU designs. -// #define STB_DXT_USE_ROUNDING_BIAS - -#include - -#if !defined(STBD_FABS) -#include -#endif - -#ifndef STBD_FABS -#define STBD_FABS(x) fabs(x) -#endif - -static const unsigned char stb__OMatch5[256][2] = { - { 0, 0 }, { 0, 0 }, { 0, 1 }, { 0, 1 }, { 1, 0 }, { 1, 0 }, { 1, 0 }, { 1, 1 }, - { 1, 1 }, { 1, 1 }, { 1, 2 }, { 0, 4 }, { 2, 1 }, { 2, 1 }, { 2, 1 }, { 2, 2 }, - { 2, 2 }, { 2, 2 }, { 2, 3 }, { 1, 5 }, { 3, 2 }, { 3, 2 }, { 4, 0 }, { 3, 3 }, - { 3, 3 }, { 3, 3 }, { 3, 4 }, { 3, 4 }, { 3, 4 }, { 3, 5 }, { 4, 3 }, { 4, 3 }, - { 5, 2 }, { 4, 4 }, { 4, 4 }, { 4, 5 }, { 4, 5 }, { 5, 4 }, { 5, 4 }, { 5, 4 }, - { 6, 3 }, { 5, 5 }, { 5, 5 }, { 5, 6 }, { 4, 8 }, { 6, 5 }, { 6, 5 }, { 6, 5 }, - { 6, 6 }, { 6, 6 }, { 6, 6 }, { 6, 7 }, { 5, 9 }, { 7, 6 }, { 7, 6 }, { 8, 4 }, - { 7, 7 }, { 7, 7 }, { 7, 7 }, { 7, 8 }, { 7, 8 }, { 7, 8 }, { 7, 9 }, { 8, 7 }, - { 8, 7 }, { 9, 6 }, { 8, 8 }, { 8, 8 }, { 8, 9 }, { 8, 9 }, { 9, 8 }, { 9, 8 }, - { 9, 8 }, { 10, 7 }, { 9, 9 }, { 9, 9 }, { 9, 10 }, { 8, 12 }, { 10, 9 }, { 10, 9 }, - { 10, 9 }, { 10, 10 }, { 10, 10 }, { 10, 10 }, { 10, 11 }, { 9, 13 }, { 11, 10 }, { 11, 10 }, - { 12, 8 }, { 11, 11 }, { 11, 11 }, { 11, 11 }, { 11, 12 }, { 11, 12 }, { 11, 12 }, { 11, 13 }, - { 12, 11 }, { 12, 11 }, { 13, 10 }, { 12, 12 }, { 12, 12 }, { 12, 13 }, { 12, 13 }, { 13, 12 }, - { 13, 12 }, { 13, 12 }, { 14, 11 }, { 13, 13 }, { 13, 13 }, { 13, 14 }, { 12, 16 }, { 14, 13 }, - { 14, 13 }, { 14, 13 }, { 14, 14 }, { 14, 14 }, { 14, 14 }, { 14, 15 }, { 13, 17 }, { 15, 14 }, - { 15, 14 }, { 16, 12 }, { 15, 15 }, { 15, 15 }, { 15, 15 }, { 15, 16 }, { 15, 16 }, { 15, 16 }, - { 15, 17 }, { 16, 15 }, { 16, 15 }, { 17, 14 }, { 16, 16 }, { 16, 16 }, { 16, 17 }, { 16, 17 }, - { 17, 16 }, { 17, 16 }, { 17, 16 }, { 18, 15 }, { 17, 17 }, { 17, 17 }, { 17, 18 }, { 16, 20 }, - { 18, 17 }, { 18, 17 }, { 18, 17 }, { 18, 18 }, { 18, 18 }, { 18, 18 }, { 18, 19 }, { 17, 21 }, - { 19, 18 }, { 19, 18 }, { 20, 16 }, { 19, 19 }, { 19, 19 }, { 19, 19 }, { 19, 20 }, { 19, 20 }, - { 19, 20 }, { 19, 21 }, { 20, 19 }, { 20, 19 }, { 21, 18 }, { 20, 20 }, { 20, 20 }, { 20, 21 }, - { 20, 21 }, { 21, 20 }, { 21, 20 }, { 21, 20 }, { 22, 19 }, { 21, 21 }, { 21, 21 }, { 21, 22 }, - { 20, 24 }, { 22, 21 }, { 22, 21 }, { 22, 21 }, { 22, 22 }, { 22, 22 }, { 22, 22 }, { 22, 23 }, - { 21, 25 }, { 23, 22 }, { 23, 22 }, { 24, 20 }, { 23, 23 }, { 23, 23 }, { 23, 23 }, { 23, 24 }, - { 23, 24 }, { 23, 24 }, { 23, 25 }, { 24, 23 }, { 24, 23 }, { 25, 22 }, { 24, 24 }, { 24, 24 }, - { 24, 25 }, { 24, 25 }, { 25, 24 }, { 25, 24 }, { 25, 24 }, { 26, 23 }, { 25, 25 }, { 25, 25 }, - { 25, 26 }, { 24, 28 }, { 26, 25 }, { 26, 25 }, { 26, 25 }, { 26, 26 }, { 26, 26 }, { 26, 26 }, - { 26, 27 }, { 25, 29 }, { 27, 26 }, { 27, 26 }, { 28, 24 }, { 27, 27 }, { 27, 27 }, { 27, 27 }, - { 27, 28 }, { 27, 28 }, { 27, 28 }, { 27, 29 }, { 28, 27 }, { 28, 27 }, { 29, 26 }, { 28, 28 }, - { 28, 28 }, { 28, 29 }, { 28, 29 }, { 29, 28 }, { 29, 28 }, { 29, 28 }, { 30, 27 }, { 29, 29 }, - { 29, 29 }, { 29, 30 }, { 29, 30 }, { 30, 29 }, { 30, 29 }, { 30, 29 }, { 30, 30 }, { 30, 30 }, - { 30, 30 }, { 30, 31 }, { 30, 31 }, { 31, 30 }, { 31, 30 }, { 31, 30 }, { 31, 31 }, { 31, 31 }, -}; -static const unsigned char stb__OMatch6[256][2] = { - { 0, 0 }, { 0, 1 }, { 1, 0 }, { 1, 1 }, { 1, 1 }, { 1, 2 }, { 2, 1 }, { 2, 2 }, - { 2, 2 }, { 2, 3 }, { 3, 2 }, { 3, 3 }, { 3, 3 }, { 3, 4 }, { 4, 3 }, { 4, 4 }, - { 4, 4 }, { 4, 5 }, { 5, 4 }, { 5, 5 }, { 5, 5 }, { 5, 6 }, { 6, 5 }, { 6, 6 }, - { 6, 6 }, { 6, 7 }, { 7, 6 }, { 7, 7 }, { 7, 7 }, { 7, 8 }, { 8, 7 }, { 8, 8 }, - { 8, 8 }, { 8, 9 }, { 9, 8 }, { 9, 9 }, { 9, 9 }, { 9, 10 }, { 10, 9 }, { 10, 10 }, - { 10, 10 }, { 10, 11 }, { 11, 10 }, { 8, 16 }, { 11, 11 }, { 11, 12 }, { 12, 11 }, { 9, 17 }, - { 12, 12 }, { 12, 13 }, { 13, 12 }, { 11, 16 }, { 13, 13 }, { 13, 14 }, { 14, 13 }, { 12, 17 }, - { 14, 14 }, { 14, 15 }, { 15, 14 }, { 14, 16 }, { 15, 15 }, { 15, 16 }, { 16, 14 }, { 16, 15 }, - { 17, 14 }, { 16, 16 }, { 16, 17 }, { 17, 16 }, { 18, 15 }, { 17, 17 }, { 17, 18 }, { 18, 17 }, - { 20, 14 }, { 18, 18 }, { 18, 19 }, { 19, 18 }, { 21, 15 }, { 19, 19 }, { 19, 20 }, { 20, 19 }, - { 20, 20 }, { 20, 20 }, { 20, 21 }, { 21, 20 }, { 21, 21 }, { 21, 21 }, { 21, 22 }, { 22, 21 }, - { 22, 22 }, { 22, 22 }, { 22, 23 }, { 23, 22 }, { 23, 23 }, { 23, 23 }, { 23, 24 }, { 24, 23 }, - { 24, 24 }, { 24, 24 }, { 24, 25 }, { 25, 24 }, { 25, 25 }, { 25, 25 }, { 25, 26 }, { 26, 25 }, - { 26, 26 }, { 26, 26 }, { 26, 27 }, { 27, 26 }, { 24, 32 }, { 27, 27 }, { 27, 28 }, { 28, 27 }, - { 25, 33 }, { 28, 28 }, { 28, 29 }, { 29, 28 }, { 27, 32 }, { 29, 29 }, { 29, 30 }, { 30, 29 }, - { 28, 33 }, { 30, 30 }, { 30, 31 }, { 31, 30 }, { 30, 32 }, { 31, 31 }, { 31, 32 }, { 32, 30 }, - { 32, 31 }, { 33, 30 }, { 32, 32 }, { 32, 33 }, { 33, 32 }, { 34, 31 }, { 33, 33 }, { 33, 34 }, - { 34, 33 }, { 36, 30 }, { 34, 34 }, { 34, 35 }, { 35, 34 }, { 37, 31 }, { 35, 35 }, { 35, 36 }, - { 36, 35 }, { 36, 36 }, { 36, 36 }, { 36, 37 }, { 37, 36 }, { 37, 37 }, { 37, 37 }, { 37, 38 }, - { 38, 37 }, { 38, 38 }, { 38, 38 }, { 38, 39 }, { 39, 38 }, { 39, 39 }, { 39, 39 }, { 39, 40 }, - { 40, 39 }, { 40, 40 }, { 40, 40 }, { 40, 41 }, { 41, 40 }, { 41, 41 }, { 41, 41 }, { 41, 42 }, - { 42, 41 }, { 42, 42 }, { 42, 42 }, { 42, 43 }, { 43, 42 }, { 40, 48 }, { 43, 43 }, { 43, 44 }, - { 44, 43 }, { 41, 49 }, { 44, 44 }, { 44, 45 }, { 45, 44 }, { 43, 48 }, { 45, 45 }, { 45, 46 }, - { 46, 45 }, { 44, 49 }, { 46, 46 }, { 46, 47 }, { 47, 46 }, { 46, 48 }, { 47, 47 }, { 47, 48 }, - { 48, 46 }, { 48, 47 }, { 49, 46 }, { 48, 48 }, { 48, 49 }, { 49, 48 }, { 50, 47 }, { 49, 49 }, - { 49, 50 }, { 50, 49 }, { 52, 46 }, { 50, 50 }, { 50, 51 }, { 51, 50 }, { 53, 47 }, { 51, 51 }, - { 51, 52 }, { 52, 51 }, { 52, 52 }, { 52, 52 }, { 52, 53 }, { 53, 52 }, { 53, 53 }, { 53, 53 }, - { 53, 54 }, { 54, 53 }, { 54, 54 }, { 54, 54 }, { 54, 55 }, { 55, 54 }, { 55, 55 }, { 55, 55 }, - { 55, 56 }, { 56, 55 }, { 56, 56 }, { 56, 56 }, { 56, 57 }, { 57, 56 }, { 57, 57 }, { 57, 57 }, - { 57, 58 }, { 58, 57 }, { 58, 58 }, { 58, 58 }, { 58, 59 }, { 59, 58 }, { 59, 59 }, { 59, 59 }, - { 59, 60 }, { 60, 59 }, { 60, 60 }, { 60, 60 }, { 60, 61 }, { 61, 60 }, { 61, 61 }, { 61, 61 }, - { 61, 62 }, { 62, 61 }, { 62, 62 }, { 62, 62 }, { 62, 63 }, { 63, 62 }, { 63, 63 }, { 63, 63 }, -}; - -static int stb__Mul8Bit(int a, int b) -{ - int t = a*b + 128; - return (t + (t >> 8)) >> 8; -} - -static void stb__From16Bit(unsigned char *out, unsigned short v) -{ - int rv = (v & 0xf800) >> 11; - int gv = (v & 0x07e0) >> 5; - int bv = (v & 0x001f) >> 0; - - // expand to 8 bits via bit replication - out[0] = (rv * 33) >> 2; - out[1] = (gv * 65) >> 4; - out[2] = (bv * 33) >> 2; - out[3] = 0; -} - -static unsigned short stb__As16Bit(int r, int g, int b) -{ - return (unsigned short)((stb__Mul8Bit(r,31) << 11) + (stb__Mul8Bit(g,63) << 5) + stb__Mul8Bit(b,31)); -} - -// linear interpolation at 1/3 point between a and b, using desired rounding type -static int stb__Lerp13(int a, int b) -{ -#ifdef STB_DXT_USE_ROUNDING_BIAS - // with rounding bias - return a + stb__Mul8Bit(b-a, 0x55); -#else - // without rounding bias - // replace "/ 3" by "* 0xaaab) >> 17" if your compiler sucks or you really need every ounce of speed. - return (2*a + b) / 3; -#endif -} - -// lerp RGB color -static void stb__Lerp13RGB(unsigned char *out, unsigned char *p1, unsigned char *p2) -{ - out[0] = (unsigned char)stb__Lerp13(p1[0], p2[0]); - out[1] = (unsigned char)stb__Lerp13(p1[1], p2[1]); - out[2] = (unsigned char)stb__Lerp13(p1[2], p2[2]); -} - -/****************************************************************************/ - -static void stb__EvalColors(unsigned char *color,unsigned short c0,unsigned short c1) -{ - stb__From16Bit(color+ 0, c0); - stb__From16Bit(color+ 4, c1); - stb__Lerp13RGB(color+ 8, color+0, color+4); - stb__Lerp13RGB(color+12, color+4, color+0); -} - -// The color matching function -static unsigned int stb__MatchColorsBlock(unsigned char *block, unsigned char *color) -{ - unsigned int mask = 0; - int dirr = color[0*4+0] - color[1*4+0]; - int dirg = color[0*4+1] - color[1*4+1]; - int dirb = color[0*4+2] - color[1*4+2]; - int dots[16]; - int stops[4]; - int i; - int c0Point, halfPoint, c3Point; - - for(i=0;i<16;i++) - dots[i] = block[i*4+0]*dirr + block[i*4+1]*dirg + block[i*4+2]*dirb; - - for(i=0;i<4;i++) - stops[i] = color[i*4+0]*dirr + color[i*4+1]*dirg + color[i*4+2]*dirb; - - // think of the colors as arranged on a line; project point onto that line, then choose - // next color out of available ones. we compute the crossover points for "best color in top - // half"/"best in bottom half" and then the same inside that subinterval. - // - // relying on this 1d approximation isn't always optimal in terms of euclidean distance, - // but it's very close and a lot faster. - // http://cbloomrants.blogspot.com/2008/12/12-08-08-dxtc-summary.html - - c0Point = (stops[1] + stops[3]); - halfPoint = (stops[3] + stops[2]); - c3Point = (stops[2] + stops[0]); - - for (i=15;i>=0;i--) { - int dot = dots[i]*2; - mask <<= 2; - - if(dot < halfPoint) - mask |= (dot < c0Point) ? 1 : 3; - else - mask |= (dot < c3Point) ? 2 : 0; - } - - return mask; -} - -// The color optimization function. (Clever code, part 1) -static void stb__OptimizeColorsBlock(unsigned char *block, unsigned short *pmax16, unsigned short *pmin16) -{ - int mind,maxd; - unsigned char *minp, *maxp; - double magn; - int v_r,v_g,v_b; - static const int nIterPower = 4; - float covf[6],vfr,vfg,vfb; - - // determine color distribution - int cov[6]; - int mu[3],min[3],max[3]; - int ch,i,iter; - - for(ch=0;ch<3;ch++) - { - const unsigned char *bp = ((const unsigned char *) block) + ch; - int muv,minv,maxv; - - muv = minv = maxv = bp[0]; - for(i=4;i<64;i+=4) - { - muv += bp[i]; - if (bp[i] < minv) minv = bp[i]; - else if (bp[i] > maxv) maxv = bp[i]; - } - - mu[ch] = (muv + 8) >> 4; - min[ch] = minv; - max[ch] = maxv; - } - - // determine covariance matrix - for (i=0;i<6;i++) - cov[i] = 0; - - for (i=0;i<16;i++) - { - int r = block[i*4+0] - mu[0]; - int g = block[i*4+1] - mu[1]; - int b = block[i*4+2] - mu[2]; - - cov[0] += r*r; - cov[1] += r*g; - cov[2] += r*b; - cov[3] += g*g; - cov[4] += g*b; - cov[5] += b*b; - } - - // convert covariance matrix to float, find principal axis via power iter - for(i=0;i<6;i++) - covf[i] = cov[i] / 255.0f; - - vfr = (float) (max[0] - min[0]); - vfg = (float) (max[1] - min[1]); - vfb = (float) (max[2] - min[2]); - - for(iter=0;iter magn) magn = STBD_FABS(vfg); - if (STBD_FABS(vfb) > magn) magn = STBD_FABS(vfb); - - if(magn < 4.0f) { // too small, default to luminance - v_r = 299; // JPEG YCbCr luma coefs, scaled by 1000. - v_g = 587; - v_b = 114; - } else { - magn = 512.0 / magn; - v_r = (int) (vfr * magn); - v_g = (int) (vfg * magn); - v_b = (int) (vfb * magn); - } - - minp = maxp = block; - mind = maxd = block[0]*v_r + block[1]*v_g + block[2]*v_b; - // Pick colors at extreme points - for(i=1;i<16;i++) - { - int dot = block[i*4+0]*v_r + block[i*4+1]*v_g + block[i*4+2]*v_b; - - if (dot < mind) { - mind = dot; - minp = block+i*4; - } - - if (dot > maxd) { - maxd = dot; - maxp = block+i*4; - } - } - - *pmax16 = stb__As16Bit(maxp[0],maxp[1],maxp[2]); - *pmin16 = stb__As16Bit(minp[0],minp[1],minp[2]); -} - -static const float stb__midpoints5[32] = { - 0.015686f, 0.047059f, 0.078431f, 0.111765f, 0.145098f, 0.176471f, 0.207843f, 0.241176f, 0.274510f, 0.305882f, 0.337255f, 0.370588f, 0.403922f, 0.435294f, 0.466667f, 0.5f, - 0.533333f, 0.564706f, 0.596078f, 0.629412f, 0.662745f, 0.694118f, 0.725490f, 0.758824f, 0.792157f, 0.823529f, 0.854902f, 0.888235f, 0.921569f, 0.952941f, 0.984314f, 1.0f -}; - -static const float stb__midpoints6[64] = { - 0.007843f, 0.023529f, 0.039216f, 0.054902f, 0.070588f, 0.086275f, 0.101961f, 0.117647f, 0.133333f, 0.149020f, 0.164706f, 0.180392f, 0.196078f, 0.211765f, 0.227451f, 0.245098f, - 0.262745f, 0.278431f, 0.294118f, 0.309804f, 0.325490f, 0.341176f, 0.356863f, 0.372549f, 0.388235f, 0.403922f, 0.419608f, 0.435294f, 0.450980f, 0.466667f, 0.482353f, 0.500000f, - 0.517647f, 0.533333f, 0.549020f, 0.564706f, 0.580392f, 0.596078f, 0.611765f, 0.627451f, 0.643137f, 0.658824f, 0.674510f, 0.690196f, 0.705882f, 0.721569f, 0.737255f, 0.754902f, - 0.772549f, 0.788235f, 0.803922f, 0.819608f, 0.835294f, 0.850980f, 0.866667f, 0.882353f, 0.898039f, 0.913725f, 0.929412f, 0.945098f, 0.960784f, 0.976471f, 0.992157f, 1.0f -}; - -static unsigned short stb__Quantize5(float x) -{ - unsigned short q; - x = x < 0 ? 0 : x > 1 ? 1 : x; // saturate - q = (unsigned short)(x * 31); - q += (x > stb__midpoints5[q]); - return q; -} - -static unsigned short stb__Quantize6(float x) -{ - unsigned short q; - x = x < 0 ? 0 : x > 1 ? 1 : x; // saturate - q = (unsigned short)(x * 63); - q += (x > stb__midpoints6[q]); - return q; -} - -// The refinement function. (Clever code, part 2) -// Tries to optimize colors to suit block contents better. -// (By solving a least squares system via normal equations+Cramer's rule) -static int stb__RefineBlock(unsigned char *block, unsigned short *pmax16, unsigned short *pmin16, unsigned int mask) -{ - static const int w1Tab[4] = { 3,0,2,1 }; - static const int prods[4] = { 0x090000,0x000900,0x040102,0x010402 }; - // ^some magic to save a lot of multiplies in the accumulating loop... - // (precomputed products of weights for least squares system, accumulated inside one 32-bit register) - - float f; - unsigned short oldMin, oldMax, min16, max16; - int i, akku = 0, xx,xy,yy; - int At1_r,At1_g,At1_b; - int At2_r,At2_g,At2_b; - unsigned int cm = mask; - - oldMin = *pmin16; - oldMax = *pmax16; - - if((mask ^ (mask<<2)) < 4) // all pixels have the same index? - { - // yes, linear system would be singular; solve using optimal - // single-color match on average color - int r = 8, g = 8, b = 8; - for (i=0;i<16;++i) { - r += block[i*4+0]; - g += block[i*4+1]; - b += block[i*4+2]; - } - - r >>= 4; g >>= 4; b >>= 4; - - max16 = (stb__OMatch5[r][0]<<11) | (stb__OMatch6[g][0]<<5) | stb__OMatch5[b][0]; - min16 = (stb__OMatch5[r][1]<<11) | (stb__OMatch6[g][1]<<5) | stb__OMatch5[b][1]; - } else { - At1_r = At1_g = At1_b = 0; - At2_r = At2_g = At2_b = 0; - for (i=0;i<16;++i,cm>>=2) { - int step = cm&3; - int w1 = w1Tab[step]; - int r = block[i*4+0]; - int g = block[i*4+1]; - int b = block[i*4+2]; - - akku += prods[step]; - At1_r += w1*r; - At1_g += w1*g; - At1_b += w1*b; - At2_r += r; - At2_g += g; - At2_b += b; - } - - At2_r = 3*At2_r - At1_r; - At2_g = 3*At2_g - At1_g; - At2_b = 3*At2_b - At1_b; - - // extract solutions and decide solvability - xx = akku >> 16; - yy = (akku >> 8) & 0xff; - xy = (akku >> 0) & 0xff; - - f = 3.0f / 255.0f / (xx*yy - xy*xy); - - max16 = stb__Quantize5((At1_r*yy - At2_r * xy) * f) << 11; - max16 |= stb__Quantize6((At1_g*yy - At2_g * xy) * f) << 5; - max16 |= stb__Quantize5((At1_b*yy - At2_b * xy) * f) << 0; - - min16 = stb__Quantize5((At2_r*xx - At1_r * xy) * f) << 11; - min16 |= stb__Quantize6((At2_g*xx - At1_g * xy) * f) << 5; - min16 |= stb__Quantize5((At2_b*xx - At1_b * xy) * f) << 0; - } - - *pmin16 = min16; - *pmax16 = max16; - return oldMin != min16 || oldMax != max16; -} - -// Color block compression -static void stb__CompressColorBlock(unsigned char *dest, unsigned char *block, int mode) -{ - unsigned int mask; - int i; - int refinecount; - unsigned short max16, min16; - unsigned char color[4*4]; - - refinecount = (mode & STB_DXT_HIGHQUAL) ? 2 : 1; - - // check if block is constant - for (i=1;i<16;i++) - if (((unsigned int *) block)[i] != ((unsigned int *) block)[0]) - break; - - if(i == 16) { // constant color - int r = block[0], g = block[1], b = block[2]; - mask = 0xaaaaaaaa; - max16 = (stb__OMatch5[r][0]<<11) | (stb__OMatch6[g][0]<<5) | stb__OMatch5[b][0]; - min16 = (stb__OMatch5[r][1]<<11) | (stb__OMatch6[g][1]<<5) | stb__OMatch5[b][1]; - } else { - // first step: PCA+map along principal axis - stb__OptimizeColorsBlock(block,&max16,&min16); - if (max16 != min16) { - stb__EvalColors(color,max16,min16); - mask = stb__MatchColorsBlock(block,color); - } else - mask = 0; - - // third step: refine (multiple times if requested) - for (i=0;i> 8); - dest[2] = (unsigned char) (min16); - dest[3] = (unsigned char) (min16 >> 8); - dest[4] = (unsigned char) (mask); - dest[5] = (unsigned char) (mask >> 8); - dest[6] = (unsigned char) (mask >> 16); - dest[7] = (unsigned char) (mask >> 24); -} - -// Alpha block compression (this is easy for a change) -static void stb__CompressAlphaBlock(unsigned char *dest,unsigned char *src, int stride) -{ - int i,dist,bias,dist4,dist2,bits,mask; - - // find min/max color - int mn,mx; - mn = mx = src[0]; - - for (i=1;i<16;i++) - { - if (src[i*stride] < mn) mn = src[i*stride]; - else if (src[i*stride] > mx) mx = src[i*stride]; - } - - // encode them - dest[0] = (unsigned char)mx; - dest[1] = (unsigned char)mn; - dest += 2; - - // determine bias and emit color indices - // given the choice of mx/mn, these indices are optimal: - // http://fgiesen.wordpress.com/2009/12/15/dxt5-alpha-block-index-determination/ - dist = mx-mn; - dist4 = dist*4; - dist2 = dist*2; - bias = (dist < 8) ? (dist - 1) : (dist/2 + 2); - bias -= mn * 7; - bits = 0,mask=0; - - for (i=0;i<16;i++) { - int a = src[i*stride]*7 + bias; - int ind,t; - - // select index. this is a "linear scale" lerp factor between 0 (val=min) and 7 (val=max). - t = (a >= dist4) ? -1 : 0; ind = t & 4; a -= dist4 & t; - t = (a >= dist2) ? -1 : 0; ind += t & 2; a -= dist2 & t; - ind += (a >= dist); - - // turn linear scale into DXT index (0/1 are extremal pts) - ind = -ind & 7; - ind ^= (2 > ind); - - // write index - mask |= ind << bits; - if((bits += 3) >= 8) { - *dest++ = (unsigned char)mask; - mask >>= 8; - bits -= 8; - } - } -} - -void stb_compress_dxt_block(unsigned char *dest, const unsigned char *src, int alpha, int mode) -{ - unsigned char data[16][4]; - if (alpha) { - int i; - stb__CompressAlphaBlock(dest,(unsigned char*) src+3, 4); - dest += 8; - // make a new copy of the data in which alpha is opaque, - // because code uses a fast test for color constancy - memcpy(data, src, 4*16); - for (i=0; i < 16; ++i) - data[i][3] = 255; - src = &data[0][0]; - } - - stb__CompressColorBlock(dest,(unsigned char*) src,mode); -} - -void stb_compress_bc4_block(unsigned char *dest, const unsigned char *src) -{ - stb__CompressAlphaBlock(dest,(unsigned char*) src, 1); -} - -void stb_compress_bc5_block(unsigned char *dest, const unsigned char *src) -{ - stb__CompressAlphaBlock(dest,(unsigned char*) src,2); - stb__CompressAlphaBlock(dest + 8,(unsigned char*) src+1,2); -} -#endif // STB_DXT_IMPLEMENTATION - -// Compile with STB_DXT_IMPLEMENTATION and STB_DXT_GENERATE_TABLES -// defined to generate the tables above. -#ifdef STB_DXT_GENERATE_TABLES -#include - -int main() -{ - int i, j; - const char *omatch_names[] = { "stb__OMatch5", "stb__OMatch6" }; - int dequant_mults[2] = { 33*4, 65 }; // .4 fixed-point dequant multipliers - - // optimal endpoint tables - for (i = 0; i < 2; ++i) { - int dequant = dequant_mults[i]; - int size = i ? 64 : 32; - printf("static const unsigned char %s[256][2] = {\n", omatch_names[i]); - for (int j = 0; j < 256; ++j) { - int mn, mx; - int best_mn = 0, best_mx = 0; - int best_err = 256 * 100; - for (mn=0;mn> 4; - int maxe = (mx * dequant) >> 4; - int err = abs(stb__Lerp13(maxe, mine) - j) * 100; - - // DX10 spec says that interpolation must be within 3% of "correct" result, - // add this as error term. Normally we'd expect a random distribution of - // +-1.5% error, but nowhere in the spec does it say that the error has to be - // unbiased - better safe than sorry. - err += abs(maxe - mine) * 3; - - if(err < best_err) { - best_mn = mn; - best_mx = mx; - best_err = err; - } - } - } - if ((j % 8) == 0) printf(" "); // 2 spaces, third is done below - printf(" { %2d, %2d },", best_mx, best_mn); - if ((j % 8) == 7) printf("\n"); - } - printf("};\n"); - } - - return 0; -} -#endif - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_easy_font.h b/FCLauncher/src/main/jni/lwjgl/stb/stb_easy_font.h deleted file mode 100644 index b6632584..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_easy_font.h +++ /dev/null @@ -1,305 +0,0 @@ -// stb_easy_font.h - v1.1 - bitmap font for 3D rendering - public domain -// Sean Barrett, Feb 2015 -// -// Easy-to-deploy, -// reasonably compact, -// extremely inefficient performance-wise, -// crappy-looking, -// ASCII-only, -// bitmap font for use in 3D APIs. -// -// 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. -// -// DOCUMENTATION: -// -// int stb_easy_font_width(char *text) -// int stb_easy_font_height(char *text) -// -// Takes a string and returns the horizontal size and the -// vertical size (which can vary if 'text' has newlines). -// -// int stb_easy_font_print(float x, float y, -// char *text, unsigned char color[4], -// void *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 vertex-buffer-drawing code. -// -// If you pass in NULL for color, it becomes 255,255,255,255. -// -// Returns the number of quads. -// -// 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. -// -// void stb_easy_font_spacing(float spacing) -// -// Use positive values to expand the space between characters, -// and small negative values (no smaller than -1.5) to contract -// the space between characters. -// -// E.g. spacing = 1 adds one "pixel" of spacing between the -// characters. spacing = -1 is reasonable but feels a bit too -// compact to me; -0.5 is a reasonable compromise as long as -// you're scaling the font up. -// -// LICENSE -// -// See end of file for license information. -// -// VERSION HISTORY -// -// (2020-02-02) 1.1 make everything static so can compile it in more than one src file -// (2017-01-15) 1.0 space character takes same space as numbers; fix bad spacing of 'f' -// (2016-01-22) 0.7 width() supports multiline text; add height() -// (2015-09-13) 0.6 #include ; updated license -// (2015-02-01) 0.5 First release -// -// CONTRIBUTORS -// -// github:vassvik -- bug report -// github:podsvirov -- fix multiple definition errors - -#if 0 -// 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); -} -#endif - -#ifndef INCLUDE_STB_EASY_FONT_H -#define INCLUDE_STB_EASY_FONT_H - -#include -#include - -static struct stb_easy_font_info_struct { - unsigned char advance; - unsigned char h_seg; - unsigned char v_seg; -} stb_easy_font_charinfo[96] = { - { 6, 0, 0 }, { 3, 0, 0 }, { 5, 1, 1 }, { 7, 1, 4 }, - { 7, 3, 7 }, { 7, 6, 12 }, { 7, 8, 19 }, { 4, 16, 21 }, - { 4, 17, 22 }, { 4, 19, 23 }, { 23, 21, 24 }, { 23, 22, 31 }, - { 20, 23, 34 }, { 22, 23, 36 }, { 19, 24, 36 }, { 21, 25, 36 }, - { 6, 25, 39 }, { 6, 27, 43 }, { 6, 28, 45 }, { 6, 30, 49 }, - { 6, 33, 53 }, { 6, 34, 57 }, { 6, 40, 58 }, { 6, 46, 59 }, - { 6, 47, 62 }, { 6, 55, 64 }, { 19, 57, 68 }, { 20, 59, 68 }, - { 21, 61, 69 }, { 22, 66, 69 }, { 21, 68, 69 }, { 7, 73, 69 }, - { 9, 75, 74 }, { 6, 78, 81 }, { 6, 80, 85 }, { 6, 83, 90 }, - { 6, 85, 91 }, { 6, 87, 95 }, { 6, 90, 96 }, { 7, 92, 97 }, - { 6, 96,102 }, { 5, 97,106 }, { 6, 99,107 }, { 6,100,110 }, - { 6,100,115 }, { 7,101,116 }, { 6,101,121 }, { 6,101,125 }, - { 6,102,129 }, { 7,103,133 }, { 6,104,140 }, { 6,105,145 }, - { 7,107,149 }, { 6,108,151 }, { 7,109,155 }, { 7,109,160 }, - { 7,109,165 }, { 7,118,167 }, { 6,118,172 }, { 4,120,176 }, - { 6,122,177 }, { 4,122,181 }, { 23,124,182 }, { 22,129,182 }, - { 4,130,182 }, { 22,131,183 }, { 6,133,187 }, { 22,135,191 }, - { 6,137,192 }, { 22,139,196 }, { 6,144,197 }, { 22,147,198 }, - { 6,150,202 }, { 19,151,206 }, { 21,152,207 }, { 6,155,209 }, - { 3,160,210 }, { 23,160,211 }, { 22,164,216 }, { 22,165,220 }, - { 22,167,224 }, { 22,169,228 }, { 21,171,232 }, { 21,173,233 }, - { 5,178,233 }, { 22,179,234 }, { 23,180,238 }, { 23,180,243 }, - { 23,180,248 }, { 22,189,248 }, { 22,191,252 }, { 5,196,252 }, - { 3,203,252 }, { 5,203,253 }, { 22,210,253 }, { 0,214,253 }, -}; - -static unsigned char stb_easy_font_hseg[214] = { - 97,37,69,84,28,51,2,18,10,49,98,41,65,25,81,105,33,9,97,1,97,37,37,36, - 81,10,98,107,3,100,3,99,58,51,4,99,58,8,73,81,10,50,98,8,73,81,4,10,50, - 98,8,25,33,65,81,10,50,17,65,97,25,33,25,49,9,65,20,68,1,65,25,49,41, - 11,105,13,101,76,10,50,10,50,98,11,99,10,98,11,50,99,11,50,11,99,8,57, - 58,3,99,99,107,10,10,11,10,99,11,5,100,41,65,57,41,65,9,17,81,97,3,107, - 9,97,1,97,33,25,9,25,41,100,41,26,82,42,98,27,83,42,98,26,51,82,8,41, - 35,8,10,26,82,114,42,1,114,8,9,73,57,81,41,97,18,8,8,25,26,26,82,26,82, - 26,82,41,25,33,82,26,49,73,35,90,17,81,41,65,57,41,65,25,81,90,114,20, - 84,73,57,41,49,25,33,65,81,9,97,1,97,25,33,65,81,57,33,25,41,25, -}; - -static unsigned char stb_easy_font_vseg[253] = { - 4,2,8,10,15,8,15,33,8,15,8,73,82,73,57,41,82,10,82,18,66,10,21,29,1,65, - 27,8,27,9,65,8,10,50,97,74,66,42,10,21,57,41,29,25,14,81,73,57,26,8,8, - 26,66,3,8,8,15,19,21,90,58,26,18,66,18,105,89,28,74,17,8,73,57,26,21, - 8,42,41,42,8,28,22,8,8,30,7,8,8,26,66,21,7,8,8,29,7,7,21,8,8,8,59,7,8, - 8,15,29,8,8,14,7,57,43,10,82,7,7,25,42,25,15,7,25,41,15,21,105,105,29, - 7,57,57,26,21,105,73,97,89,28,97,7,57,58,26,82,18,57,57,74,8,30,6,8,8, - 14,3,58,90,58,11,7,74,43,74,15,2,82,2,42,75,42,10,67,57,41,10,7,2,42, - 74,106,15,2,35,8,8,29,7,8,8,59,35,51,8,8,15,35,30,35,8,8,30,7,8,8,60, - 36,8,45,7,7,36,8,43,8,44,21,8,8,44,35,8,8,43,23,8,8,43,35,8,8,31,21,15, - 20,8,8,28,18,58,89,58,26,21,89,73,89,29,20,8,8,30,7, -}; - -typedef struct -{ - unsigned char c[4]; -} stb_easy_font_color; - -static int stb_easy_font_draw_segs(float x, float y, unsigned char *segs, int num_segs, int vertical, stb_easy_font_color c, char *vbuf, int vbuf_size, int offset) -{ - int i,j; - for (i=0; i < num_segs; ++i) { - int len = segs[i] & 7; - x += (float) ((segs[i] >> 3) & 1); - if (len && offset+64 <= vbuf_size) { - float y0 = y + (float) (segs[i]>>4); - for (j=0; j < 4; ++j) { - * (float *) (vbuf+offset+0) = x + (j==1 || j==2 ? (vertical ? 1 : len) : 0); - * (float *) (vbuf+offset+4) = y0 + ( j >= 2 ? (vertical ? len : 1) : 0); - * (float *) (vbuf+offset+8) = 0.f; - * (stb_easy_font_color *) (vbuf+offset+12) = c; - offset += 16; - } - } - } - return offset; -} - -static float stb_easy_font_spacing_val = 0; -static void stb_easy_font_spacing(float spacing) -{ - stb_easy_font_spacing_val = spacing; -} - -static int stb_easy_font_print(float x, float y, char *text, unsigned char color[4], void *vertex_buffer, int vbuf_size) -{ - char *vbuf = (char *) vertex_buffer; - float start_x = x; - int offset = 0; - - stb_easy_font_color c = { 255,255,255,255 }; // use structure copying to avoid needing depending on memcpy() - if (color) { c.c[0] = color[0]; c.c[1] = color[1]; c.c[2] = color[2]; c.c[3] = color[3]; } - - while (*text && offset < vbuf_size) { - if (*text == '\n') { - y += 12; - x = start_x; - } else { - unsigned char advance = stb_easy_font_charinfo[*text-32].advance; - float y_ch = advance & 16 ? y+1 : y; - int h_seg, v_seg, num_h, num_v; - h_seg = stb_easy_font_charinfo[*text-32 ].h_seg; - v_seg = stb_easy_font_charinfo[*text-32 ].v_seg; - num_h = stb_easy_font_charinfo[*text-32+1].h_seg - h_seg; - num_v = stb_easy_font_charinfo[*text-32+1].v_seg - v_seg; - offset = stb_easy_font_draw_segs(x, y_ch, &stb_easy_font_hseg[h_seg], num_h, 0, c, vbuf, vbuf_size, offset); - offset = stb_easy_font_draw_segs(x, y_ch, &stb_easy_font_vseg[v_seg], num_v, 1, c, vbuf, vbuf_size, offset); - x += advance & 15; - x += stb_easy_font_spacing_val; - } - ++text; - } - return (unsigned) offset/64; -} - -static int stb_easy_font_width(char *text) -{ - float len = 0; - float max_len = 0; - while (*text) { - if (*text == '\n') { - if (len > max_len) max_len = len; - len = 0; - } else { - len += stb_easy_font_charinfo[*text-32].advance & 15; - len += stb_easy_font_spacing_val; - } - ++text; - } - if (len > max_len) max_len = len; - return (int) ceil(max_len); -} - -static int stb_easy_font_height(char *text) -{ - float y = 0; - int nonempty_line=0; - while (*text) { - if (*text == '\n') { - y += 12; - nonempty_line = 0; - } else { - nonempty_line = 1; - } - ++text; - } - return (int) ceil(y + (nonempty_line ? 12 : 0)); -} -#endif - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_image.h b/FCLauncher/src/main/jni/lwjgl/stb/stb_image.h deleted file mode 100644 index 5e807a0a..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_image.h +++ /dev/null @@ -1,7987 +0,0 @@ -/* stb_image - v2.28 - public domain image loader - http://nothings.org/stb - no warranty implied; use at your own risk - - Do this: - #define STB_IMAGE_IMPLEMENTATION - before you include this file in *one* C or C++ file to create the implementation. - - // i.e. it should look like this: - #include ... - #include ... - #include ... - #define STB_IMAGE_IMPLEMENTATION - #include "stb_image.h" - - You can #define STBI_ASSERT(x) before the #include to avoid using assert.h. - And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free - - - QUICK NOTES: - Primarily of interest to game developers and other people who can - avoid problematic images and only need the trivial interface - - 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 (*comp 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: - http://gist.github.com/urraka/685d9a6340b26b830d49 - - - decode from memory or through FILE (define STBI_NO_STDIO to remove code) - - decode from arbitrary I/O callbacks - - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON) - - Full documentation under "DOCUMENTATION" below. - - -LICENSE - - See end of file for license information. - -RECENT REVISION HISTORY: - - 2.28 (2023-01-29) many error fixes, security errors, just tons of stuff - 2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes - 2.26 (2020-07-13) many minor fixes - 2.25 (2020-02-02) fix warnings - 2.24 (2020-02-02) fix warnings; thread-local failure_reason and flip_vertically - 2.23 (2019-08-11) fix clang static analysis warning - 2.22 (2019-03-04) gif fixes, fix warnings - 2.21 (2019-02-25) fix typo in comment - 2.20 (2019-02-07) support utf8 filenames in Windows; fix warnings and platform ifdefs - 2.19 (2018-02-11) fix warning - 2.18 (2018-01-30) fix warnings - 2.17 (2018-01-29) bugfix, 1-bit BMP, 16-bitness query, fix warnings - 2.16 (2017-07-23) all functions have 16-bit variants; optimizations; bugfixes - 2.15 (2017-03-18) fix png-1,2,4; all Imagenet JPGs; no runtime SSE detection on GCC - 2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs - 2.13 (2016-12-04) experimental 16-bit API, only for PNG so far; fixes - 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes - 2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64 - RGB-format JPEG; remove white matting in PSD; - allocate large structures on the stack; - correct channel count for PNG & BMP - 2.10 (2016-01-22) avoid warning introduced in 2.09 - 2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED - - See end of file for full revision history. - - - ============================ Contributors ========================= - - Image formats Extensions, features - Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info) - Nicolas Schulz (hdr, psd) Martin "SpartanJ" Golini (stbi_info) - Jonathan Dummer (tga) James "moose2000" Brown (iPhone PNG) - Jean-Marc Lienher (gif) Ben "Disch" Wenger (io callbacks) - Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG) - Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip) - Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD) - github:urraka (animated gif) Junggon Kim (PNM comments) - Christopher Forseth (animated gif) Daniel Gibson (16-bit TGA) - socks-the-fox (16-bit PNG) - Jeremy Sawicki (handle all ImageNet JPGs) - Optimizations & bugfixes Mikhail Morozov (1-bit BMP) - Fabian "ryg" Giesen Anael Seghezzi (is-16-bit query) - Arseny Kapoulkine Simon Breuss (16-bit PNM) - John-Mark Allen - Carmelo J Fdez-Aguera - - Bug & warning fixes - Marc LeBlanc David Woo Guillaume George Martins Mozeiko - Christpher Lloyd Jerry Jansson Joseph Thomson Blazej Dariusz Roszkowski - Phil Jordan Dave Moore Roy Eltham - Hayaki Saito Nathan Reed Won Chun - Luke Graham Johan Duparc Nick Verigakis the Horde3D community - Thomas Ruf Ronny Chevalier github:rlyeh - Janez Zemva John Bartholomew Michal Cichon github:romigrou - Jonathan Blow Ken Hamada Tero Hanninen github:svdijk - Eugene Golushkov Laurent Gomila Cort Stratton github:snagar - Aruelien Pocheville Sergio Gonzalez Thibault Reuille github:Zelex - Cass Everitt Ryamond Barbiero github:grim210 - Paul Du Bois Engin Manap Aldo Culquicondor github:sammyhw - Philipp Wiesemann Dale Weiler Oriol Ferrer Mesia github:phprus - Josh Tobin Neil Bickford Matthew Gregan github:poppolopoppo - Julian Raschke Gregory Mullen Christian Floisand github:darealshinji - Baldur Karlsson Kevin Schmidt JR Smith github:Michaelangel007 - Brad Weinberger Matvey Cherevko github:mosra - Luca Sas Alexander Veselov Zack Middleton [reserved] - Ryan C. Gordon [reserved] [reserved] - DO NOT ADD YOUR NAME HERE - - Jacko Dirks - - To add your name to the credits, pick a random blank space in the middle and fill it. - 80% of merge conflicts on stb PRs are due to people adding their name at the end - of the credits. -*/ - -#ifndef STBI_INCLUDE_STB_IMAGE_H -#define STBI_INCLUDE_STB_IMAGE_H - -// DOCUMENTATION -// -// Limitations: -// - no 12-bit-per-channel JPEG -// - no JPEGs with arithmetic coding -// - GIF always returns *comp=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); -// -// Standard parameters: -// int *x -- outputs image width in pixels -// int *y -- outputs image height in pixels -// int *channels_in_file -- outputs # of image components in image file -// int desired_channels -- if non-zero, # of image components requested in result -// -// The return value from an image loader is an 'unsigned char *' which points -// to the pixel data, or NULL on an allocation failure or if the image is -// corrupt or invalid. The pixel data consists of *y scanlines of *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 'desired_channels' if desired_channels is non-zero, or -// *channels_in_file otherwise. If desired_channels is non-zero, -// *channels_in_file has the number of components that _would_ have been -// output otherwise. E.g. if you set desired_channels to 4, you will always -// get RGBA output, but you can check *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=#comp 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 NULL, -// and *x, *y, *channels_in_file will be unchanged. The function -// stbi_failure_reason() can be queried for an extremely brief, end-user -// unfriendly explanation of why the load failed. Define STBI_NO_FAILURE_STRINGS -// to avoid compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly -// more user-friendly ones. -// -// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized. -// -// To query the width, height and component count of an image without having to -// decode the full file, you can use the stbi_info family of functions: -// -// int x,y,n,ok; -// ok = stbi_info(filename, &x, &y, &n); -// // returns ok=1 and sets x, y, n if image is a supported format, -// // 0 otherwise. -// -// Note that stb_image pervasively uses ints in its public API for sizes, -// including sizes of memory buffers. This is now part of the API and thus -// hard to change without causing breakage. As a result, the various image -// loaders all have certain limits on image size; these differ somewhat -// by format but generally boil down to either just under 2GB or just under -// 1GB. When the decoded image would be larger than this, stb_image decoding -// will fail. -// -// Additionally, stb_image will reject image files that have any of their -// dimensions set to a larger value than the configurable STBI_MAX_DIMENSIONS, -// which defaults to 2**24 = 16777216 pixels. Due to the above memory limit, -// the only way to have an image with such dimensions load correctly -// is for it to have a rather extreme aspect ratio. Either way, the -// assumption here is that such larger images are likely to be malformed -// or malicious. If you do need to load an image with individual dimensions -// larger than that, and it still fits in the overall size limit, you can -// #define STBI_MAX_DIMENSIONS on your own to be something larger. -// -// =========================================================================== -// -// UNICODE: -// -// If compiling for Windows and you wish to use Unicode filenames, compile -// with -// #define STBI_WINDOWS_UTF8 -// and pass utf8-encoded filenames. Call stbi_convert_wchar_to_utf8 to convert -// Windows wchar_t filenames to utf8. -// -// =========================================================================== -// -// Philosophy -// -// stb libraries are designed with the following priorities: -// -// 1. easy to use -// 2. easy to maintain -// 3. good performance -// -// Sometimes I let "good performance" creep up in priority over "easy to maintain", -// and for best performance I may provide less-easy-to-use APIs that give higher -// performance, in addition to the easy-to-use ones. Nevertheless, it's important -// to keep in mind that from the standpoint of you, a client of this library, -// all you care about is #1 and #3, and stb libraries DO NOT emphasize #3 above all. -// -// Some secondary priorities arise directly from the first two, some of which -// provide more explicit reasons why performance can't be emphasized. -// -// - Portable ("ease of use") -// - Small source code footprint ("easy to maintain") -// - No dependencies ("ease of use") -// -// =========================================================================== -// -// I/O callbacks -// -// 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). -// -// =========================================================================== -// -// SIMD support -// -// The JPEG decoder will try to automatically use SIMD kernels on x86 when -// supported by the compiler. For ARM Neon support, you must explicitly -// request it. -// -// (The old do-it-yourself SIMD API is no longer supported in the current -// code.) -// -// On x86, SSE2 will automatically be used when available based on a run-time -// test; if not, the generic C versions are used as a fall-back. On ARM targets, -// the typical path is to have separate builds for NEON and non-NEON devices -// (at least this is true for iOS and Android). Therefore, the NEON support is -// toggled by a build flag: define STBI_NEON to get NEON loops. -// -// If for some reason you do not want to use any of SIMD code, or if -// you have issues compiling it, you can disable it entirely by -// defining STBI_NO_SIMD. -// -// =========================================================================== -// -// HDR image support (disable by defining STBI_NO_HDR) -// -// 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--see header -// file for details) 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: -// -// We optionally support converting iPhone-formatted PNGs (which store -// premultiplied BGRA) back to RGB, even though they're internally encoded -// differently. To enable this conversion, call -// stbi_convert_iphone_png_to_rgb(1). -// -// Call stbi_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). -// -// =========================================================================== -// -// ADDITIONAL CONFIGURATION -// -// - You can suppress implementation of any of the decoders to reduce -// your code footprint by #defining one or more of the following -// symbols before creating the implementation. -// -// STBI_NO_JPEG -// STBI_NO_PNG -// STBI_NO_BMP -// STBI_NO_PSD -// STBI_NO_TGA -// STBI_NO_GIF -// STBI_NO_HDR -// STBI_NO_PIC -// STBI_NO_PNM (.ppm and .pgm) -// -// - You can request *only* certain decoders and suppress all other ones -// (this will be more forward-compatible, as addition of new decoders -// doesn't require you to disable them explicitly): -// -// STBI_ONLY_JPEG -// STBI_ONLY_PNG -// STBI_ONLY_BMP -// STBI_ONLY_PSD -// STBI_ONLY_TGA -// STBI_ONLY_GIF -// STBI_ONLY_HDR -// STBI_ONLY_PIC -// STBI_ONLY_PNM (.ppm and .pgm) -// -// - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still -// want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB -// -// - If you define STBI_MAX_DIMENSIONS, stb_image will reject images greater -// than that size (in either width or height) without further processing. -// This is to let programs in the wild set an upper bound to prevent -// denial-of-service attacks on untrusted data, as one could generate a -// valid image of gigantic dimensions and force stb_image to allocate a -// huge block of memory and spend disproportionate time decoding it. By -// default this is set to (1 << 24), which is 16777216, but that's still -// very big. - -#ifndef STBI_NO_STDIO -#include -#endif // STBI_NO_STDIO - -#define STBI_VERSION 1 - -enum -{ - STBI_default = 0, // only used for desired_channels - - STBI_grey = 1, - STBI_grey_alpha = 2, - STBI_rgb = 3, - STBI_rgb_alpha = 4 -}; - -#include -typedef unsigned char stbi_uc; -typedef unsigned short stbi_us; - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef STBIDEF -#ifdef STB_IMAGE_STATIC -#define STBIDEF static -#else -#define STBIDEF extern -#endif -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// PRIMARY API - works on images of any type -// - -// -// load image by filename, open file, or memory buffer -// - -typedef struct -{ - int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read - void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative - int (*eof) (void *user); // returns nonzero if we are at end of file/data -} stbi_io_callbacks; - -//////////////////////////////////// -// -// 8-bits-per-channel interface -// - -STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *channels_in_file, int desired_channels); -STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *channels_in_file, int desired_channels); - -#ifndef STBI_NO_STDIO -STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels); -STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels); -// for stbi_load_from_file, file pointer is left pointing immediately after image -#endif - -#ifndef STBI_NO_GIF -STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp); -#endif - -#ifdef STBI_WINDOWS_UTF8 -STBIDEF int stbi_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input); -#endif - -//////////////////////////////////// -// -// 16-bits-per-channel interface -// - -STBIDEF stbi_us *stbi_load_16_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels); -STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels); - -#ifndef STBI_NO_STDIO -STBIDEF stbi_us *stbi_load_16 (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels); -STBIDEF stbi_us *stbi_load_from_file_16(FILE *f, int *x, int *y, int *channels_in_file, int desired_channels); -#endif - -//////////////////////////////////// -// -// float-per-channel interface -// -#ifndef STBI_NO_LINEAR - STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels); - STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels); - - #ifndef STBI_NO_STDIO - STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels); - STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels); - #endif -#endif - -#ifndef STBI_NO_HDR - STBIDEF void stbi_hdr_to_ldr_gamma(float gamma); - STBIDEF void stbi_hdr_to_ldr_scale(float scale); -#endif // STBI_NO_HDR - -#ifndef STBI_NO_LINEAR - STBIDEF void stbi_ldr_to_hdr_gamma(float gamma); - STBIDEF void stbi_ldr_to_hdr_scale(float scale); -#endif // STBI_NO_LINEAR - -// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR -STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user); -STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len); -#ifndef STBI_NO_STDIO -STBIDEF int stbi_is_hdr (char const *filename); -STBIDEF int stbi_is_hdr_from_file(FILE *f); -#endif // STBI_NO_STDIO - - -// get a VERY brief reason for failure -// on most compilers (and ALL modern mainstream compilers) this is threadsafe -STBIDEF const char *stbi_failure_reason (void); - -// free the loaded image -- this is just free() -STBIDEF void stbi_image_free (void *retval_from_stbi_load); - -// get image dimensions & components without fully decoding -STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); -STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); -STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len); -STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *clbk, void *user); - -#ifndef STBI_NO_STDIO -STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp); -STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); -STBIDEF int stbi_is_16_bit (char const *filename); -STBIDEF int stbi_is_16_bit_from_file(FILE *f); -#endif - - - -// 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 overflow. -STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply); - -// indicate whether we should process iphone images back to canonical format, -// or just pass them through "as-is" -STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert); - -// flip the image vertically, so the first pixel in the output array is the bottom left -STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip); - -// as above, but only applies to images loaded on the thread that calls the function -// this function is only available if your compiler supports thread-local variables; -// calling it will fail to link if your compiler doesn't -STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply); -STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_convert); -STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_flip); - -// ZLIB client - used by PNG, available for other purposes - -STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen); -STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header); -STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen); -STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); - -STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen); -STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen); - - -#ifdef __cplusplus -} -#endif - -// -// -//// end header file ///////////////////////////////////////////////////// -#endif // STBI_INCLUDE_STB_IMAGE_H - -#ifdef STB_IMAGE_IMPLEMENTATION - -#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \ - || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \ - || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \ - || defined(STBI_ONLY_ZLIB) - #ifndef STBI_ONLY_JPEG - #define STBI_NO_JPEG - #endif - #ifndef STBI_ONLY_PNG - #define STBI_NO_PNG - #endif - #ifndef STBI_ONLY_BMP - #define STBI_NO_BMP - #endif - #ifndef STBI_ONLY_PSD - #define STBI_NO_PSD - #endif - #ifndef STBI_ONLY_TGA - #define STBI_NO_TGA - #endif - #ifndef STBI_ONLY_GIF - #define STBI_NO_GIF - #endif - #ifndef STBI_ONLY_HDR - #define STBI_NO_HDR - #endif - #ifndef STBI_ONLY_PIC - #define STBI_NO_PIC - #endif - #ifndef STBI_ONLY_PNM - #define STBI_NO_PNM - #endif -#endif - -#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB) -#define STBI_NO_ZLIB -#endif - - -#include -#include // ptrdiff_t on osx -#include -#include -#include - -#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) -#include // ldexp, pow -#endif - -#ifndef STBI_NO_STDIO -#include -#endif - -#ifndef STBI_ASSERT -#include -#define STBI_ASSERT(x) assert(x) -#endif - -#ifdef __cplusplus -#define STBI_EXTERN extern "C" -#else -#define STBI_EXTERN extern -#endif - - -#ifndef _MSC_VER - #ifdef __cplusplus - #define stbi_inline inline - #else - #define stbi_inline - #endif -#else - #define stbi_inline __forceinline -#endif - -#ifndef STBI_NO_THREAD_LOCALS - #if defined(__cplusplus) && __cplusplus >= 201103L - #define STBI_THREAD_LOCAL thread_local - #elif defined(__GNUC__) && __GNUC__ < 5 - #define STBI_THREAD_LOCAL __thread - #elif defined(_MSC_VER) - #define STBI_THREAD_LOCAL __declspec(thread) - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__) - #define STBI_THREAD_LOCAL _Thread_local - #endif - - #ifndef STBI_THREAD_LOCAL - #if defined(__GNUC__) - #define STBI_THREAD_LOCAL __thread - #endif - #endif -#endif - -#if defined(_MSC_VER) || defined(__SYMBIAN32__) -typedef unsigned short stbi__uint16; -typedef signed short stbi__int16; -typedef unsigned int stbi__uint32; -typedef signed int stbi__int32; -#else -#include -typedef uint16_t stbi__uint16; -typedef int16_t stbi__int16; -typedef uint32_t stbi__uint32; -typedef int32_t stbi__int32; -#endif - -// should produce compiler error if size is wrong -typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1]; - -#ifdef _MSC_VER -#define STBI_NOTUSED(v) (void)(v) -#else -#define STBI_NOTUSED(v) (void)sizeof(v) -#endif - -#ifdef _MSC_VER -#define STBI_HAS_LROTL -#endif - -#ifdef STBI_HAS_LROTL - #define stbi_lrot(x,y) _lrotl(x,y) -#else - #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (-(y) & 31))) -#endif - -#if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED)) -// ok -#elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC) && !defined(STBI_REALLOC_SIZED) -// ok -#else -#error "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC (or STBI_REALLOC_SIZED)." -#endif - -#ifndef STBI_MALLOC -#define STBI_MALLOC(sz) malloc(sz) -#define STBI_REALLOC(p,newsz) realloc(p,newsz) -#define STBI_FREE(p) free(p) -#endif - -#ifndef STBI_REALLOC_SIZED -#define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz) -#endif - -// x86/x64 detection -#if defined(__x86_64__) || defined(_M_X64) -#define STBI__X64_TARGET -#elif defined(__i386) || defined(_M_IX86) -#define STBI__X86_TARGET -#endif - -#if defined(__GNUC__) && defined(STBI__X86_TARGET) && !defined(__SSE2__) && !defined(STBI_NO_SIMD) -// gcc doesn't support sse2 intrinsics unless you compile with -msse2, -// which in turn means it gets to use SSE2 everywhere. This is unfortunate, -// but previous attempts to provide the SSE2 functions with runtime -// detection caused numerous issues. The way architecture extensions are -// exposed in GCC/Clang is, sadly, not really suited for one-file libs. -// New behavior: if compiled with -msse2, we use SSE2 without any -// detection; if not, we don't use it at all. -#define STBI_NO_SIMD -#endif - -#if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD) -// Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET -// -// 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the -// Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant. -// As a result, enabling SSE2 on 32-bit MinGW is dangerous when not -// simultaneously enabling "-mstackrealign". -// -// See https://github.com/nothings/stb/issues/81 for more information. -// -// So default to no SSE2 on 32-bit MinGW. If you've read this far and added -// -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2. -#define STBI_NO_SIMD -#endif - -#if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) -#define STBI_SSE2 -#include - -#ifdef _MSC_VER - -#if _MSC_VER >= 1400 // not VC6 -#include // __cpuid -static int stbi__cpuid3(void) -{ - int info[4]; - __cpuid(info,1); - return info[3]; -} -#else -static int stbi__cpuid3(void) -{ - int res; - __asm { - mov eax,1 - cpuid - mov res,edx - } - return res; -} -#endif - -#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name - -#if !defined(STBI_NO_JPEG) && defined(STBI_SSE2) -static int stbi__sse2_available(void) -{ - int info3 = stbi__cpuid3(); - return ((info3 >> 26) & 1) != 0; -} -#endif - -#else // assume GCC-style if not VC++ -#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) - -#if !defined(STBI_NO_JPEG) && defined(STBI_SSE2) -static int stbi__sse2_available(void) -{ - // If we're even attempting to compile this on GCC/Clang, that means - // -msse2 is on, which means the compiler is allowed to use SSE2 - // instructions at will, and so are we. - return 1; -} -#endif - -#endif -#endif - -// ARM NEON -#if defined(STBI_NO_SIMD) && defined(STBI_NEON) -#undef STBI_NEON -#endif - -#ifdef STBI_NEON -#include -#ifdef _MSC_VER -#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name -#else -#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) -#endif -#endif - -#ifndef STBI_SIMD_ALIGN -#define STBI_SIMD_ALIGN(type, name) type name -#endif - -#ifndef STBI_MAX_DIMENSIONS -#define STBI_MAX_DIMENSIONS (1 << 24) -#endif - -/////////////////////////////////////////////// -// -// stbi__context struct and start_xxx functions - -// stbi__context structure is our basic context used by all images, so it -// contains all the IO context, plus some basic image information -typedef struct -{ - stbi__uint32 img_x, img_y; - int img_n, img_out_n; - - stbi_io_callbacks io; - void *io_user_data; - - int read_from_callbacks; - int buflen; - stbi_uc buffer_start[128]; - int callback_already_read; - - stbi_uc *img_buffer, *img_buffer_end; - stbi_uc *img_buffer_original, *img_buffer_original_end; -} stbi__context; - - -static void stbi__refill_buffer(stbi__context *s); - -// initialize a memory-decode context -static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len) -{ - s->io.read = NULL; - s->read_from_callbacks = 0; - s->callback_already_read = 0; - s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer; - s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len; -} - -// initialize a callback-based context -static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user) -{ - s->io = *c; - s->io_user_data = user; - s->buflen = sizeof(s->buffer_start); - s->read_from_callbacks = 1; - s->callback_already_read = 0; - s->img_buffer = s->img_buffer_original = s->buffer_start; - stbi__refill_buffer(s); - s->img_buffer_original_end = s->img_buffer_end; -} - -#ifndef STBI_NO_STDIO - -static int stbi__stdio_read(void *user, char *data, int size) -{ - return (int) fread(data,1,size,(FILE*) user); -} - -static void stbi__stdio_skip(void *user, int n) -{ - int ch; - fseek((FILE*) user, n, SEEK_CUR); - ch = fgetc((FILE*) user); /* have to read a byte to reset feof()'s flag */ - if (ch != EOF) { - ungetc(ch, (FILE *) user); /* push byte back onto stream if valid. */ - } -} - -static int stbi__stdio_eof(void *user) -{ - return feof((FILE*) user) || ferror((FILE *) user); -} - -static stbi_io_callbacks stbi__stdio_callbacks = -{ - stbi__stdio_read, - stbi__stdio_skip, - stbi__stdio_eof, -}; - -static void stbi__start_file(stbi__context *s, FILE *f) -{ - stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f); -} - -//static void stop_file(stbi__context *s) { } - -#endif // !STBI_NO_STDIO - -static void stbi__rewind(stbi__context *s) -{ - // conceptually rewind SHOULD rewind to the beginning of the stream, - // but we just rewind to the beginning of the initial buffer, because - // we only use it after doing 'test', which only ever looks at at most 92 bytes - s->img_buffer = s->img_buffer_original; - s->img_buffer_end = s->img_buffer_original_end; -} - -enum -{ - STBI_ORDER_RGB, - STBI_ORDER_BGR -}; - -typedef struct -{ - int bits_per_channel; - int num_channels; - int channel_order; -} stbi__result_info; - -#ifndef STBI_NO_JPEG -static int stbi__jpeg_test(stbi__context *s); -static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_PNG -static int stbi__png_test(stbi__context *s); -static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp); -static int stbi__png_is16(stbi__context *s); -#endif - -#ifndef STBI_NO_BMP -static int stbi__bmp_test(stbi__context *s); -static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_TGA -static int stbi__tga_test(stbi__context *s); -static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_PSD -static int stbi__psd_test(stbi__context *s); -static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc); -static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp); -static int stbi__psd_is16(stbi__context *s); -#endif - -#ifndef STBI_NO_HDR -static int stbi__hdr_test(stbi__context *s); -static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_PIC -static int stbi__pic_test(stbi__context *s); -static void *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_GIF -static int stbi__gif_test(stbi__context *s); -static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, int *z, int *comp, int req_comp); -static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp); -#endif - -#ifndef STBI_NO_PNM -static int stbi__pnm_test(stbi__context *s); -static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp); -static int stbi__pnm_is16(stbi__context *s); -#endif - -static -#ifdef STBI_THREAD_LOCAL -STBI_THREAD_LOCAL -#endif -const char *stbi__g_failure_reason; - -STBIDEF const char *stbi_failure_reason(void) -{ - return stbi__g_failure_reason; -} - -#ifndef STBI_NO_FAILURE_STRINGS -static int stbi__err(const char *str) -{ - stbi__g_failure_reason = str; - return 0; -} -#endif - -static void *stbi__malloc(size_t size) -{ - return STBI_MALLOC(size); -} - -// stb_image uses ints pervasively, including for offset calculations. -// therefore the largest decoded image size we can support with the -// current code, even on 64-bit targets, is INT_MAX. this is not a -// significant limitation for the intended use case. -// -// we do, however, need to make sure our size calculations don't -// overflow. hence a few helper functions for size calculations that -// multiply integers together, making sure that they're non-negative -// and no overflow occurs. - -// return 1 if the sum is valid, 0 on overflow. -// negative terms are considered invalid. -static int stbi__addsizes_valid(int a, int b) -{ - if (b < 0) return 0; - // now 0 <= b <= INT_MAX, hence also - // 0 <= INT_MAX - b <= INTMAX. - // And "a + b <= INT_MAX" (which might overflow) is the - // same as a <= INT_MAX - b (no overflow) - return a <= INT_MAX - b; -} - -// returns 1 if the product is valid, 0 on overflow. -// negative factors are considered invalid. -static int stbi__mul2sizes_valid(int a, int b) -{ - if (a < 0 || b < 0) return 0; - if (b == 0) return 1; // mul-by-0 is always safe - // portable way to check for no overflows in a*b - return a <= INT_MAX/b; -} - -#if !defined(STBI_NO_JPEG) || !defined(STBI_NO_PNG) || !defined(STBI_NO_TGA) || !defined(STBI_NO_HDR) -// returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow -static int stbi__mad2sizes_valid(int a, int b, int add) -{ - return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add); -} -#endif - -// returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow -static int stbi__mad3sizes_valid(int a, int b, int c, int add) -{ - return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) && - stbi__addsizes_valid(a*b*c, add); -} - -// returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow -#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) || !defined(STBI_NO_PNM) -static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add) -{ - return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) && - stbi__mul2sizes_valid(a*b*c, d) && stbi__addsizes_valid(a*b*c*d, add); -} -#endif - -#if !defined(STBI_NO_JPEG) || !defined(STBI_NO_PNG) || !defined(STBI_NO_TGA) || !defined(STBI_NO_HDR) -// mallocs with size overflow checking -static void *stbi__malloc_mad2(int a, int b, int add) -{ - if (!stbi__mad2sizes_valid(a, b, add)) return NULL; - return stbi__malloc(a*b + add); -} -#endif - -static void *stbi__malloc_mad3(int a, int b, int c, int add) -{ - if (!stbi__mad3sizes_valid(a, b, c, add)) return NULL; - return stbi__malloc(a*b*c + add); -} - -#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) || !defined(STBI_NO_PNM) -static void *stbi__malloc_mad4(int a, int b, int c, int d, int add) -{ - if (!stbi__mad4sizes_valid(a, b, c, d, add)) return NULL; - return stbi__malloc(a*b*c*d + add); -} -#endif - -// returns 1 if the sum of two signed ints is valid (between -2^31 and 2^31-1 inclusive), 0 on overflow. -static int stbi__addints_valid(int a, int b) -{ - if ((a >= 0) != (b >= 0)) return 1; // a and b have different signs, so no overflow - if (a < 0 && b < 0) return a >= INT_MIN - b; // same as a + b >= INT_MIN; INT_MIN - b cannot overflow since b < 0. - return a <= INT_MAX - b; -} - -// returns 1 if the product of two signed shorts is valid, 0 on overflow. -static int stbi__mul2shorts_valid(short a, short b) -{ - if (b == 0 || b == -1) return 1; // multiplication by 0 is always 0; check for -1 so SHRT_MIN/b doesn't overflow - if ((a >= 0) == (b >= 0)) return a <= SHRT_MAX/b; // product is positive, so similar to mul2sizes_valid - if (b < 0) return a <= SHRT_MIN / b; // same as a * b >= SHRT_MIN - return a >= SHRT_MIN / b; -} - -// stbi__err - error -// stbi__errpf - error returning pointer to float -// stbi__errpuc - error returning pointer to unsigned char - -#ifdef STBI_NO_FAILURE_STRINGS - #define stbi__err(x,y) 0 -#elif defined(STBI_FAILURE_USERMSG) - #define stbi__err(x,y) stbi__err(y) -#else - #define stbi__err(x,y) stbi__err(x) -#endif - -#define stbi__errpf(x,y) ((float *)(size_t) (stbi__err(x,y)?NULL:NULL)) -#define stbi__errpuc(x,y) ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL)) - -STBIDEF void stbi_image_free(void *retval_from_stbi_load) -{ - STBI_FREE(retval_from_stbi_load); -} - -#ifndef STBI_NO_LINEAR -static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp); -#endif - -#ifndef STBI_NO_HDR -static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp); -#endif - -static int stbi__vertically_flip_on_load_global = 0; - -STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip) -{ - stbi__vertically_flip_on_load_global = flag_true_if_should_flip; -} - -#ifndef STBI_THREAD_LOCAL -#define stbi__vertically_flip_on_load stbi__vertically_flip_on_load_global -#else -static STBI_THREAD_LOCAL int stbi__vertically_flip_on_load_local, stbi__vertically_flip_on_load_set; - -STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_flip) -{ - stbi__vertically_flip_on_load_local = flag_true_if_should_flip; - stbi__vertically_flip_on_load_set = 1; -} - -#define stbi__vertically_flip_on_load (stbi__vertically_flip_on_load_set \ - ? stbi__vertically_flip_on_load_local \ - : stbi__vertically_flip_on_load_global) -#endif // STBI_THREAD_LOCAL - -static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc) -{ - memset(ri, 0, sizeof(*ri)); // make sure it's initialized if we add new fields - ri->bits_per_channel = 8; // default is 8 so most paths don't have to be changed - ri->channel_order = STBI_ORDER_RGB; // all current input & output are this, but this is here so we can add BGR order - ri->num_channels = 0; - - // test the formats with a very explicit header first (at least a FOURCC - // or distinctive magic number first) - #ifndef STBI_NO_PNG - if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp, ri); - #endif - #ifndef STBI_NO_BMP - if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp, ri); - #endif - #ifndef STBI_NO_GIF - if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp, ri); - #endif - #ifndef STBI_NO_PSD - if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp, ri, bpc); - #else - STBI_NOTUSED(bpc); - #endif - #ifndef STBI_NO_PIC - if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp, ri); - #endif - - // then the formats that can end up attempting to load with just 1 or 2 - // bytes matching expectations; these are prone to false positives, so - // try them later - #ifndef STBI_NO_JPEG - if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp, ri); - #endif - #ifndef STBI_NO_PNM - if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp, ri); - #endif - - #ifndef STBI_NO_HDR - if (stbi__hdr_test(s)) { - float *hdr = stbi__hdr_load(s, x,y,comp,req_comp, ri); - return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp); - } - #endif - - #ifndef STBI_NO_TGA - // test tga last because it's a crappy test! - if (stbi__tga_test(s)) - return stbi__tga_load(s,x,y,comp,req_comp, ri); - #endif - - return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt"); -} - -static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, int channels) -{ - int i; - int img_len = w * h * channels; - stbi_uc *reduced; - - reduced = (stbi_uc *) stbi__malloc(img_len); - if (reduced == NULL) return stbi__errpuc("outofmem", "Out of memory"); - - for (i = 0; i < img_len; ++i) - reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is sufficient approx of 16->8 bit scaling - - STBI_FREE(orig); - return reduced; -} - -static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int channels) -{ - int i; - int img_len = w * h * channels; - stbi__uint16 *enlarged; - - enlarged = (stbi__uint16 *) stbi__malloc(img_len*2); - if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory"); - - for (i = 0; i < img_len; ++i) - enlarged[i] = (stbi__uint16)((orig[i] << 8) + orig[i]); // replicate to high and low byte, maps 0->0, 255->0xffff - - STBI_FREE(orig); - return enlarged; -} - -static void stbi__vertical_flip(void *image, int w, int h, int bytes_per_pixel) -{ - int row; - size_t bytes_per_row = (size_t)w * bytes_per_pixel; - stbi_uc temp[2048]; - stbi_uc *bytes = (stbi_uc *)image; - - for (row = 0; row < (h>>1); row++) { - stbi_uc *row0 = bytes + row*bytes_per_row; - stbi_uc *row1 = bytes + (h - row - 1)*bytes_per_row; - // swap row0 with row1 - size_t bytes_left = bytes_per_row; - while (bytes_left) { - size_t bytes_copy = (bytes_left < sizeof(temp)) ? bytes_left : sizeof(temp); - memcpy(temp, row0, bytes_copy); - memcpy(row0, row1, bytes_copy); - memcpy(row1, temp, bytes_copy); - row0 += bytes_copy; - row1 += bytes_copy; - bytes_left -= bytes_copy; - } - } -} - -#ifndef STBI_NO_GIF -static void stbi__vertical_flip_slices(void *image, int w, int h, int z, int bytes_per_pixel) -{ - int slice; - int slice_size = w * h * bytes_per_pixel; - - stbi_uc *bytes = (stbi_uc *)image; - for (slice = 0; slice < z; ++slice) { - stbi__vertical_flip(bytes, w, h, bytes_per_pixel); - bytes += slice_size; - } -} -#endif - -static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - stbi__result_info ri; - void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8); - - if (result == NULL) - return NULL; - - // it is the responsibility of the loaders to make sure we get either 8 or 16 bit. - STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16); - - if (ri.bits_per_channel != 8) { - result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp); - ri.bits_per_channel = 8; - } - - // @TODO: move stbi__convert_format to here - - if (stbi__vertically_flip_on_load) { - int channels = req_comp ? req_comp : *comp; - stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi_uc)); - } - - return (unsigned char *) result; -} - -static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - stbi__result_info ri; - void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16); - - if (result == NULL) - return NULL; - - // it is the responsibility of the loaders to make sure we get either 8 or 16 bit. - STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16); - - if (ri.bits_per_channel != 16) { - result = stbi__convert_8_to_16((stbi_uc *) result, *x, *y, req_comp == 0 ? *comp : req_comp); - ri.bits_per_channel = 16; - } - - // @TODO: move stbi__convert_format16 to here - // @TODO: special case RGB-to-Y (and RGBA-to-YA) for 8-bit-to-16-bit case to keep more precision - - if (stbi__vertically_flip_on_load) { - int channels = req_comp ? req_comp : *comp; - stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi__uint16)); - } - - return (stbi__uint16 *) result; -} - -#if !defined(STBI_NO_HDR) && !defined(STBI_NO_LINEAR) -static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp) -{ - if (stbi__vertically_flip_on_load && result != NULL) { - int channels = req_comp ? req_comp : *comp; - stbi__vertical_flip(result, *x, *y, channels * sizeof(float)); - } -} -#endif - -#ifndef STBI_NO_STDIO - -#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) -STBI_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, int cchwide); -STBI_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default); -#endif - -#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) -STBIDEF int stbi_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input) -{ - return WideCharToMultiByte(65001 /* UTF8 */, 0, input, -1, buffer, (int) bufferlen, NULL, NULL); -} -#endif - -static FILE *stbi__fopen(char const *filename, char const *mode) -{ - FILE *f; -#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) - wchar_t wMode[64]; - wchar_t wFilename[1024]; - if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)/sizeof(*wFilename))) - return 0; - - if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)/sizeof(*wMode))) - return 0; - -#if defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != _wfopen_s(&f, wFilename, wMode)) - f = 0; -#else - f = _wfopen(wFilename, wMode); -#endif - -#elif defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != fopen_s(&f, filename, mode)) - f=0; -#else - f = fopen(filename, mode); -#endif - return f; -} - - -STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp) -{ - FILE *f = stbi__fopen(filename, "rb"); - unsigned char *result; - if (!f) return stbi__errpuc("can't fopen", "Unable to open file"); - result = stbi_load_from_file(f,x,y,comp,req_comp); - fclose(f); - return result; -} - -STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) -{ - unsigned char *result; - stbi__context s; - stbi__start_file(&s,f); - result = stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp); - if (result) { - // need to 'unget' all the characters in the IO buffer - fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR); - } - return result; -} - -STBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, int *comp, int req_comp) -{ - stbi__uint16 *result; - stbi__context s; - stbi__start_file(&s,f); - result = stbi__load_and_postprocess_16bit(&s,x,y,comp,req_comp); - if (result) { - // need to 'unget' all the characters in the IO buffer - fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR); - } - return result; -} - -STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *comp, int req_comp) -{ - FILE *f = stbi__fopen(filename, "rb"); - stbi__uint16 *result; - if (!f) return (stbi_us *) stbi__errpuc("can't fopen", "Unable to open file"); - result = stbi_load_from_file_16(f,x,y,comp,req_comp); - fclose(f); - return result; -} - - -#endif //!STBI_NO_STDIO - -STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels) -{ - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__load_and_postprocess_16bit(&s,x,y,channels_in_file,desired_channels); -} - -STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels) -{ - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *)clbk, user); - return stbi__load_and_postprocess_16bit(&s,x,y,channels_in_file,desired_channels); -} - -STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp); -} - -STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp); -} - -#ifndef STBI_NO_GIF -STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp) -{ - unsigned char *result; - stbi__context s; - stbi__start_mem(&s,buffer,len); - - result = (unsigned char*) stbi__load_gif_main(&s, delays, x, y, z, comp, req_comp); - if (stbi__vertically_flip_on_load) { - stbi__vertical_flip_slices( result, *x, *y, *z, *comp ); - } - - return result; -} -#endif - -#ifndef STBI_NO_LINEAR -static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp) -{ - unsigned char *data; - #ifndef STBI_NO_HDR - if (stbi__hdr_test(s)) { - stbi__result_info ri; - float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp, &ri); - if (hdr_data) - stbi__float_postprocess(hdr_data,x,y,comp,req_comp); - return hdr_data; - } - #endif - data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp); - if (data) - return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp); - return stbi__errpf("unknown image type", "Image not of any known type, or corrupt"); -} - -STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__loadf_main(&s,x,y,comp,req_comp); -} - -STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi__loadf_main(&s,x,y,comp,req_comp); -} - -#ifndef STBI_NO_STDIO -STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp) -{ - float *result; - FILE *f = stbi__fopen(filename, "rb"); - if (!f) return stbi__errpf("can't fopen", "Unable to open file"); - result = stbi_loadf_from_file(f,x,y,comp,req_comp); - fclose(f); - return result; -} - -STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp) -{ - stbi__context s; - stbi__start_file(&s,f); - return stbi__loadf_main(&s,x,y,comp,req_comp); -} -#endif // !STBI_NO_STDIO - -#endif // !STBI_NO_LINEAR - -// these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is -// defined, for API simplicity; if STBI_NO_LINEAR is defined, it always -// reports false! - -STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len) -{ - #ifndef STBI_NO_HDR - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__hdr_test(&s); - #else - STBI_NOTUSED(buffer); - STBI_NOTUSED(len); - return 0; - #endif -} - -#ifndef STBI_NO_STDIO -STBIDEF int stbi_is_hdr (char const *filename) -{ - FILE *f = stbi__fopen(filename, "rb"); - int result=0; - if (f) { - result = stbi_is_hdr_from_file(f); - fclose(f); - } - return result; -} - -STBIDEF int stbi_is_hdr_from_file(FILE *f) -{ - #ifndef STBI_NO_HDR - long pos = ftell(f); - int res; - stbi__context s; - stbi__start_file(&s,f); - res = stbi__hdr_test(&s); - fseek(f, pos, SEEK_SET); - return res; - #else - STBI_NOTUSED(f); - return 0; - #endif -} -#endif // !STBI_NO_STDIO - -STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user) -{ - #ifndef STBI_NO_HDR - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user); - return stbi__hdr_test(&s); - #else - STBI_NOTUSED(clbk); - STBI_NOTUSED(user); - return 0; - #endif -} - -#ifndef STBI_NO_LINEAR -static float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f; - -STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; } -STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; } -#endif - -static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f; - -STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; } -STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; } - - -////////////////////////////////////////////////////////////////////////////// -// -// Common code used by all image loaders -// - -enum -{ - STBI__SCAN_load=0, - STBI__SCAN_type, - STBI__SCAN_header -}; - -static void stbi__refill_buffer(stbi__context *s) -{ - int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen); - s->callback_already_read += (int) (s->img_buffer - s->img_buffer_original); - if (n == 0) { - // at end of file, treat same as if from memory, but need to handle case - // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file - s->read_from_callbacks = 0; - s->img_buffer = s->buffer_start; - s->img_buffer_end = s->buffer_start+1; - *s->img_buffer = 0; - } else { - s->img_buffer = s->buffer_start; - s->img_buffer_end = s->buffer_start + n; - } -} - -stbi_inline static stbi_uc stbi__get8(stbi__context *s) -{ - if (s->img_buffer < s->img_buffer_end) - return *s->img_buffer++; - if (s->read_from_callbacks) { - stbi__refill_buffer(s); - return *s->img_buffer++; - } - return 0; -} - -#if defined(STBI_NO_JPEG) && defined(STBI_NO_HDR) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) -// nothing -#else -stbi_inline static int stbi__at_eof(stbi__context *s) -{ - if (s->io.read) { - if (!(s->io.eof)(s->io_user_data)) return 0; - // if feof() is true, check if buffer = end - // special case: we've only got the special 0 character at the end - if (s->read_from_callbacks == 0) return 1; - } - - return s->img_buffer >= s->img_buffer_end; -} -#endif - -#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) -// nothing -#else -static void stbi__skip(stbi__context *s, int n) -{ - if (n == 0) return; // already there! - if (n < 0) { - s->img_buffer = s->img_buffer_end; - return; - } - if (s->io.read) { - int blen = (int) (s->img_buffer_end - s->img_buffer); - if (blen < n) { - s->img_buffer = s->img_buffer_end; - (s->io.skip)(s->io_user_data, n - blen); - return; - } - } - s->img_buffer += n; -} -#endif - -#if defined(STBI_NO_PNG) && defined(STBI_NO_TGA) && defined(STBI_NO_HDR) && defined(STBI_NO_PNM) -// nothing -#else -static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n) -{ - if (s->io.read) { - int blen = (int) (s->img_buffer_end - s->img_buffer); - if (blen < n) { - int res, count; - - memcpy(buffer, s->img_buffer, blen); - - count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen); - res = (count == (n-blen)); - s->img_buffer = s->img_buffer_end; - return res; - } - } - - if (s->img_buffer+n <= s->img_buffer_end) { - memcpy(buffer, s->img_buffer, n); - s->img_buffer += n; - return 1; - } else - return 0; -} -#endif - -#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_PSD) && defined(STBI_NO_PIC) -// nothing -#else -static int stbi__get16be(stbi__context *s) -{ - int z = stbi__get8(s); - return (z << 8) + stbi__get8(s); -} -#endif - -#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD) && defined(STBI_NO_PIC) -// nothing -#else -static stbi__uint32 stbi__get32be(stbi__context *s) -{ - stbi__uint32 z = stbi__get16be(s); - return (z << 16) + stbi__get16be(s); -} -#endif - -#if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) -// nothing -#else -static int stbi__get16le(stbi__context *s) -{ - int z = stbi__get8(s); - return z + (stbi__get8(s) << 8); -} -#endif - -#ifndef STBI_NO_BMP -static stbi__uint32 stbi__get32le(stbi__context *s) -{ - stbi__uint32 z = stbi__get16le(s); - z += (stbi__uint32)stbi__get16le(s) << 16; - return z; -} -#endif - -#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings - -#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) -// nothing -#else -////////////////////////////////////////////////////////////////////////////// -// -// generic converter from built-in img_n to req_comp -// individual types do this automatically as much as possible (e.g. jpeg -// does all cases internally since it needs to colorspace convert anyway, -// and it never has alpha, so very few cases ). png can automatically -// interleave an alpha=255 channel, but falls back to this for other cases -// -// assume data buffer is malloced, so malloc a new one and free that one -// only failure mode is malloc failing - -static stbi_uc stbi__compute_y(int r, int g, int b) -{ - return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8); -} -#endif - -#if defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) -// nothing -#else -static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y) -{ - int i,j; - unsigned char *good; - - if (req_comp == img_n) return data; - STBI_ASSERT(req_comp >= 1 && req_comp <= 4); - - good = (unsigned char *) stbi__malloc_mad3(req_comp, x, y, 0); - if (good == NULL) { - STBI_FREE(data); - return stbi__errpuc("outofmem", "Out of memory"); - } - - for (j=0; j < (int) y; ++j) { - unsigned char *src = data + j * x * img_n ; - unsigned char *dest = good + j * x * req_comp; - - #define STBI__COMBO(a,b) ((a)*8+(b)) - #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) - // convert source image with img_n components to one with req_comp components; - // avoid switch per pixel, so use switch per scanline and massive macros - switch (STBI__COMBO(img_n, req_comp)) { - STBI__CASE(1,2) { dest[0]=src[0]; dest[1]=255; } break; - STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; - STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=255; } break; - STBI__CASE(2,1) { dest[0]=src[0]; } break; - STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; - STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=src[1]; } break; - STBI__CASE(3,4) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2];dest[3]=255; } break; - STBI__CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; - STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); dest[1] = 255; } break; - STBI__CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; - STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); dest[1] = src[3]; } break; - STBI__CASE(4,3) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2]; } break; - default: STBI_ASSERT(0); STBI_FREE(data); STBI_FREE(good); return stbi__errpuc("unsupported", "Unsupported format conversion"); - } - #undef STBI__CASE - } - - STBI_FREE(data); - return good; -} -#endif - -#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD) -// nothing -#else -static stbi__uint16 stbi__compute_y_16(int r, int g, int b) -{ - return (stbi__uint16) (((r*77) + (g*150) + (29*b)) >> 8); -} -#endif - -#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD) -// nothing -#else -static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int req_comp, unsigned int x, unsigned int y) -{ - int i,j; - stbi__uint16 *good; - - if (req_comp == img_n) return data; - STBI_ASSERT(req_comp >= 1 && req_comp <= 4); - - good = (stbi__uint16 *) stbi__malloc(req_comp * x * y * 2); - if (good == NULL) { - STBI_FREE(data); - return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory"); - } - - for (j=0; j < (int) y; ++j) { - stbi__uint16 *src = data + j * x * img_n ; - stbi__uint16 *dest = good + j * x * req_comp; - - #define STBI__COMBO(a,b) ((a)*8+(b)) - #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) - // convert source image with img_n components to one with req_comp components; - // avoid switch per pixel, so use switch per scanline and massive macros - switch (STBI__COMBO(img_n, req_comp)) { - STBI__CASE(1,2) { dest[0]=src[0]; dest[1]=0xffff; } break; - STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; - STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=0xffff; } break; - STBI__CASE(2,1) { dest[0]=src[0]; } break; - STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; - STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=src[1]; } break; - STBI__CASE(3,4) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2];dest[3]=0xffff; } break; - STBI__CASE(3,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break; - STBI__CASE(3,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); dest[1] = 0xffff; } break; - STBI__CASE(4,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break; - STBI__CASE(4,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); dest[1] = src[3]; } break; - STBI__CASE(4,3) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2]; } break; - default: STBI_ASSERT(0); STBI_FREE(data); STBI_FREE(good); return (stbi__uint16*) stbi__errpuc("unsupported", "Unsupported format conversion"); - } - #undef STBI__CASE - } - - STBI_FREE(data); - return good; -} -#endif - -#ifndef STBI_NO_LINEAR -static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) -{ - int i,k,n; - float *output; - if (!data) return NULL; - output = (float *) stbi__malloc_mad4(x, y, comp, sizeof(float), 0); - if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); } - // compute number of non-alpha components - if (comp & 1) n = comp; else n = comp-1; - for (i=0; i < x*y; ++i) { - for (k=0; k < n; ++k) { - output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale); - } - } - if (n < comp) { - for (i=0; i < x*y; ++i) { - output[i*comp + n] = data[i*comp + n]/255.0f; - } - } - STBI_FREE(data); - return output; -} -#endif - -#ifndef STBI_NO_HDR -#define stbi__float2int(x) ((int) (x)) -static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp) -{ - int i,k,n; - stbi_uc *output; - if (!data) return NULL; - output = (stbi_uc *) stbi__malloc_mad3(x, y, comp, 0); - if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); } - // compute number of non-alpha components - if (comp & 1) n = comp; else n = comp-1; - for (i=0; i < x*y; ++i) { - for (k=0; k < n; ++k) { - float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f; - if (z < 0) z = 0; - if (z > 255) z = 255; - output[i*comp + k] = (stbi_uc) stbi__float2int(z); - } - if (k < comp) { - float z = data[i*comp+k] * 255 + 0.5f; - if (z < 0) z = 0; - if (z > 255) z = 255; - output[i*comp + k] = (stbi_uc) stbi__float2int(z); - } - } - STBI_FREE(data); - return output; -} -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// "baseline" JPEG/JFIF decoder -// -// simple implementation -// - doesn't support delayed output of y-dimension -// - simple interface (only one output format: 8-bit interleaved RGB) -// - doesn't try to recover corrupt jpegs -// - doesn't allow partial loading, loading multiple at once -// - still fast on x86 (copying globals into locals doesn't help x86) -// - allocates lots of intermediate memory (full size of all components) -// - non-interleaved case requires this anyway -// - allows good upsampling (see next) -// high-quality -// - upsampled channels are bilinearly interpolated, even across blocks -// - quality integer IDCT derived from IJG's 'slow' -// performance -// - fast huffman; reasonable integer IDCT -// - some SIMD kernels for common paths on targets with SSE2/NEON -// - uses a lot of intermediate memory, could cache poorly - -#ifndef STBI_NO_JPEG - -// huffman decoding acceleration -#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache - -typedef struct -{ - stbi_uc fast[1 << FAST_BITS]; - // weirdly, repacking this into AoS is a 10% speed loss, instead of a win - stbi__uint16 code[256]; - stbi_uc values[256]; - stbi_uc size[257]; - unsigned int maxcode[18]; - int delta[17]; // old 'firstsymbol' - old 'firstcode' -} stbi__huffman; - -typedef struct -{ - stbi__context *s; - stbi__huffman huff_dc[4]; - stbi__huffman huff_ac[4]; - stbi__uint16 dequant[4][64]; - stbi__int16 fast_ac[4][1 << FAST_BITS]; - -// sizes for components, interleaved MCUs - int img_h_max, img_v_max; - int img_mcu_x, img_mcu_y; - int img_mcu_w, img_mcu_h; - -// definition of jpeg image component - struct - { - int id; - int h,v; - int tq; - int hd,ha; - int dc_pred; - - int x,y,w2,h2; - stbi_uc *data; - void *raw_data, *raw_coeff; - stbi_uc *linebuf; - short *coeff; // progressive only - int coeff_w, coeff_h; // number of 8x8 coefficient blocks - } img_comp[4]; - - stbi__uint32 code_buffer; // jpeg entropy-coded buffer - int code_bits; // number of valid bits - unsigned char marker; // marker seen while filling entropy buffer - int nomore; // flag if we saw a marker so must stop - - int progressive; - int spec_start; - int spec_end; - int succ_high; - int succ_low; - int eob_run; - int jfif; - int app14_color_transform; // Adobe APP14 tag - int rgb; - - int scan_n, order[4]; - int restart_interval, todo; - -// kernels - void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]); - void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step); - stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs); -} stbi__jpeg; - -static int stbi__build_huffman(stbi__huffman *h, int *count) -{ - int i,j,k=0; - unsigned int code; - // build size list for each symbol (from JPEG spec) - for (i=0; i < 16; ++i) { - for (j=0; j < count[i]; ++j) { - h->size[k++] = (stbi_uc) (i+1); - if(k >= 257) return stbi__err("bad size list","Corrupt JPEG"); - } - } - h->size[k] = 0; - - // compute actual symbols (from jpeg spec) - code = 0; - k = 0; - for(j=1; j <= 16; ++j) { - // compute delta to add to code to compute symbol id - h->delta[j] = k - code; - if (h->size[k] == j) { - while (h->size[k] == j) - h->code[k++] = (stbi__uint16) (code++); - if (code-1 >= (1u << j)) return stbi__err("bad code lengths","Corrupt JPEG"); - } - // compute largest code + 1 for this size, preshifted as needed later - h->maxcode[j] = code << (16-j); - code <<= 1; - } - h->maxcode[j] = 0xffffffff; - - // build non-spec acceleration table; 255 is flag for not-accelerated - memset(h->fast, 255, 1 << FAST_BITS); - for (i=0; i < k; ++i) { - int s = h->size[i]; - if (s <= FAST_BITS) { - int c = h->code[i] << (FAST_BITS-s); - int m = 1 << (FAST_BITS-s); - for (j=0; j < m; ++j) { - h->fast[c+j] = (stbi_uc) i; - } - } - } - return 1; -} - -// build a table that decodes both magnitude and value of small ACs in -// one go. -static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h) -{ - int i; - for (i=0; i < (1 << FAST_BITS); ++i) { - stbi_uc fast = h->fast[i]; - fast_ac[i] = 0; - if (fast < 255) { - int rs = h->values[fast]; - int run = (rs >> 4) & 15; - int magbits = rs & 15; - int len = h->size[fast]; - - if (magbits && len + magbits <= FAST_BITS) { - // magnitude code followed by receive_extend code - int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits); - int m = 1 << (magbits - 1); - if (k < m) k += (~0U << magbits) + 1; - // if the result is small enough, we can fit it in fast_ac table - if (k >= -128 && k <= 127) - fast_ac[i] = (stbi__int16) ((k * 256) + (run * 16) + (len + magbits)); - } - } - } -} - -static void stbi__grow_buffer_unsafe(stbi__jpeg *j) -{ - do { - unsigned int b = j->nomore ? 0 : stbi__get8(j->s); - if (b == 0xff) { - int c = stbi__get8(j->s); - while (c == 0xff) c = stbi__get8(j->s); // consume fill bytes - if (c != 0) { - j->marker = (unsigned char) c; - j->nomore = 1; - return; - } - } - j->code_buffer |= b << (24 - j->code_bits); - j->code_bits += 8; - } while (j->code_bits <= 24); -} - -// (1 << n) - 1 -static const stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535}; - -// decode a jpeg huffman value from the bitstream -stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) -{ - unsigned int temp; - int c,k; - - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - - // look at the top FAST_BITS and determine what symbol ID it is, - // if the code is <= FAST_BITS - c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); - k = h->fast[c]; - if (k < 255) { - int s = h->size[k]; - if (s > j->code_bits) - return -1; - j->code_buffer <<= s; - j->code_bits -= s; - return h->values[k]; - } - - // naive test is to shift the code_buffer down so k bits are - // valid, then test against maxcode. To speed this up, we've - // preshifted maxcode left so that it has (16-k) 0s at the - // end; in other words, regardless of the number of bits, it - // wants to be compared against something shifted to have 16; - // that way we don't need to shift inside the loop. - temp = j->code_buffer >> 16; - for (k=FAST_BITS+1 ; ; ++k) - if (temp < h->maxcode[k]) - break; - if (k == 17) { - // error! code not found - j->code_bits -= 16; - return -1; - } - - if (k > j->code_bits) - return -1; - - // convert the huffman code to the symbol id - c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k]; - if(c < 0 || c >= 256) // symbol id out of bounds! - return -1; - STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]); - - // convert the id to a symbol - j->code_bits -= k; - j->code_buffer <<= k; - return h->values[c]; -} - -// bias[n] = (-1<code_bits < n) stbi__grow_buffer_unsafe(j); - if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing - - sgn = j->code_buffer >> 31; // sign bit always in MSB; 0 if MSB clear (positive), 1 if MSB set (negative) - k = stbi_lrot(j->code_buffer, n); - j->code_buffer = k & ~stbi__bmask[n]; - k &= stbi__bmask[n]; - j->code_bits -= n; - return k + (stbi__jbias[n] & (sgn - 1)); -} - -// get some unsigned bits -stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n) -{ - unsigned int k; - if (j->code_bits < n) stbi__grow_buffer_unsafe(j); - if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing - k = stbi_lrot(j->code_buffer, n); - j->code_buffer = k & ~stbi__bmask[n]; - k &= stbi__bmask[n]; - j->code_bits -= n; - return k; -} - -stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j) -{ - unsigned int k; - if (j->code_bits < 1) stbi__grow_buffer_unsafe(j); - if (j->code_bits < 1) return 0; // ran out of bits from stream, return 0s intead of continuing - k = j->code_buffer; - j->code_buffer <<= 1; - --j->code_bits; - return k & 0x80000000; -} - -// given a value that's at position X in the zigzag stream, -// where does it appear in the 8x8 matrix coded as row-major? -static const stbi_uc stbi__jpeg_dezigzag[64+15] = -{ - 0, 1, 8, 16, 9, 2, 3, 10, - 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, - 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, - 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, - 53, 60, 61, 54, 47, 55, 62, 63, - // let corrupt input sample past end - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63 -}; - -// decode one 64-entry block-- -static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi__uint16 *dequant) -{ - int diff,dc,k; - int t; - - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - t = stbi__jpeg_huff_decode(j, hdc); - if (t < 0 || t > 15) return stbi__err("bad huffman code","Corrupt JPEG"); - - // 0 all the ac values now so we can do it 32-bits at a time - memset(data,0,64*sizeof(data[0])); - - diff = t ? stbi__extend_receive(j, t) : 0; - if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta","Corrupt JPEG"); - dc = j->img_comp[b].dc_pred + diff; - j->img_comp[b].dc_pred = dc; - if (!stbi__mul2shorts_valid(dc, dequant[0])) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); - data[0] = (short) (dc * dequant[0]); - - // decode AC components, see JPEG spec - k = 1; - do { - unsigned int zig; - int c,r,s; - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); - r = fac[c]; - if (r) { // fast-AC path - k += (r >> 4) & 15; // run - s = r & 15; // combined length - if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available"); - j->code_buffer <<= s; - j->code_bits -= s; - // decode into unzigzag'd location - zig = stbi__jpeg_dezigzag[k++]; - data[zig] = (short) ((r >> 8) * dequant[zig]); - } else { - int rs = stbi__jpeg_huff_decode(j, hac); - if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); - s = rs & 15; - r = rs >> 4; - if (s == 0) { - if (rs != 0xf0) break; // end block - k += 16; - } else { - k += r; - // decode into unzigzag'd location - zig = stbi__jpeg_dezigzag[k++]; - data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]); - } - } - } while (k < 64); - return 1; -} - -static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b) -{ - int diff,dc; - int t; - if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); - - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - - if (j->succ_high == 0) { - // first scan for DC coefficient, must be first - memset(data,0,64*sizeof(data[0])); // 0 all the ac values now - t = stbi__jpeg_huff_decode(j, hdc); - if (t < 0 || t > 15) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); - diff = t ? stbi__extend_receive(j, t) : 0; - - if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta", "Corrupt JPEG"); - dc = j->img_comp[b].dc_pred + diff; - j->img_comp[b].dc_pred = dc; - if (!stbi__mul2shorts_valid(dc, 1 << j->succ_low)) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); - data[0] = (short) (dc * (1 << j->succ_low)); - } else { - // refinement scan for DC coefficient - if (stbi__jpeg_get_bit(j)) - data[0] += (short) (1 << j->succ_low); - } - return 1; -} - -// @OPTIMIZE: store non-zigzagged during the decode passes, -// and only de-zigzag when dequantizing -static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac) -{ - int k; - if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); - - if (j->succ_high == 0) { - int shift = j->succ_low; - - if (j->eob_run) { - --j->eob_run; - return 1; - } - - k = j->spec_start; - do { - unsigned int zig; - int c,r,s; - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1); - r = fac[c]; - if (r) { // fast-AC path - k += (r >> 4) & 15; // run - s = r & 15; // combined length - if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available"); - j->code_buffer <<= s; - j->code_bits -= s; - zig = stbi__jpeg_dezigzag[k++]; - data[zig] = (short) ((r >> 8) * (1 << shift)); - } else { - int rs = stbi__jpeg_huff_decode(j, hac); - if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); - s = rs & 15; - r = rs >> 4; - if (s == 0) { - if (r < 15) { - j->eob_run = (1 << r); - if (r) - j->eob_run += stbi__jpeg_get_bits(j, r); - --j->eob_run; - break; - } - k += 16; - } else { - k += r; - zig = stbi__jpeg_dezigzag[k++]; - data[zig] = (short) (stbi__extend_receive(j,s) * (1 << shift)); - } - } - } while (k <= j->spec_end); - } else { - // refinement scan for these AC coefficients - - short bit = (short) (1 << j->succ_low); - - if (j->eob_run) { - --j->eob_run; - for (k = j->spec_start; k <= j->spec_end; ++k) { - short *p = &data[stbi__jpeg_dezigzag[k]]; - if (*p != 0) - if (stbi__jpeg_get_bit(j)) - if ((*p & bit)==0) { - if (*p > 0) - *p += bit; - else - *p -= bit; - } - } - } else { - k = j->spec_start; - do { - int r,s; - int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh - if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); - s = rs & 15; - r = rs >> 4; - if (s == 0) { - if (r < 15) { - j->eob_run = (1 << r) - 1; - if (r) - j->eob_run += stbi__jpeg_get_bits(j, r); - r = 64; // force end of block - } else { - // r=15 s=0 should write 16 0s, so we just do - // a run of 15 0s and then write s (which is 0), - // so we don't have to do anything special here - } - } else { - if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG"); - // sign bit - if (stbi__jpeg_get_bit(j)) - s = bit; - else - s = -bit; - } - - // advance by r - while (k <= j->spec_end) { - short *p = &data[stbi__jpeg_dezigzag[k++]]; - if (*p != 0) { - if (stbi__jpeg_get_bit(j)) - if ((*p & bit)==0) { - if (*p > 0) - *p += bit; - else - *p -= bit; - } - } else { - if (r == 0) { - *p = (short) s; - break; - } - --r; - } - } - } while (k <= j->spec_end); - } - } - return 1; -} - -// take a -128..127 value and stbi__clamp it and convert to 0..255 -stbi_inline static stbi_uc stbi__clamp(int x) -{ - // trick to use a single test to catch both cases - if ((unsigned int) x > 255) { - if (x < 0) return 0; - if (x > 255) return 255; - } - return (stbi_uc) x; -} - -#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5))) -#define stbi__fsh(x) ((x) * 4096) - -// derived from jidctint -- DCT_ISLOW -#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \ - int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \ - p2 = s2; \ - p3 = s6; \ - p1 = (p2+p3) * stbi__f2f(0.5411961f); \ - t2 = p1 + p3*stbi__f2f(-1.847759065f); \ - t3 = p1 + p2*stbi__f2f( 0.765366865f); \ - p2 = s0; \ - p3 = s4; \ - t0 = stbi__fsh(p2+p3); \ - t1 = stbi__fsh(p2-p3); \ - x0 = t0+t3; \ - x3 = t0-t3; \ - x1 = t1+t2; \ - x2 = t1-t2; \ - t0 = s7; \ - t1 = s5; \ - t2 = s3; \ - t3 = s1; \ - p3 = t0+t2; \ - p4 = t1+t3; \ - p1 = t0+t3; \ - p2 = t1+t2; \ - p5 = (p3+p4)*stbi__f2f( 1.175875602f); \ - t0 = t0*stbi__f2f( 0.298631336f); \ - t1 = t1*stbi__f2f( 2.053119869f); \ - t2 = t2*stbi__f2f( 3.072711026f); \ - t3 = t3*stbi__f2f( 1.501321110f); \ - p1 = p5 + p1*stbi__f2f(-0.899976223f); \ - p2 = p5 + p2*stbi__f2f(-2.562915447f); \ - p3 = p3*stbi__f2f(-1.961570560f); \ - p4 = p4*stbi__f2f(-0.390180644f); \ - t3 += p1+p4; \ - t2 += p2+p3; \ - t1 += p2+p4; \ - t0 += p1+p3; - -static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64]) -{ - int i,val[64],*v=val; - stbi_uc *o; - short *d = data; - - // columns - for (i=0; i < 8; ++i,++d, ++v) { - // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing - if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0 - && d[40]==0 && d[48]==0 && d[56]==0) { - // no shortcut 0 seconds - // (1|2|3|4|5|6|7)==0 0 seconds - // all separate -0.047 seconds - // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds - int dcterm = d[0]*4; - v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm; - } else { - STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56]) - // constants scaled things up by 1<<12; let's bring them back - // down, but keep 2 extra bits of precision - x0 += 512; x1 += 512; x2 += 512; x3 += 512; - v[ 0] = (x0+t3) >> 10; - v[56] = (x0-t3) >> 10; - v[ 8] = (x1+t2) >> 10; - v[48] = (x1-t2) >> 10; - v[16] = (x2+t1) >> 10; - v[40] = (x2-t1) >> 10; - v[24] = (x3+t0) >> 10; - v[32] = (x3-t0) >> 10; - } - } - - for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) { - // no fast case since the first 1D IDCT spread components out - STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7]) - // constants scaled things up by 1<<12, plus we had 1<<2 from first - // loop, plus horizontal and vertical each scale by sqrt(8) so together - // we've got an extra 1<<3, so 1<<17 total we need to remove. - // so we want to round that, which means adding 0.5 * 1<<17, - // aka 65536. Also, we'll end up with -128 to 127 that we want - // to encode as 0..255 by adding 128, so we'll add that before the shift - x0 += 65536 + (128<<17); - x1 += 65536 + (128<<17); - x2 += 65536 + (128<<17); - x3 += 65536 + (128<<17); - // tried computing the shifts into temps, or'ing the temps to see - // if any were out of range, but that was slower - o[0] = stbi__clamp((x0+t3) >> 17); - o[7] = stbi__clamp((x0-t3) >> 17); - o[1] = stbi__clamp((x1+t2) >> 17); - o[6] = stbi__clamp((x1-t2) >> 17); - o[2] = stbi__clamp((x2+t1) >> 17); - o[5] = stbi__clamp((x2-t1) >> 17); - o[3] = stbi__clamp((x3+t0) >> 17); - o[4] = stbi__clamp((x3-t0) >> 17); - } -} - -#ifdef STBI_SSE2 -// sse2 integer IDCT. not the fastest possible implementation but it -// produces bit-identical results to the generic C version so it's -// fully "transparent". -static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) -{ - // This is constructed to match our regular (generic) integer IDCT exactly. - __m128i row0, row1, row2, row3, row4, row5, row6, row7; - __m128i tmp; - - // dot product constant: even elems=x, odd elems=y - #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y)) - - // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit) - // out(1) = c1[even]*x + c1[odd]*y - #define dct_rot(out0,out1, x,y,c0,c1) \ - __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \ - __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \ - __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \ - __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \ - __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \ - __m128i out1##_h = _mm_madd_epi16(c0##hi, c1) - - // out = in << 12 (in 16-bit, out 32-bit) - #define dct_widen(out, in) \ - __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \ - __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4) - - // wide add - #define dct_wadd(out, a, b) \ - __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \ - __m128i out##_h = _mm_add_epi32(a##_h, b##_h) - - // wide sub - #define dct_wsub(out, a, b) \ - __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \ - __m128i out##_h = _mm_sub_epi32(a##_h, b##_h) - - // butterfly a/b, add bias, then shift by "s" and pack - #define dct_bfly32o(out0, out1, a,b,bias,s) \ - { \ - __m128i abiased_l = _mm_add_epi32(a##_l, bias); \ - __m128i abiased_h = _mm_add_epi32(a##_h, bias); \ - dct_wadd(sum, abiased, b); \ - dct_wsub(dif, abiased, b); \ - out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \ - out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \ - } - - // 8-bit interleave step (for transposes) - #define dct_interleave8(a, b) \ - tmp = a; \ - a = _mm_unpacklo_epi8(a, b); \ - b = _mm_unpackhi_epi8(tmp, b) - - // 16-bit interleave step (for transposes) - #define dct_interleave16(a, b) \ - tmp = a; \ - a = _mm_unpacklo_epi16(a, b); \ - b = _mm_unpackhi_epi16(tmp, b) - - #define dct_pass(bias,shift) \ - { \ - /* even part */ \ - dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \ - __m128i sum04 = _mm_add_epi16(row0, row4); \ - __m128i dif04 = _mm_sub_epi16(row0, row4); \ - dct_widen(t0e, sum04); \ - dct_widen(t1e, dif04); \ - dct_wadd(x0, t0e, t3e); \ - dct_wsub(x3, t0e, t3e); \ - dct_wadd(x1, t1e, t2e); \ - dct_wsub(x2, t1e, t2e); \ - /* odd part */ \ - dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \ - dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \ - __m128i sum17 = _mm_add_epi16(row1, row7); \ - __m128i sum35 = _mm_add_epi16(row3, row5); \ - dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \ - dct_wadd(x4, y0o, y4o); \ - dct_wadd(x5, y1o, y5o); \ - dct_wadd(x6, y2o, y5o); \ - dct_wadd(x7, y3o, y4o); \ - dct_bfly32o(row0,row7, x0,x7,bias,shift); \ - dct_bfly32o(row1,row6, x1,x6,bias,shift); \ - dct_bfly32o(row2,row5, x2,x5,bias,shift); \ - dct_bfly32o(row3,row4, x3,x4,bias,shift); \ - } - - __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f)); - __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f)); - __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f)); - __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f)); - __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f)); - __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f)); - __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f)); - __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f)); - - // rounding biases in column/row passes, see stbi__idct_block for explanation. - __m128i bias_0 = _mm_set1_epi32(512); - __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17)); - - // load - row0 = _mm_load_si128((const __m128i *) (data + 0*8)); - row1 = _mm_load_si128((const __m128i *) (data + 1*8)); - row2 = _mm_load_si128((const __m128i *) (data + 2*8)); - row3 = _mm_load_si128((const __m128i *) (data + 3*8)); - row4 = _mm_load_si128((const __m128i *) (data + 4*8)); - row5 = _mm_load_si128((const __m128i *) (data + 5*8)); - row6 = _mm_load_si128((const __m128i *) (data + 6*8)); - row7 = _mm_load_si128((const __m128i *) (data + 7*8)); - - // column pass - dct_pass(bias_0, 10); - - { - // 16bit 8x8 transpose pass 1 - dct_interleave16(row0, row4); - dct_interleave16(row1, row5); - dct_interleave16(row2, row6); - dct_interleave16(row3, row7); - - // transpose pass 2 - dct_interleave16(row0, row2); - dct_interleave16(row1, row3); - dct_interleave16(row4, row6); - dct_interleave16(row5, row7); - - // transpose pass 3 - dct_interleave16(row0, row1); - dct_interleave16(row2, row3); - dct_interleave16(row4, row5); - dct_interleave16(row6, row7); - } - - // row pass - dct_pass(bias_1, 17); - - { - // pack - __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7 - __m128i p1 = _mm_packus_epi16(row2, row3); - __m128i p2 = _mm_packus_epi16(row4, row5); - __m128i p3 = _mm_packus_epi16(row6, row7); - - // 8bit 8x8 transpose pass 1 - dct_interleave8(p0, p2); // a0e0a1e1... - dct_interleave8(p1, p3); // c0g0c1g1... - - // transpose pass 2 - dct_interleave8(p0, p1); // a0c0e0g0... - dct_interleave8(p2, p3); // b0d0f0h0... - - // transpose pass 3 - dct_interleave8(p0, p2); // a0b0c0d0... - dct_interleave8(p1, p3); // a4b4c4d4... - - // store - _mm_storel_epi64((__m128i *) out, p0); out += out_stride; - _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride; - _mm_storel_epi64((__m128i *) out, p2); out += out_stride; - _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride; - _mm_storel_epi64((__m128i *) out, p1); out += out_stride; - _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride; - _mm_storel_epi64((__m128i *) out, p3); out += out_stride; - _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e)); - } - -#undef dct_const -#undef dct_rot -#undef dct_widen -#undef dct_wadd -#undef dct_wsub -#undef dct_bfly32o -#undef dct_interleave8 -#undef dct_interleave16 -#undef dct_pass -} - -#endif // STBI_SSE2 - -#ifdef STBI_NEON - -// NEON integer IDCT. should produce bit-identical -// results to the generic C version. -static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64]) -{ - int16x8_t row0, row1, row2, row3, row4, row5, row6, row7; - - int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f)); - int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f)); - int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f)); - int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f)); - int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f)); - int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f)); - int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f)); - int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f)); - int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f)); - int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f)); - int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f)); - int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f)); - -#define dct_long_mul(out, inq, coeff) \ - int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \ - int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff) - -#define dct_long_mac(out, acc, inq, coeff) \ - int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \ - int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff) - -#define dct_widen(out, inq) \ - int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \ - int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12) - -// wide add -#define dct_wadd(out, a, b) \ - int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \ - int32x4_t out##_h = vaddq_s32(a##_h, b##_h) - -// wide sub -#define dct_wsub(out, a, b) \ - int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \ - int32x4_t out##_h = vsubq_s32(a##_h, b##_h) - -// butterfly a/b, then shift using "shiftop" by "s" and pack -#define dct_bfly32o(out0,out1, a,b,shiftop,s) \ - { \ - dct_wadd(sum, a, b); \ - dct_wsub(dif, a, b); \ - out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \ - out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \ - } - -#define dct_pass(shiftop, shift) \ - { \ - /* even part */ \ - int16x8_t sum26 = vaddq_s16(row2, row6); \ - dct_long_mul(p1e, sum26, rot0_0); \ - dct_long_mac(t2e, p1e, row6, rot0_1); \ - dct_long_mac(t3e, p1e, row2, rot0_2); \ - int16x8_t sum04 = vaddq_s16(row0, row4); \ - int16x8_t dif04 = vsubq_s16(row0, row4); \ - dct_widen(t0e, sum04); \ - dct_widen(t1e, dif04); \ - dct_wadd(x0, t0e, t3e); \ - dct_wsub(x3, t0e, t3e); \ - dct_wadd(x1, t1e, t2e); \ - dct_wsub(x2, t1e, t2e); \ - /* odd part */ \ - int16x8_t sum15 = vaddq_s16(row1, row5); \ - int16x8_t sum17 = vaddq_s16(row1, row7); \ - int16x8_t sum35 = vaddq_s16(row3, row5); \ - int16x8_t sum37 = vaddq_s16(row3, row7); \ - int16x8_t sumodd = vaddq_s16(sum17, sum35); \ - dct_long_mul(p5o, sumodd, rot1_0); \ - dct_long_mac(p1o, p5o, sum17, rot1_1); \ - dct_long_mac(p2o, p5o, sum35, rot1_2); \ - dct_long_mul(p3o, sum37, rot2_0); \ - dct_long_mul(p4o, sum15, rot2_1); \ - dct_wadd(sump13o, p1o, p3o); \ - dct_wadd(sump24o, p2o, p4o); \ - dct_wadd(sump23o, p2o, p3o); \ - dct_wadd(sump14o, p1o, p4o); \ - dct_long_mac(x4, sump13o, row7, rot3_0); \ - dct_long_mac(x5, sump24o, row5, rot3_1); \ - dct_long_mac(x6, sump23o, row3, rot3_2); \ - dct_long_mac(x7, sump14o, row1, rot3_3); \ - dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \ - dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \ - dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \ - dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \ - } - - // load - row0 = vld1q_s16(data + 0*8); - row1 = vld1q_s16(data + 1*8); - row2 = vld1q_s16(data + 2*8); - row3 = vld1q_s16(data + 3*8); - row4 = vld1q_s16(data + 4*8); - row5 = vld1q_s16(data + 5*8); - row6 = vld1q_s16(data + 6*8); - row7 = vld1q_s16(data + 7*8); - - // add DC bias - row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0)); - - // column pass - dct_pass(vrshrn_n_s32, 10); - - // 16bit 8x8 transpose - { -// these three map to a single VTRN.16, VTRN.32, and VSWP, respectively. -// whether compilers actually get this is another story, sadly. -#define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; } -#define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); } -#define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); } - - // pass 1 - dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6 - dct_trn16(row2, row3); - dct_trn16(row4, row5); - dct_trn16(row6, row7); - - // pass 2 - dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4 - dct_trn32(row1, row3); - dct_trn32(row4, row6); - dct_trn32(row5, row7); - - // pass 3 - dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0 - dct_trn64(row1, row5); - dct_trn64(row2, row6); - dct_trn64(row3, row7); - -#undef dct_trn16 -#undef dct_trn32 -#undef dct_trn64 - } - - // row pass - // vrshrn_n_s32 only supports shifts up to 16, we need - // 17. so do a non-rounding shift of 16 first then follow - // up with a rounding shift by 1. - dct_pass(vshrn_n_s32, 16); - - { - // pack and round - uint8x8_t p0 = vqrshrun_n_s16(row0, 1); - uint8x8_t p1 = vqrshrun_n_s16(row1, 1); - uint8x8_t p2 = vqrshrun_n_s16(row2, 1); - uint8x8_t p3 = vqrshrun_n_s16(row3, 1); - uint8x8_t p4 = vqrshrun_n_s16(row4, 1); - uint8x8_t p5 = vqrshrun_n_s16(row5, 1); - uint8x8_t p6 = vqrshrun_n_s16(row6, 1); - uint8x8_t p7 = vqrshrun_n_s16(row7, 1); - - // again, these can translate into one instruction, but often don't. -#define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; } -#define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); } -#define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); } - - // sadly can't use interleaved stores here since we only write - // 8 bytes to each scan line! - - // 8x8 8-bit transpose pass 1 - dct_trn8_8(p0, p1); - dct_trn8_8(p2, p3); - dct_trn8_8(p4, p5); - dct_trn8_8(p6, p7); - - // pass 2 - dct_trn8_16(p0, p2); - dct_trn8_16(p1, p3); - dct_trn8_16(p4, p6); - dct_trn8_16(p5, p7); - - // pass 3 - dct_trn8_32(p0, p4); - dct_trn8_32(p1, p5); - dct_trn8_32(p2, p6); - dct_trn8_32(p3, p7); - - // store - vst1_u8(out, p0); out += out_stride; - vst1_u8(out, p1); out += out_stride; - vst1_u8(out, p2); out += out_stride; - vst1_u8(out, p3); out += out_stride; - vst1_u8(out, p4); out += out_stride; - vst1_u8(out, p5); out += out_stride; - vst1_u8(out, p6); out += out_stride; - vst1_u8(out, p7); - -#undef dct_trn8_8 -#undef dct_trn8_16 -#undef dct_trn8_32 - } - -#undef dct_long_mul -#undef dct_long_mac -#undef dct_widen -#undef dct_wadd -#undef dct_wsub -#undef dct_bfly32o -#undef dct_pass -} - -#endif // STBI_NEON - -#define STBI__MARKER_none 0xff -// if there's a pending marker from the entropy stream, return that -// otherwise, fetch from the stream and get a marker. if there's no -// marker, return 0xff, which is never a valid marker value -static stbi_uc stbi__get_marker(stbi__jpeg *j) -{ - stbi_uc x; - if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; } - x = stbi__get8(j->s); - if (x != 0xff) return STBI__MARKER_none; - while (x == 0xff) - x = stbi__get8(j->s); // consume repeated 0xff fill bytes - return x; -} - -// in each scan, we'll have scan_n components, and the order -// of the components is specified by order[] -#define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7) - -// after a restart interval, stbi__jpeg_reset the entropy decoder and -// the dc prediction -static void stbi__jpeg_reset(stbi__jpeg *j) -{ - j->code_bits = 0; - j->code_buffer = 0; - j->nomore = 0; - j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = j->img_comp[3].dc_pred = 0; - j->marker = STBI__MARKER_none; - j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff; - j->eob_run = 0; - // no more than 1<<31 MCUs if no restart_interal? that's plenty safe, - // since we don't even allow 1<<30 pixels -} - -static int stbi__parse_entropy_coded_data(stbi__jpeg *z) -{ - stbi__jpeg_reset(z); - if (!z->progressive) { - if (z->scan_n == 1) { - int i,j; - STBI_SIMD_ALIGN(short, data[64]); - int n = z->order[0]; - // non-interleaved data, we just need to process one block at a time, - // in trivial scanline order - // number of blocks to do just depends on how many actual "pixels" this - // component has, independent of interleaved MCU blocking and such - int w = (z->img_comp[n].x+7) >> 3; - int h = (z->img_comp[n].y+7) >> 3; - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) { - int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; - z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data); - // every data block is an MCU, so countdown the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); - // if it's NOT a restart, then just bail, so we get corrupt data - // rather than no data - if (!STBI__RESTART(z->marker)) return 1; - stbi__jpeg_reset(z); - } - } - } - return 1; - } else { // interleaved - int i,j,k,x,y; - STBI_SIMD_ALIGN(short, data[64]); - for (j=0; j < z->img_mcu_y; ++j) { - for (i=0; i < z->img_mcu_x; ++i) { - // scan an interleaved mcu... process scan_n components in order - for (k=0; k < z->scan_n; ++k) { - int n = z->order[k]; - // scan out an mcu's worth of this component; that's just determined - // by the basic H and V specified for the component - for (y=0; y < z->img_comp[n].v; ++y) { - for (x=0; x < z->img_comp[n].h; ++x) { - int x2 = (i*z->img_comp[n].h + x)*8; - int y2 = (j*z->img_comp[n].v + y)*8; - int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0; - z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data); - } - } - } - // after all interleaved components, that's an interleaved MCU, - // so now count down the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); - if (!STBI__RESTART(z->marker)) return 1; - stbi__jpeg_reset(z); - } - } - } - return 1; - } - } else { - if (z->scan_n == 1) { - int i,j; - int n = z->order[0]; - // non-interleaved data, we just need to process one block at a time, - // in trivial scanline order - // number of blocks to do just depends on how many actual "pixels" this - // component has, independent of interleaved MCU blocking and such - int w = (z->img_comp[n].x+7) >> 3; - int h = (z->img_comp[n].y+7) >> 3; - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) { - short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); - if (z->spec_start == 0) { - if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) - return 0; - } else { - int ha = z->img_comp[n].ha; - if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha])) - return 0; - } - // every data block is an MCU, so countdown the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); - if (!STBI__RESTART(z->marker)) return 1; - stbi__jpeg_reset(z); - } - } - } - return 1; - } else { // interleaved - int i,j,k,x,y; - for (j=0; j < z->img_mcu_y; ++j) { - for (i=0; i < z->img_mcu_x; ++i) { - // scan an interleaved mcu... process scan_n components in order - for (k=0; k < z->scan_n; ++k) { - int n = z->order[k]; - // scan out an mcu's worth of this component; that's just determined - // by the basic H and V specified for the component - for (y=0; y < z->img_comp[n].v; ++y) { - for (x=0; x < z->img_comp[n].h; ++x) { - int x2 = (i*z->img_comp[n].h + x); - int y2 = (j*z->img_comp[n].v + y); - short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w); - if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n)) - return 0; - } - } - } - // after all interleaved components, that's an interleaved MCU, - // so now count down the restart interval - if (--z->todo <= 0) { - if (z->code_bits < 24) stbi__grow_buffer_unsafe(z); - if (!STBI__RESTART(z->marker)) return 1; - stbi__jpeg_reset(z); - } - } - } - return 1; - } - } -} - -static void stbi__jpeg_dequantize(short *data, stbi__uint16 *dequant) -{ - int i; - for (i=0; i < 64; ++i) - data[i] *= dequant[i]; -} - -static void stbi__jpeg_finish(stbi__jpeg *z) -{ - if (z->progressive) { - // dequantize and idct the data - int i,j,n; - for (n=0; n < z->s->img_n; ++n) { - int w = (z->img_comp[n].x+7) >> 3; - int h = (z->img_comp[n].y+7) >> 3; - for (j=0; j < h; ++j) { - for (i=0; i < w; ++i) { - short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w); - stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]); - z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data); - } - } - } - } -} - -static int stbi__process_marker(stbi__jpeg *z, int m) -{ - int L; - switch (m) { - case STBI__MARKER_none: // no marker found - return stbi__err("expected marker","Corrupt JPEG"); - - case 0xDD: // DRI - specify restart interval - if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG"); - z->restart_interval = stbi__get16be(z->s); - return 1; - - case 0xDB: // DQT - define quantization table - L = stbi__get16be(z->s)-2; - while (L > 0) { - int q = stbi__get8(z->s); - int p = q >> 4, sixteen = (p != 0); - int t = q & 15,i; - if (p != 0 && p != 1) return stbi__err("bad DQT type","Corrupt JPEG"); - if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG"); - - for (i=0; i < 64; ++i) - z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16)(sixteen ? stbi__get16be(z->s) : stbi__get8(z->s)); - L -= (sixteen ? 129 : 65); - } - return L==0; - - case 0xC4: // DHT - define huffman table - L = stbi__get16be(z->s)-2; - while (L > 0) { - stbi_uc *v; - int sizes[16],i,n=0; - int q = stbi__get8(z->s); - int tc = q >> 4; - int th = q & 15; - if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG"); - for (i=0; i < 16; ++i) { - sizes[i] = stbi__get8(z->s); - n += sizes[i]; - } - if(n > 256) return stbi__err("bad DHT header","Corrupt JPEG"); // Loop over i < n would write past end of values! - L -= 17; - if (tc == 0) { - if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0; - v = z->huff_dc[th].values; - } else { - if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0; - v = z->huff_ac[th].values; - } - for (i=0; i < n; ++i) - v[i] = stbi__get8(z->s); - if (tc != 0) - stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th); - L -= n; - } - return L==0; - } - - // check for comment block or APP blocks - if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) { - L = stbi__get16be(z->s); - if (L < 2) { - if (m == 0xFE) - return stbi__err("bad COM len","Corrupt JPEG"); - else - return stbi__err("bad APP len","Corrupt JPEG"); - } - L -= 2; - - if (m == 0xE0 && L >= 5) { // JFIF APP0 segment - static const unsigned char tag[5] = {'J','F','I','F','\0'}; - int ok = 1; - int i; - for (i=0; i < 5; ++i) - if (stbi__get8(z->s) != tag[i]) - ok = 0; - L -= 5; - if (ok) - z->jfif = 1; - } else if (m == 0xEE && L >= 12) { // Adobe APP14 segment - static const unsigned char tag[6] = {'A','d','o','b','e','\0'}; - int ok = 1; - int i; - for (i=0; i < 6; ++i) - if (stbi__get8(z->s) != tag[i]) - ok = 0; - L -= 6; - if (ok) { - stbi__get8(z->s); // version - stbi__get16be(z->s); // flags0 - stbi__get16be(z->s); // flags1 - z->app14_color_transform = stbi__get8(z->s); // color transform - L -= 6; - } - } - - stbi__skip(z->s, L); - return 1; - } - - return stbi__err("unknown marker","Corrupt JPEG"); -} - -// after we see SOS -static int stbi__process_scan_header(stbi__jpeg *z) -{ - int i; - int Ls = stbi__get16be(z->s); - z->scan_n = stbi__get8(z->s); - if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG"); - if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG"); - for (i=0; i < z->scan_n; ++i) { - int id = stbi__get8(z->s), which; - int q = stbi__get8(z->s); - for (which = 0; which < z->s->img_n; ++which) - if (z->img_comp[which].id == id) - break; - if (which == z->s->img_n) return 0; // no match - z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG"); - z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG"); - z->order[i] = which; - } - - { - int aa; - z->spec_start = stbi__get8(z->s); - z->spec_end = stbi__get8(z->s); // should be 63, but might be 0 - aa = stbi__get8(z->s); - z->succ_high = (aa >> 4); - z->succ_low = (aa & 15); - if (z->progressive) { - if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13) - return stbi__err("bad SOS", "Corrupt JPEG"); - } else { - if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG"); - if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG"); - z->spec_end = 63; - } - } - - return 1; -} - -static int stbi__free_jpeg_components(stbi__jpeg *z, int ncomp, int why) -{ - int i; - for (i=0; i < ncomp; ++i) { - if (z->img_comp[i].raw_data) { - STBI_FREE(z->img_comp[i].raw_data); - z->img_comp[i].raw_data = NULL; - z->img_comp[i].data = NULL; - } - if (z->img_comp[i].raw_coeff) { - STBI_FREE(z->img_comp[i].raw_coeff); - z->img_comp[i].raw_coeff = 0; - z->img_comp[i].coeff = 0; - } - if (z->img_comp[i].linebuf) { - STBI_FREE(z->img_comp[i].linebuf); - z->img_comp[i].linebuf = NULL; - } - } - return why; -} - -static int stbi__process_frame_header(stbi__jpeg *z, int scan) -{ - stbi__context *s = z->s; - int Lf,p,i,q, h_max=1,v_max=1,c; - Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG - p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline - s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG - s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires - if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); - if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); - c = stbi__get8(s); - if (c != 3 && c != 1 && c != 4) return stbi__err("bad component count","Corrupt JPEG"); - s->img_n = c; - for (i=0; i < c; ++i) { - z->img_comp[i].data = NULL; - z->img_comp[i].linebuf = NULL; - } - - if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG"); - - z->rgb = 0; - for (i=0; i < s->img_n; ++i) { - static const unsigned char rgb[3] = { 'R', 'G', 'B' }; - z->img_comp[i].id = stbi__get8(s); - if (s->img_n == 3 && z->img_comp[i].id == rgb[i]) - ++z->rgb; - q = stbi__get8(s); - z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG"); - z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG"); - z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG"); - } - - if (scan != STBI__SCAN_load) return 1; - - if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0)) return stbi__err("too large", "Image too large to decode"); - - for (i=0; i < s->img_n; ++i) { - if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h; - if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v; - } - - // check that plane subsampling factors are integer ratios; our resamplers can't deal with fractional ratios - // and I've never seen a non-corrupted JPEG file actually use them - for (i=0; i < s->img_n; ++i) { - if (h_max % z->img_comp[i].h != 0) return stbi__err("bad H","Corrupt JPEG"); - if (v_max % z->img_comp[i].v != 0) return stbi__err("bad V","Corrupt JPEG"); - } - - // compute interleaved mcu info - z->img_h_max = h_max; - z->img_v_max = v_max; - z->img_mcu_w = h_max * 8; - z->img_mcu_h = v_max * 8; - // these sizes can't be more than 17 bits - z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w; - z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h; - - for (i=0; i < s->img_n; ++i) { - // number of effective pixels (e.g. for non-interleaved MCU) - z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max; - z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max; - // to simplify generation, we'll allocate enough memory to decode - // the bogus oversized data from using interleaved MCUs and their - // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't - // discard the extra data until colorspace conversion - // - // img_mcu_x, img_mcu_y: <=17 bits; comp[i].h and .v are <=4 (checked earlier) - // so these muls can't overflow with 32-bit ints (which we require) - z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8; - z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8; - z->img_comp[i].coeff = 0; - z->img_comp[i].raw_coeff = 0; - z->img_comp[i].linebuf = NULL; - z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15); - if (z->img_comp[i].raw_data == NULL) - return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory")); - // align blocks for idct using mmx/sse - z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15); - if (z->progressive) { - // w2, h2 are multiples of 8 (see above) - z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8; - z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8; - z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15); - if (z->img_comp[i].raw_coeff == NULL) - return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory")); - z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15); - } - } - - return 1; -} - -// use comparisons since in some cases we handle more than one case (e.g. SOF) -#define stbi__DNL(x) ((x) == 0xdc) -#define stbi__SOI(x) ((x) == 0xd8) -#define stbi__EOI(x) ((x) == 0xd9) -#define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2) -#define stbi__SOS(x) ((x) == 0xda) - -#define stbi__SOF_progressive(x) ((x) == 0xc2) - -static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan) -{ - int m; - z->jfif = 0; - z->app14_color_transform = -1; // valid values are 0,1,2 - z->marker = STBI__MARKER_none; // initialize cached marker to empty - m = stbi__get_marker(z); - if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG"); - if (scan == STBI__SCAN_type) return 1; - m = stbi__get_marker(z); - while (!stbi__SOF(m)) { - if (!stbi__process_marker(z,m)) return 0; - m = stbi__get_marker(z); - while (m == STBI__MARKER_none) { - // some files have extra padding after their blocks, so ok, we'll scan - if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG"); - m = stbi__get_marker(z); - } - } - z->progressive = stbi__SOF_progressive(m); - if (!stbi__process_frame_header(z, scan)) return 0; - return 1; -} - -static int stbi__skip_jpeg_junk_at_end(stbi__jpeg *j) -{ - // some JPEGs have junk at end, skip over it but if we find what looks - // like a valid marker, resume there - while (!stbi__at_eof(j->s)) { - int x = stbi__get8(j->s); - while (x == 255) { // might be a marker - if (stbi__at_eof(j->s)) return STBI__MARKER_none; - x = stbi__get8(j->s); - if (x != 0x00 && x != 0xff) { - // not a stuffed zero or lead-in to another marker, looks - // like an actual marker, return it - return x; - } - // stuffed zero has x=0 now which ends the loop, meaning we go - // back to regular scan loop. - // repeated 0xff keeps trying to read the next byte of the marker. - } - } - return STBI__MARKER_none; -} - -// decode image to YCbCr format -static int stbi__decode_jpeg_image(stbi__jpeg *j) -{ - int m; - for (m = 0; m < 4; m++) { - j->img_comp[m].raw_data = NULL; - j->img_comp[m].raw_coeff = NULL; - } - j->restart_interval = 0; - if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0; - m = stbi__get_marker(j); - while (!stbi__EOI(m)) { - if (stbi__SOS(m)) { - if (!stbi__process_scan_header(j)) return 0; - if (!stbi__parse_entropy_coded_data(j)) return 0; - if (j->marker == STBI__MARKER_none ) { - j->marker = stbi__skip_jpeg_junk_at_end(j); - // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0 - } - m = stbi__get_marker(j); - if (STBI__RESTART(m)) - m = stbi__get_marker(j); - } else if (stbi__DNL(m)) { - int Ld = stbi__get16be(j->s); - stbi__uint32 NL = stbi__get16be(j->s); - if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG"); - if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG"); - m = stbi__get_marker(j); - } else { - if (!stbi__process_marker(j, m)) return 1; - m = stbi__get_marker(j); - } - } - if (j->progressive) - stbi__jpeg_finish(j); - return 1; -} - -// static jfif-centered resampling (across block boundaries) - -typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1, - int w, int hs); - -#define stbi__div4(x) ((stbi_uc) ((x) >> 2)) - -static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - STBI_NOTUSED(out); - STBI_NOTUSED(in_far); - STBI_NOTUSED(w); - STBI_NOTUSED(hs); - return in_near; -} - -static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // need to generate two samples vertically for every one in input - int i; - STBI_NOTUSED(hs); - for (i=0; i < w; ++i) - out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2); - return out; -} - -static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // need to generate two samples horizontally for every one in input - int i; - stbi_uc *input = in_near; - - if (w == 1) { - // if only one sample, can't do any interpolation - out[0] = out[1] = input[0]; - return out; - } - - out[0] = input[0]; - out[1] = stbi__div4(input[0]*3 + input[1] + 2); - for (i=1; i < w-1; ++i) { - int n = 3*input[i]+2; - out[i*2+0] = stbi__div4(n+input[i-1]); - out[i*2+1] = stbi__div4(n+input[i+1]); - } - out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2); - out[i*2+1] = input[w-1]; - - STBI_NOTUSED(in_far); - STBI_NOTUSED(hs); - - return out; -} - -#define stbi__div16(x) ((stbi_uc) ((x) >> 4)) - -static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // need to generate 2x2 samples for every one in input - int i,t0,t1; - if (w == 1) { - out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2); - return out; - } - - t1 = 3*in_near[0] + in_far[0]; - out[0] = stbi__div4(t1+2); - for (i=1; i < w; ++i) { - t0 = t1; - t1 = 3*in_near[i]+in_far[i]; - out[i*2-1] = stbi__div16(3*t0 + t1 + 8); - out[i*2 ] = stbi__div16(3*t1 + t0 + 8); - } - out[w*2-1] = stbi__div4(t1+2); - - STBI_NOTUSED(hs); - - return out; -} - -#if defined(STBI_SSE2) || defined(STBI_NEON) -static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // need to generate 2x2 samples for every one in input - int i=0,t0,t1; - - if (w == 1) { - out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2); - return out; - } - - t1 = 3*in_near[0] + in_far[0]; - // process groups of 8 pixels for as long as we can. - // note we can't handle the last pixel in a row in this loop - // because we need to handle the filter boundary conditions. - for (; i < ((w-1) & ~7); i += 8) { -#if defined(STBI_SSE2) - // load and perform the vertical filtering pass - // this uses 3*x + y = 4*x + (y - x) - __m128i zero = _mm_setzero_si128(); - __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i)); - __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i)); - __m128i farw = _mm_unpacklo_epi8(farb, zero); - __m128i nearw = _mm_unpacklo_epi8(nearb, zero); - __m128i diff = _mm_sub_epi16(farw, nearw); - __m128i nears = _mm_slli_epi16(nearw, 2); - __m128i curr = _mm_add_epi16(nears, diff); // current row - - // horizontal filter works the same based on shifted vers of current - // row. "prev" is current row shifted right by 1 pixel; we need to - // insert the previous pixel value (from t1). - // "next" is current row shifted left by 1 pixel, with first pixel - // of next block of 8 pixels added in. - __m128i prv0 = _mm_slli_si128(curr, 2); - __m128i nxt0 = _mm_srli_si128(curr, 2); - __m128i prev = _mm_insert_epi16(prv0, t1, 0); - __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7); - - // horizontal filter, polyphase implementation since it's convenient: - // even pixels = 3*cur + prev = cur*4 + (prev - cur) - // odd pixels = 3*cur + next = cur*4 + (next - cur) - // note the shared term. - __m128i bias = _mm_set1_epi16(8); - __m128i curs = _mm_slli_epi16(curr, 2); - __m128i prvd = _mm_sub_epi16(prev, curr); - __m128i nxtd = _mm_sub_epi16(next, curr); - __m128i curb = _mm_add_epi16(curs, bias); - __m128i even = _mm_add_epi16(prvd, curb); - __m128i odd = _mm_add_epi16(nxtd, curb); - - // interleave even and odd pixels, then undo scaling. - __m128i int0 = _mm_unpacklo_epi16(even, odd); - __m128i int1 = _mm_unpackhi_epi16(even, odd); - __m128i de0 = _mm_srli_epi16(int0, 4); - __m128i de1 = _mm_srli_epi16(int1, 4); - - // pack and write output - __m128i outv = _mm_packus_epi16(de0, de1); - _mm_storeu_si128((__m128i *) (out + i*2), outv); -#elif defined(STBI_NEON) - // load and perform the vertical filtering pass - // this uses 3*x + y = 4*x + (y - x) - uint8x8_t farb = vld1_u8(in_far + i); - uint8x8_t nearb = vld1_u8(in_near + i); - int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb)); - int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2)); - int16x8_t curr = vaddq_s16(nears, diff); // current row - - // horizontal filter works the same based on shifted vers of current - // row. "prev" is current row shifted right by 1 pixel; we need to - // insert the previous pixel value (from t1). - // "next" is current row shifted left by 1 pixel, with first pixel - // of next block of 8 pixels added in. - int16x8_t prv0 = vextq_s16(curr, curr, 7); - int16x8_t nxt0 = vextq_s16(curr, curr, 1); - int16x8_t prev = vsetq_lane_s16(t1, prv0, 0); - int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7); - - // horizontal filter, polyphase implementation since it's convenient: - // even pixels = 3*cur + prev = cur*4 + (prev - cur) - // odd pixels = 3*cur + next = cur*4 + (next - cur) - // note the shared term. - int16x8_t curs = vshlq_n_s16(curr, 2); - int16x8_t prvd = vsubq_s16(prev, curr); - int16x8_t nxtd = vsubq_s16(next, curr); - int16x8_t even = vaddq_s16(curs, prvd); - int16x8_t odd = vaddq_s16(curs, nxtd); - - // undo scaling and round, then store with even/odd phases interleaved - uint8x8x2_t o; - o.val[0] = vqrshrun_n_s16(even, 4); - o.val[1] = vqrshrun_n_s16(odd, 4); - vst2_u8(out + i*2, o); -#endif - - // "previous" value for next iter - t1 = 3*in_near[i+7] + in_far[i+7]; - } - - t0 = t1; - t1 = 3*in_near[i] + in_far[i]; - out[i*2] = stbi__div16(3*t1 + t0 + 8); - - for (++i; i < w; ++i) { - t0 = t1; - t1 = 3*in_near[i]+in_far[i]; - out[i*2-1] = stbi__div16(3*t0 + t1 + 8); - out[i*2 ] = stbi__div16(3*t1 + t0 + 8); - } - out[w*2-1] = stbi__div4(t1+2); - - STBI_NOTUSED(hs); - - return out; -} -#endif - -static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs) -{ - // resample with nearest-neighbor - int i,j; - STBI_NOTUSED(in_far); - for (i=0; i < w; ++i) - for (j=0; j < hs; ++j) - out[i*hs+j] = in_near[i]; - return out; -} - -// this is a reduced-precision calculation of YCbCr-to-RGB introduced -// to make sure the code produces the same results in both SIMD and scalar -#define stbi__float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8) -static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step) -{ - int i; - for (i=0; i < count; ++i) { - int y_fixed = (y[i] << 20) + (1<<19); // rounding - int r,g,b; - int cr = pcr[i] - 128; - int cb = pcb[i] - 128; - r = y_fixed + cr* stbi__float2fixed(1.40200f); - g = y_fixed + (cr*-stbi__float2fixed(0.71414f)) + ((cb*-stbi__float2fixed(0.34414f)) & 0xffff0000); - b = y_fixed + cb* stbi__float2fixed(1.77200f); - r >>= 20; - g >>= 20; - b >>= 20; - if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } - if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } - if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } - out[0] = (stbi_uc)r; - out[1] = (stbi_uc)g; - out[2] = (stbi_uc)b; - out[3] = 255; - out += step; - } -} - -#if defined(STBI_SSE2) || defined(STBI_NEON) -static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step) -{ - int i = 0; - -#ifdef STBI_SSE2 - // step == 3 is pretty ugly on the final interleave, and i'm not convinced - // it's useful in practice (you wouldn't use it for textures, for example). - // so just accelerate step == 4 case. - if (step == 4) { - // this is a fairly straightforward implementation and not super-optimized. - __m128i signflip = _mm_set1_epi8(-0x80); - __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f)); - __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f)); - __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f)); - __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f)); - __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128); - __m128i xw = _mm_set1_epi16(255); // alpha channel - - for (; i+7 < count; i += 8) { - // load - __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i)); - __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i)); - __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i)); - __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128 - __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128 - - // unpack to short (and left-shift cr, cb by 8) - __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes); - __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased); - __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased); - - // color transform - __m128i yws = _mm_srli_epi16(yw, 4); - __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw); - __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw); - __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1); - __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1); - __m128i rws = _mm_add_epi16(cr0, yws); - __m128i gwt = _mm_add_epi16(cb0, yws); - __m128i bws = _mm_add_epi16(yws, cb1); - __m128i gws = _mm_add_epi16(gwt, cr1); - - // descale - __m128i rw = _mm_srai_epi16(rws, 4); - __m128i bw = _mm_srai_epi16(bws, 4); - __m128i gw = _mm_srai_epi16(gws, 4); - - // back to byte, set up for transpose - __m128i brb = _mm_packus_epi16(rw, bw); - __m128i gxb = _mm_packus_epi16(gw, xw); - - // transpose to interleave channels - __m128i t0 = _mm_unpacklo_epi8(brb, gxb); - __m128i t1 = _mm_unpackhi_epi8(brb, gxb); - __m128i o0 = _mm_unpacklo_epi16(t0, t1); - __m128i o1 = _mm_unpackhi_epi16(t0, t1); - - // store - _mm_storeu_si128((__m128i *) (out + 0), o0); - _mm_storeu_si128((__m128i *) (out + 16), o1); - out += 32; - } - } -#endif - -#ifdef STBI_NEON - // in this version, step=3 support would be easy to add. but is there demand? - if (step == 4) { - // this is a fairly straightforward implementation and not super-optimized. - uint8x8_t signflip = vdup_n_u8(0x80); - int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f)); - int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f)); - int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f)); - int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f)); - - for (; i+7 < count; i += 8) { - // load - uint8x8_t y_bytes = vld1_u8(y + i); - uint8x8_t cr_bytes = vld1_u8(pcr + i); - uint8x8_t cb_bytes = vld1_u8(pcb + i); - int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip)); - int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip)); - - // expand to s16 - int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4)); - int16x8_t crw = vshll_n_s8(cr_biased, 7); - int16x8_t cbw = vshll_n_s8(cb_biased, 7); - - // color transform - int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0); - int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0); - int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1); - int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1); - int16x8_t rws = vaddq_s16(yws, cr0); - int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1); - int16x8_t bws = vaddq_s16(yws, cb1); - - // undo scaling, round, convert to byte - uint8x8x4_t o; - o.val[0] = vqrshrun_n_s16(rws, 4); - o.val[1] = vqrshrun_n_s16(gws, 4); - o.val[2] = vqrshrun_n_s16(bws, 4); - o.val[3] = vdup_n_u8(255); - - // store, interleaving r/g/b/a - vst4_u8(out, o); - out += 8*4; - } - } -#endif - - for (; i < count; ++i) { - int y_fixed = (y[i] << 20) + (1<<19); // rounding - int r,g,b; - int cr = pcr[i] - 128; - int cb = pcb[i] - 128; - r = y_fixed + cr* stbi__float2fixed(1.40200f); - g = y_fixed + cr*-stbi__float2fixed(0.71414f) + ((cb*-stbi__float2fixed(0.34414f)) & 0xffff0000); - b = y_fixed + cb* stbi__float2fixed(1.77200f); - r >>= 20; - g >>= 20; - b >>= 20; - if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; } - if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; } - if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; } - out[0] = (stbi_uc)r; - out[1] = (stbi_uc)g; - out[2] = (stbi_uc)b; - out[3] = 255; - out += step; - } -} -#endif - -// set up the kernels -static void stbi__setup_jpeg(stbi__jpeg *j) -{ - j->idct_block_kernel = stbi__idct_block; - j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row; - j->resample_row_hv_2_kernel = stbi__resample_row_hv_2; - -#ifdef STBI_SSE2 - if (stbi__sse2_available()) { - j->idct_block_kernel = stbi__idct_simd; - j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd; - j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd; - } -#endif - -#ifdef STBI_NEON - j->idct_block_kernel = stbi__idct_simd; - j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd; - j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd; -#endif -} - -// clean up the temporary component buffers -static void stbi__cleanup_jpeg(stbi__jpeg *j) -{ - stbi__free_jpeg_components(j, j->s->img_n, 0); -} - -typedef struct -{ - resample_row_func resample; - stbi_uc *line0,*line1; - int hs,vs; // expansion factor in each axis - int w_lores; // horizontal pixels pre-expansion - int ystep; // how far through vertical expansion we are - int ypos; // which pre-expansion row we're on -} stbi__resample; - -// fast 0..255 * 0..255 => 0..255 rounded multiplication -static stbi_uc stbi__blinn_8x8(stbi_uc x, stbi_uc y) -{ - unsigned int t = x*y + 128; - return (stbi_uc) ((t + (t >>8)) >> 8); -} - -static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp) -{ - int n, decode_n, is_rgb; - z->s->img_n = 0; // make stbi__cleanup_jpeg safe - - // validate req_comp - if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); - - // load a jpeg image from whichever source, but leave in YCbCr format - if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; } - - // determine actual number of components to generate - n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 : 1; - - is_rgb = z->s->img_n == 3 && (z->rgb == 3 || (z->app14_color_transform == 0 && !z->jfif)); - - if (z->s->img_n == 3 && n < 3 && !is_rgb) - decode_n = 1; - else - decode_n = z->s->img_n; - - // nothing to do if no components requested; check this now to avoid - // accessing uninitialized coutput[0] later - if (decode_n <= 0) { stbi__cleanup_jpeg(z); return NULL; } - - // resample and color-convert - { - int k; - unsigned int i,j; - stbi_uc *output; - stbi_uc *coutput[4] = { NULL, NULL, NULL, NULL }; - - stbi__resample res_comp[4]; - - for (k=0; k < decode_n; ++k) { - stbi__resample *r = &res_comp[k]; - - // allocate line buffer big enough for upsampling off the edges - // with upsample factor of 4 - z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3); - if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } - - r->hs = z->img_h_max / z->img_comp[k].h; - r->vs = z->img_v_max / z->img_comp[k].v; - r->ystep = r->vs >> 1; - r->w_lores = (z->s->img_x + r->hs-1) / r->hs; - r->ypos = 0; - r->line0 = r->line1 = z->img_comp[k].data; - - if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1; - else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2; - else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2; - else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel; - else r->resample = stbi__resample_row_generic; - } - - // can't error after this so, this is safe - output = (stbi_uc *) stbi__malloc_mad3(n, z->s->img_x, z->s->img_y, 1); - if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); } - - // now go ahead and resample - for (j=0; j < z->s->img_y; ++j) { - stbi_uc *out = output + n * z->s->img_x * j; - for (k=0; k < decode_n; ++k) { - stbi__resample *r = &res_comp[k]; - int y_bot = r->ystep >= (r->vs >> 1); - coutput[k] = r->resample(z->img_comp[k].linebuf, - y_bot ? r->line1 : r->line0, - y_bot ? r->line0 : r->line1, - r->w_lores, r->hs); - if (++r->ystep >= r->vs) { - r->ystep = 0; - r->line0 = r->line1; - if (++r->ypos < z->img_comp[k].y) - r->line1 += z->img_comp[k].w2; - } - } - if (n >= 3) { - stbi_uc *y = coutput[0]; - if (z->s->img_n == 3) { - if (is_rgb) { - for (i=0; i < z->s->img_x; ++i) { - out[0] = y[i]; - out[1] = coutput[1][i]; - out[2] = coutput[2][i]; - out[3] = 255; - out += n; - } - } else { - z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n); - } - } else if (z->s->img_n == 4) { - if (z->app14_color_transform == 0) { // CMYK - for (i=0; i < z->s->img_x; ++i) { - stbi_uc m = coutput[3][i]; - out[0] = stbi__blinn_8x8(coutput[0][i], m); - out[1] = stbi__blinn_8x8(coutput[1][i], m); - out[2] = stbi__blinn_8x8(coutput[2][i], m); - out[3] = 255; - out += n; - } - } else if (z->app14_color_transform == 2) { // YCCK - z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n); - for (i=0; i < z->s->img_x; ++i) { - stbi_uc m = coutput[3][i]; - out[0] = stbi__blinn_8x8(255 - out[0], m); - out[1] = stbi__blinn_8x8(255 - out[1], m); - out[2] = stbi__blinn_8x8(255 - out[2], m); - out += n; - } - } else { // YCbCr + alpha? Ignore the fourth channel for now - z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n); - } - } else - for (i=0; i < z->s->img_x; ++i) { - out[0] = out[1] = out[2] = y[i]; - out[3] = 255; // not used if n==3 - out += n; - } - } else { - if (is_rgb) { - if (n == 1) - for (i=0; i < z->s->img_x; ++i) - *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]); - else { - for (i=0; i < z->s->img_x; ++i, out += 2) { - out[0] = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]); - out[1] = 255; - } - } - } else if (z->s->img_n == 4 && z->app14_color_transform == 0) { - for (i=0; i < z->s->img_x; ++i) { - stbi_uc m = coutput[3][i]; - stbi_uc r = stbi__blinn_8x8(coutput[0][i], m); - stbi_uc g = stbi__blinn_8x8(coutput[1][i], m); - stbi_uc b = stbi__blinn_8x8(coutput[2][i], m); - out[0] = stbi__compute_y(r, g, b); - out[1] = 255; - out += n; - } - } else if (z->s->img_n == 4 && z->app14_color_transform == 2) { - for (i=0; i < z->s->img_x; ++i) { - out[0] = stbi__blinn_8x8(255 - coutput[0][i], coutput[3][i]); - out[1] = 255; - out += n; - } - } else { - stbi_uc *y = coutput[0]; - if (n == 1) - for (i=0; i < z->s->img_x; ++i) out[i] = y[i]; - else - for (i=0; i < z->s->img_x; ++i) { *out++ = y[i]; *out++ = 255; } - } - } - } - stbi__cleanup_jpeg(z); - *out_x = z->s->img_x; - *out_y = z->s->img_y; - if (comp) *comp = z->s->img_n >= 3 ? 3 : 1; // report original components, not output - return output; - } -} - -static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) -{ - unsigned char* result; - stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg)); - if (!j) return stbi__errpuc("outofmem", "Out of memory"); - memset(j, 0, sizeof(stbi__jpeg)); - STBI_NOTUSED(ri); - j->s = s; - stbi__setup_jpeg(j); - result = load_jpeg_image(j, x,y,comp,req_comp); - STBI_FREE(j); - return result; -} - -static int stbi__jpeg_test(stbi__context *s) -{ - int r; - stbi__jpeg* j = (stbi__jpeg*)stbi__malloc(sizeof(stbi__jpeg)); - if (!j) return stbi__err("outofmem", "Out of memory"); - memset(j, 0, sizeof(stbi__jpeg)); - j->s = s; - stbi__setup_jpeg(j); - r = stbi__decode_jpeg_header(j, STBI__SCAN_type); - stbi__rewind(s); - STBI_FREE(j); - return r; -} - -static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp) -{ - if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) { - stbi__rewind( j->s ); - return 0; - } - if (x) *x = j->s->img_x; - if (y) *y = j->s->img_y; - if (comp) *comp = j->s->img_n >= 3 ? 3 : 1; - return 1; -} - -static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) -{ - int result; - stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg))); - if (!j) return stbi__err("outofmem", "Out of memory"); - memset(j, 0, sizeof(stbi__jpeg)); - j->s = s; - result = stbi__jpeg_info_raw(j, x, y, comp); - STBI_FREE(j); - return result; -} -#endif - -// public domain zlib decode v0.2 Sean Barrett 2006-11-18 -// simple implementation -// - all input must be provided in an upfront buffer -// - all output is written to a single output buffer (can malloc/realloc) -// performance -// - fast huffman - -#ifndef STBI_NO_ZLIB - -// fast-way is faster to check than jpeg huffman, but slow way is slower -#define STBI__ZFAST_BITS 9 // accelerate all cases in default tables -#define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1) -#define STBI__ZNSYMS 288 // number of symbols in literal/length alphabet - -// zlib-style huffman encoding -// (jpegs packs from left, zlib from right, so can't share code) -typedef struct -{ - stbi__uint16 fast[1 << STBI__ZFAST_BITS]; - stbi__uint16 firstcode[16]; - int maxcode[17]; - stbi__uint16 firstsymbol[16]; - stbi_uc size[STBI__ZNSYMS]; - stbi__uint16 value[STBI__ZNSYMS]; -} stbi__zhuffman; - -stbi_inline static int stbi__bitreverse16(int n) -{ - n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1); - n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2); - n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4); - n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8); - return n; -} - -stbi_inline static int stbi__bit_reverse(int v, int bits) -{ - STBI_ASSERT(bits <= 16); - // to bit reverse n bits, reverse 16 and shift - // e.g. 11 bits, bit reverse and shift away 5 - return stbi__bitreverse16(v) >> (16-bits); -} - -static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist, int num) -{ - int i,k=0; - int code, next_code[16], sizes[17]; - - // DEFLATE spec for generating codes - memset(sizes, 0, sizeof(sizes)); - memset(z->fast, 0, sizeof(z->fast)); - for (i=0; i < num; ++i) - ++sizes[sizelist[i]]; - sizes[0] = 0; - for (i=1; i < 16; ++i) - if (sizes[i] > (1 << i)) - return stbi__err("bad sizes", "Corrupt PNG"); - code = 0; - for (i=1; i < 16; ++i) { - next_code[i] = code; - z->firstcode[i] = (stbi__uint16) code; - z->firstsymbol[i] = (stbi__uint16) k; - code = (code + sizes[i]); - if (sizes[i]) - if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG"); - z->maxcode[i] = code << (16-i); // preshift for inner loop - code <<= 1; - k += sizes[i]; - } - z->maxcode[16] = 0x10000; // sentinel - for (i=0; i < num; ++i) { - int s = sizelist[i]; - if (s) { - int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s]; - stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i); - z->size [c] = (stbi_uc ) s; - z->value[c] = (stbi__uint16) i; - if (s <= STBI__ZFAST_BITS) { - int j = stbi__bit_reverse(next_code[s],s); - while (j < (1 << STBI__ZFAST_BITS)) { - z->fast[j] = fastv; - j += (1 << s); - } - } - ++next_code[s]; - } - } - return 1; -} - -// zlib-from-memory implementation for PNG reading -// because PNG allows splitting the zlib stream arbitrarily, -// and it's annoying structurally to have PNG call ZLIB call PNG, -// we require PNG read all the IDATs and combine them into a single -// memory buffer - -typedef struct -{ - stbi_uc *zbuffer, *zbuffer_end; - int num_bits; - stbi__uint32 code_buffer; - - char *zout; - char *zout_start; - char *zout_end; - int z_expandable; - - stbi__zhuffman z_length, z_distance; -} stbi__zbuf; - -stbi_inline static int stbi__zeof(stbi__zbuf *z) -{ - return (z->zbuffer >= z->zbuffer_end); -} - -stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z) -{ - return stbi__zeof(z) ? 0 : *z->zbuffer++; -} - -static void stbi__fill_bits(stbi__zbuf *z) -{ - do { - if (z->code_buffer >= (1U << z->num_bits)) { - z->zbuffer = z->zbuffer_end; /* treat this as EOF so we fail. */ - return; - } - z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits; - z->num_bits += 8; - } while (z->num_bits <= 24); -} - -stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n) -{ - unsigned int k; - if (z->num_bits < n) stbi__fill_bits(z); - k = z->code_buffer & ((1 << n) - 1); - z->code_buffer >>= n; - z->num_bits -= n; - return k; -} - -static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) -{ - int b,s,k; - // not resolved by fast table, so compute it the slow way - // use jpeg approach, which requires MSbits at top - k = stbi__bit_reverse(a->code_buffer, 16); - for (s=STBI__ZFAST_BITS+1; ; ++s) - if (k < z->maxcode[s]) - break; - if (s >= 16) return -1; // invalid code! - // code size is s, so: - b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s]; - if (b >= STBI__ZNSYMS) return -1; // some data was corrupt somewhere! - if (z->size[b] != s) return -1; // was originally an assert, but report failure instead. - a->code_buffer >>= s; - a->num_bits -= s; - return z->value[b]; -} - -stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) -{ - int b,s; - if (a->num_bits < 16) { - if (stbi__zeof(a)) { - return -1; /* report error for unexpected end of data. */ - } - stbi__fill_bits(a); - } - b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; - if (b) { - s = b >> 9; - a->code_buffer >>= s; - a->num_bits -= s; - return b & 511; - } - return stbi__zhuffman_decode_slowpath(a, z); -} - -static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes -{ - char *q; - unsigned int cur, limit, old_limit; - z->zout = zout; - if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG"); - cur = (unsigned int) (z->zout - z->zout_start); - limit = old_limit = (unsigned) (z->zout_end - z->zout_start); - if (UINT_MAX - cur < (unsigned) n) return stbi__err("outofmem", "Out of memory"); - while (cur + n > limit) { - if(limit > UINT_MAX / 2) return stbi__err("outofmem", "Out of memory"); - limit *= 2; - } - q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit); - STBI_NOTUSED(old_limit); - if (q == NULL) return stbi__err("outofmem", "Out of memory"); - z->zout_start = q; - z->zout = q + cur; - z->zout_end = q + limit; - return 1; -} - -static const int stbi__zlength_base[31] = { - 3,4,5,6,7,8,9,10,11,13, - 15,17,19,23,27,31,35,43,51,59, - 67,83,99,115,131,163,195,227,258,0,0 }; - -static const int stbi__zlength_extra[31]= -{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; - -static const int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, -257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; - -static const int stbi__zdist_extra[32] = -{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; - -static int stbi__parse_huffman_block(stbi__zbuf *a) -{ - char *zout = a->zout; - for(;;) { - int z = stbi__zhuffman_decode(a, &a->z_length); - if (z < 256) { - if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes - if (zout >= a->zout_end) { - if (!stbi__zexpand(a, zout, 1)) return 0; - zout = a->zout; - } - *zout++ = (char) z; - } else { - stbi_uc *p; - int len,dist; - if (z == 256) { - a->zout = zout; - return 1; - } - if (z >= 286) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, length codes 286 and 287 must not appear in compressed data - z -= 257; - len = stbi__zlength_base[z]; - if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]); - z = stbi__zhuffman_decode(a, &a->z_distance); - if (z < 0 || z >= 30) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, distance codes 30 and 31 must not appear in compressed data - dist = stbi__zdist_base[z]; - if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]); - if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG"); - if (zout + len > a->zout_end) { - if (!stbi__zexpand(a, zout, len)) return 0; - zout = a->zout; - } - p = (stbi_uc *) (zout - dist); - if (dist == 1) { // run of one byte; common in images. - stbi_uc v = *p; - if (len) { do *zout++ = v; while (--len); } - } else { - if (len) { do *zout++ = *p++; while (--len); } - } - } - } -} - -static int stbi__compute_huffman_codes(stbi__zbuf *a) -{ - static const stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; - stbi__zhuffman z_codelength; - stbi_uc lencodes[286+32+137];//padding for maximum single op - stbi_uc codelength_sizes[19]; - int i,n; - - int hlit = stbi__zreceive(a,5) + 257; - int hdist = stbi__zreceive(a,5) + 1; - int hclen = stbi__zreceive(a,4) + 4; - int ntot = hlit + hdist; - - memset(codelength_sizes, 0, sizeof(codelength_sizes)); - for (i=0; i < hclen; ++i) { - int s = stbi__zreceive(a,3); - codelength_sizes[length_dezigzag[i]] = (stbi_uc) s; - } - if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0; - - n = 0; - while (n < ntot) { - int c = stbi__zhuffman_decode(a, &z_codelength); - if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG"); - if (c < 16) - lencodes[n++] = (stbi_uc) c; - else { - stbi_uc fill = 0; - if (c == 16) { - c = stbi__zreceive(a,2)+3; - if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG"); - fill = lencodes[n-1]; - } else if (c == 17) { - c = stbi__zreceive(a,3)+3; - } else if (c == 18) { - c = stbi__zreceive(a,7)+11; - } else { - return stbi__err("bad codelengths", "Corrupt PNG"); - } - if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG"); - memset(lencodes+n, fill, c); - n += c; - } - } - if (n != ntot) return stbi__err("bad codelengths","Corrupt PNG"); - if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0; - if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0; - return 1; -} - -static int stbi__parse_uncompressed_block(stbi__zbuf *a) -{ - stbi_uc header[4]; - int len,nlen,k; - if (a->num_bits & 7) - stbi__zreceive(a, a->num_bits & 7); // discard - // drain the bit-packed data into header - k = 0; - while (a->num_bits > 0) { - header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check - a->code_buffer >>= 8; - a->num_bits -= 8; - } - if (a->num_bits < 0) return stbi__err("zlib corrupt","Corrupt PNG"); - // now fill header the normal way - while (k < 4) - header[k++] = stbi__zget8(a); - len = header[1] * 256 + header[0]; - nlen = header[3] * 256 + header[2]; - if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG"); - if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG"); - if (a->zout + len > a->zout_end) - if (!stbi__zexpand(a, a->zout, len)) return 0; - memcpy(a->zout, a->zbuffer, len); - a->zbuffer += len; - a->zout += len; - return 1; -} - -static int stbi__parse_zlib_header(stbi__zbuf *a) -{ - int cmf = stbi__zget8(a); - int cm = cmf & 15; - /* int cinfo = cmf >> 4; */ - int flg = stbi__zget8(a); - if (stbi__zeof(a)) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec - if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec - if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png - if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png - // window = 1 << (8 + cinfo)... but who cares, we fully buffer output - return 1; -} - -static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] = -{ - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8 -}; -static const stbi_uc stbi__zdefault_distance[32] = -{ - 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5 -}; -/* -Init algorithm: -{ - int i; // use <= to match clearly with spec - for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8; - for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9; - for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7; - for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8; - - for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5; -} -*/ - -static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) -{ - int final, type; - if (parse_header) - if (!stbi__parse_zlib_header(a)) return 0; - a->num_bits = 0; - a->code_buffer = 0; - do { - final = stbi__zreceive(a,1); - type = stbi__zreceive(a,2); - if (type == 0) { - if (!stbi__parse_uncompressed_block(a)) return 0; - } else if (type == 3) { - return 0; - } else { - if (type == 1) { - // use fixed code lengths - if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , STBI__ZNSYMS)) return 0; - if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0; - } else { - if (!stbi__compute_huffman_codes(a)) return 0; - } - if (!stbi__parse_huffman_block(a)) return 0; - } - } while (!final); - return 1; -} - -static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header) -{ - a->zout_start = obuf; - a->zout = obuf; - a->zout_end = obuf + olen; - a->z_expandable = exp; - - return stbi__parse_zlib(a, parse_header); -} - -STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen) -{ - stbi__zbuf a; - char *p = (char *) stbi__malloc(initial_size); - if (p == NULL) return NULL; - a.zbuffer = (stbi_uc *) buffer; - a.zbuffer_end = (stbi_uc *) buffer + len; - if (stbi__do_zlib(&a, p, initial_size, 1, 1)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - STBI_FREE(a.zout_start); - return NULL; - } -} - -STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) -{ - return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen); -} - -STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header) -{ - stbi__zbuf a; - char *p = (char *) stbi__malloc(initial_size); - if (p == NULL) return NULL; - a.zbuffer = (stbi_uc *) buffer; - a.zbuffer_end = (stbi_uc *) buffer + len; - if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - STBI_FREE(a.zout_start); - return NULL; - } -} - -STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen) -{ - stbi__zbuf a; - a.zbuffer = (stbi_uc *) ibuffer; - a.zbuffer_end = (stbi_uc *) ibuffer + ilen; - if (stbi__do_zlib(&a, obuffer, olen, 0, 1)) - return (int) (a.zout - a.zout_start); - else - return -1; -} - -STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen) -{ - stbi__zbuf a; - char *p = (char *) stbi__malloc(16384); - if (p == NULL) return NULL; - a.zbuffer = (stbi_uc *) buffer; - a.zbuffer_end = (stbi_uc *) buffer+len; - if (stbi__do_zlib(&a, p, 16384, 1, 0)) { - if (outlen) *outlen = (int) (a.zout - a.zout_start); - return a.zout_start; - } else { - STBI_FREE(a.zout_start); - return NULL; - } -} - -STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen) -{ - stbi__zbuf a; - a.zbuffer = (stbi_uc *) ibuffer; - a.zbuffer_end = (stbi_uc *) ibuffer + ilen; - if (stbi__do_zlib(&a, obuffer, olen, 0, 0)) - return (int) (a.zout - a.zout_start); - else - return -1; -} -#endif - -// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18 -// simple implementation -// - only 8-bit samples -// - no CRC checking -// - allocates lots of intermediate memory -// - avoids problem of streaming data between subsystems -// - avoids explicit window management -// performance -// - uses stb_zlib, a PD zlib implementation with fast huffman decoding - -#ifndef STBI_NO_PNG -typedef struct -{ - stbi__uint32 length; - stbi__uint32 type; -} stbi__pngchunk; - -static stbi__pngchunk stbi__get_chunk_header(stbi__context *s) -{ - stbi__pngchunk c; - c.length = stbi__get32be(s); - c.type = stbi__get32be(s); - return c; -} - -static int stbi__check_png_header(stbi__context *s) -{ - static const stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 }; - int i; - for (i=0; i < 8; ++i) - if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG"); - return 1; -} - -typedef struct -{ - stbi__context *s; - stbi_uc *idata, *expanded, *out; - int depth; -} stbi__png; - - -enum { - STBI__F_none=0, - STBI__F_sub=1, - STBI__F_up=2, - STBI__F_avg=3, - STBI__F_paeth=4, - // synthetic filters used for first scanline to avoid needing a dummy row of 0s - STBI__F_avg_first, - STBI__F_paeth_first -}; - -static stbi_uc first_row_filter[5] = -{ - STBI__F_none, - STBI__F_sub, - STBI__F_none, - STBI__F_avg_first, - STBI__F_paeth_first -}; - -static int stbi__paeth(int a, int b, int c) -{ - int p = a + b - c; - int pa = abs(p-a); - int pb = abs(p-b); - int pc = abs(p-c); - if (pa <= pb && pa <= pc) return a; - if (pb <= pc) return b; - return c; -} - -static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }; - -// create the png data from post-deflated data -static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) -{ - int bytes = (depth == 16? 2 : 1); - stbi__context *s = a->s; - stbi__uint32 i,j,stride = x*out_n*bytes; - stbi__uint32 img_len, img_width_bytes; - int k; - int img_n = s->img_n; // copy it into a local for later - - int output_bytes = out_n*bytes; - int filter_bytes = img_n*bytes; - int width = x; - - STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1); - a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into - if (!a->out) return stbi__err("outofmem", "Out of memory"); - - if (!stbi__mad3sizes_valid(img_n, x, depth, 7)) return stbi__err("too large", "Corrupt PNG"); - img_width_bytes = (((img_n * x * depth) + 7) >> 3); - img_len = (img_width_bytes + 1) * y; - - // we used to check for exact match between raw_len and img_len on non-interlaced PNGs, - // but issue #276 reported a PNG in the wild that had extra data at the end (all zeros), - // so just check for raw_len < img_len always. - if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG"); - - for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *prior; - int filter = *raw++; - - if (filter > 4) - return stbi__err("invalid filter","Corrupt PNG"); - - if (depth < 8) { - if (img_width_bytes > x) return stbi__err("invalid width","Corrupt PNG"); - cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place - filter_bytes = 1; - width = img_width_bytes; - } - prior = cur - stride; // bugfix: need to compute this after 'cur +=' computation above - - // if first row, use special filter that doesn't sample previous row - if (j == 0) filter = first_row_filter[filter]; - - // handle first byte explicitly - for (k=0; k < filter_bytes; ++k) { - switch (filter) { - case STBI__F_none : cur[k] = raw[k]; break; - case STBI__F_sub : cur[k] = raw[k]; break; - case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break; - case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break; - case STBI__F_avg_first : cur[k] = raw[k]; break; - case STBI__F_paeth_first: cur[k] = raw[k]; break; - } - } - - if (depth == 8) { - if (img_n != out_n) - cur[img_n] = 255; // first pixel - raw += img_n; - cur += out_n; - prior += out_n; - } else if (depth == 16) { - if (img_n != out_n) { - cur[filter_bytes] = 255; // first pixel top byte - cur[filter_bytes+1] = 255; // first pixel bottom byte - } - raw += filter_bytes; - cur += output_bytes; - prior += output_bytes; - } else { - raw += 1; - cur += 1; - prior += 1; - } - - // this is a little gross, so that we don't switch per-pixel or per-component - if (depth < 8 || img_n == out_n) { - int nk = (width - 1)*filter_bytes; - #define STBI__CASE(f) \ - case f: \ - for (k=0; k < nk; ++k) - switch (filter) { - // "none" filter turns into a memcpy here; make that explicit. - case STBI__F_none: memcpy(cur, raw, nk); break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break; - } - #undef STBI__CASE - raw += nk; - } else { - STBI_ASSERT(img_n+1 == out_n); - #define STBI__CASE(f) \ - case f: \ - for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \ - for (k=0; k < filter_bytes; ++k) - switch (filter) { - STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } break; - STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break; - STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break; - STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break; - STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break; - STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break; - STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break; - } - #undef STBI__CASE - - // the loop above sets the high byte of the pixels' alpha, but for - // 16 bit png files we also need the low byte set. we'll do that here. - if (depth == 16) { - cur = a->out + stride*j; // start at the beginning of the row again - for (i=0; i < x; ++i,cur+=output_bytes) { - cur[filter_bytes+1] = 255; - } - } - } - } - - // we make a separate pass to expand bits to pixels; for performance, - // this could run two scanlines behind the above code, so it won't - // intefere with filtering but will still be in the cache. - if (depth < 8) { - for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes; - // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit - // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop - stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range - - // note that the final byte might overshoot and write more data than desired. - // we can allocate enough data that this never writes out of memory, but it - // could also overwrite the next scanline. can it overwrite non-empty data - // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel. - // so we need to explicitly clamp the final ones - - if (depth == 4) { - for (k=x*img_n; k >= 2; k-=2, ++in) { - *cur++ = scale * ((*in >> 4) ); - *cur++ = scale * ((*in ) & 0x0f); - } - if (k > 0) *cur++ = scale * ((*in >> 4) ); - } else if (depth == 2) { - for (k=x*img_n; k >= 4; k-=4, ++in) { - *cur++ = scale * ((*in >> 6) ); - *cur++ = scale * ((*in >> 4) & 0x03); - *cur++ = scale * ((*in >> 2) & 0x03); - *cur++ = scale * ((*in ) & 0x03); - } - if (k > 0) *cur++ = scale * ((*in >> 6) ); - if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03); - if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03); - } else if (depth == 1) { - for (k=x*img_n; k >= 8; k-=8, ++in) { - *cur++ = scale * ((*in >> 7) ); - *cur++ = scale * ((*in >> 6) & 0x01); - *cur++ = scale * ((*in >> 5) & 0x01); - *cur++ = scale * ((*in >> 4) & 0x01); - *cur++ = scale * ((*in >> 3) & 0x01); - *cur++ = scale * ((*in >> 2) & 0x01); - *cur++ = scale * ((*in >> 1) & 0x01); - *cur++ = scale * ((*in ) & 0x01); - } - if (k > 0) *cur++ = scale * ((*in >> 7) ); - if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01); - if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01); - if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01); - if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01); - if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01); - if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01); - } - if (img_n != out_n) { - int q; - // insert alpha = 255 - cur = a->out + stride*j; - if (img_n == 1) { - for (q=x-1; q >= 0; --q) { - cur[q*2+1] = 255; - cur[q*2+0] = cur[q]; - } - } else { - STBI_ASSERT(img_n == 3); - for (q=x-1; q >= 0; --q) { - cur[q*4+3] = 255; - cur[q*4+2] = cur[q*3+2]; - cur[q*4+1] = cur[q*3+1]; - cur[q*4+0] = cur[q*3+0]; - } - } - } - } - } else if (depth == 16) { - // force the image data from big-endian to platform-native. - // this is done in a separate pass due to the decoding relying - // on the data being untouched, but could probably be done - // per-line during decode if care is taken. - stbi_uc *cur = a->out; - stbi__uint16 *cur16 = (stbi__uint16*)cur; - - for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) { - *cur16 = (cur[0] << 8) | cur[1]; - } - } - - return 1; -} - -static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced) -{ - int bytes = (depth == 16 ? 2 : 1); - int out_bytes = out_n * bytes; - stbi_uc *final; - int p; - if (!interlaced) - return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color); - - // de-interlacing - final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0); - if (!final) return stbi__err("outofmem", "Out of memory"); - for (p=0; p < 7; ++p) { - int xorig[] = { 0,4,0,2,0,1,0 }; - int yorig[] = { 0,0,4,0,2,0,1 }; - int xspc[] = { 8,8,4,4,2,2,1 }; - int yspc[] = { 8,8,8,4,4,2,2 }; - int i,j,x,y; - // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1 - x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p]; - y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p]; - if (x && y) { - stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y; - if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) { - STBI_FREE(final); - return 0; - } - for (j=0; j < y; ++j) { - for (i=0; i < x; ++i) { - int out_y = j*yspc[p]+yorig[p]; - int out_x = i*xspc[p]+xorig[p]; - memcpy(final + out_y*a->s->img_x*out_bytes + out_x*out_bytes, - a->out + (j*x+i)*out_bytes, out_bytes); - } - } - STBI_FREE(a->out); - image_data += img_len; - image_data_len -= img_len; - } - } - a->out = final; - - return 1; -} - -static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n) -{ - stbi__context *s = z->s; - stbi__uint32 i, pixel_count = s->img_x * s->img_y; - stbi_uc *p = z->out; - - // compute color-based transparency, assuming we've - // already got 255 as the alpha value in the output - STBI_ASSERT(out_n == 2 || out_n == 4); - - if (out_n == 2) { - for (i=0; i < pixel_count; ++i) { - p[1] = (p[0] == tc[0] ? 0 : 255); - p += 2; - } - } else { - for (i=0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; - p += 4; - } - } - return 1; -} - -static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n) -{ - stbi__context *s = z->s; - stbi__uint32 i, pixel_count = s->img_x * s->img_y; - stbi__uint16 *p = (stbi__uint16*) z->out; - - // compute color-based transparency, assuming we've - // already got 65535 as the alpha value in the output - STBI_ASSERT(out_n == 2 || out_n == 4); - - if (out_n == 2) { - for (i = 0; i < pixel_count; ++i) { - p[1] = (p[0] == tc[0] ? 0 : 65535); - p += 2; - } - } else { - for (i = 0; i < pixel_count; ++i) { - if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2]) - p[3] = 0; - p += 4; - } - } - return 1; -} - -static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n) -{ - stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y; - stbi_uc *p, *temp_out, *orig = a->out; - - p = (stbi_uc *) stbi__malloc_mad2(pixel_count, pal_img_n, 0); - if (p == NULL) return stbi__err("outofmem", "Out of memory"); - - // between here and free(out) below, exitting would leak - temp_out = p; - - if (pal_img_n == 3) { - for (i=0; i < pixel_count; ++i) { - int n = orig[i]*4; - p[0] = palette[n ]; - p[1] = palette[n+1]; - p[2] = palette[n+2]; - p += 3; - } - } else { - for (i=0; i < pixel_count; ++i) { - int n = orig[i]*4; - p[0] = palette[n ]; - p[1] = palette[n+1]; - p[2] = palette[n+2]; - p[3] = palette[n+3]; - p += 4; - } - } - STBI_FREE(a->out); - a->out = temp_out; - - STBI_NOTUSED(len); - - return 1; -} - -static int stbi__unpremultiply_on_load_global = 0; -static int stbi__de_iphone_flag_global = 0; - -STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply) -{ - stbi__unpremultiply_on_load_global = flag_true_if_should_unpremultiply; -} - -STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert) -{ - stbi__de_iphone_flag_global = flag_true_if_should_convert; -} - -#ifndef STBI_THREAD_LOCAL -#define stbi__unpremultiply_on_load stbi__unpremultiply_on_load_global -#define stbi__de_iphone_flag stbi__de_iphone_flag_global -#else -static STBI_THREAD_LOCAL int stbi__unpremultiply_on_load_local, stbi__unpremultiply_on_load_set; -static STBI_THREAD_LOCAL int stbi__de_iphone_flag_local, stbi__de_iphone_flag_set; - -STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply) -{ - stbi__unpremultiply_on_load_local = flag_true_if_should_unpremultiply; - stbi__unpremultiply_on_load_set = 1; -} - -STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_convert) -{ - stbi__de_iphone_flag_local = flag_true_if_should_convert; - stbi__de_iphone_flag_set = 1; -} - -#define stbi__unpremultiply_on_load (stbi__unpremultiply_on_load_set \ - ? stbi__unpremultiply_on_load_local \ - : stbi__unpremultiply_on_load_global) -#define stbi__de_iphone_flag (stbi__de_iphone_flag_set \ - ? stbi__de_iphone_flag_local \ - : stbi__de_iphone_flag_global) -#endif // STBI_THREAD_LOCAL - -static void stbi__de_iphone(stbi__png *z) -{ - stbi__context *s = z->s; - stbi__uint32 i, pixel_count = s->img_x * s->img_y; - stbi_uc *p = z->out; - - if (s->img_out_n == 3) { // convert bgr to rgb - for (i=0; i < pixel_count; ++i) { - stbi_uc t = p[0]; - p[0] = p[2]; - p[2] = t; - p += 3; - } - } else { - STBI_ASSERT(s->img_out_n == 4); - if (stbi__unpremultiply_on_load) { - // convert bgr to rgb and unpremultiply - for (i=0; i < pixel_count; ++i) { - stbi_uc a = p[3]; - stbi_uc t = p[0]; - if (a) { - stbi_uc half = a / 2; - p[0] = (p[2] * 255 + half) / a; - p[1] = (p[1] * 255 + half) / a; - p[2] = ( t * 255 + half) / a; - } else { - p[0] = p[2]; - p[2] = t; - } - p += 4; - } - } else { - // convert bgr to rgb - for (i=0; i < pixel_count; ++i) { - stbi_uc t = p[0]; - p[0] = p[2]; - p[2] = t; - p += 4; - } - } - } -} - -#define STBI__PNG_TYPE(a,b,c,d) (((unsigned) (a) << 24) + ((unsigned) (b) << 16) + ((unsigned) (c) << 8) + (unsigned) (d)) - -static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) -{ - stbi_uc palette[1024], pal_img_n=0; - stbi_uc has_trans=0, tc[3]={0}; - stbi__uint16 tc16[3]; - stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0; - int first=1,k,interlace=0, color=0, is_iphone=0; - stbi__context *s = z->s; - - z->expanded = NULL; - z->idata = NULL; - z->out = NULL; - - if (!stbi__check_png_header(s)) return 0; - - if (scan == STBI__SCAN_type) return 1; - - for (;;) { - stbi__pngchunk c = stbi__get_chunk_header(s); - switch (c.type) { - case STBI__PNG_TYPE('C','g','B','I'): - is_iphone = 1; - stbi__skip(s, c.length); - break; - case STBI__PNG_TYPE('I','H','D','R'): { - int comp,filter; - if (!first) return stbi__err("multiple IHDR","Corrupt PNG"); - first = 0; - if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG"); - s->img_x = stbi__get32be(s); - s->img_y = stbi__get32be(s); - if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); - if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); - z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only"); - color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG"); - if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG"); - if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG"); - comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG"); - filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG"); - interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG"); - if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG"); - if (!pal_img_n) { - s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0); - if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode"); - } else { - // if paletted, then pal_n is our final components, and - // img_n is # components to decompress/filter. - s->img_n = 1; - if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG"); - } - // even with SCAN_header, have to scan to see if we have a tRNS - break; - } - - case STBI__PNG_TYPE('P','L','T','E'): { - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG"); - pal_len = c.length / 3; - if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG"); - for (i=0; i < pal_len; ++i) { - palette[i*4+0] = stbi__get8(s); - palette[i*4+1] = stbi__get8(s); - palette[i*4+2] = stbi__get8(s); - palette[i*4+3] = 255; - } - break; - } - - case STBI__PNG_TYPE('t','R','N','S'): { - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG"); - if (pal_img_n) { - if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; } - if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG"); - if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG"); - pal_img_n = 4; - for (i=0; i < c.length; ++i) - palette[i*4+3] = stbi__get8(s); - } else { - if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG"); - if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG"); - has_trans = 1; - // non-paletted with tRNS = constant alpha. if header-scanning, we can stop now. - if (scan == STBI__SCAN_header) { ++s->img_n; return 1; } - if (z->depth == 16) { - for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is - } else { - for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger - } - } - break; - } - - case STBI__PNG_TYPE('I','D','A','T'): { - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); - if (scan == STBI__SCAN_header) { - // header scan definitely stops at first IDAT - if (pal_img_n) - s->img_n = pal_img_n; - return 1; - } - if (c.length > (1u << 30)) return stbi__err("IDAT size limit", "IDAT section larger than 2^30 bytes"); - if ((int)(ioff + c.length) < (int)ioff) return 0; - if (ioff + c.length > idata_limit) { - stbi__uint32 idata_limit_old = idata_limit; - stbi_uc *p; - if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096; - while (ioff + c.length > idata_limit) - idata_limit *= 2; - STBI_NOTUSED(idata_limit_old); - p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory"); - z->idata = p; - } - if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG"); - ioff += c.length; - break; - } - - case STBI__PNG_TYPE('I','E','N','D'): { - stbi__uint32 raw_len, bpl; - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (scan != STBI__SCAN_load) return 1; - if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG"); - // initial guess for decoded data size to avoid unnecessary reallocs - bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component - raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; - z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); - if (z->expanded == NULL) return 0; // zlib should set error - STBI_FREE(z->idata); z->idata = NULL; - if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans) - s->img_out_n = s->img_n+1; - else - s->img_out_n = s->img_n; - if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0; - if (has_trans) { - if (z->depth == 16) { - if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0; - } else { - if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0; - } - } - if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2) - stbi__de_iphone(z); - if (pal_img_n) { - // pal_img_n == 3 or 4 - s->img_n = pal_img_n; // record the actual colors we had - s->img_out_n = pal_img_n; - if (req_comp >= 3) s->img_out_n = req_comp; - if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n)) - return 0; - } else if (has_trans) { - // non-paletted image with tRNS -> source image has (constant) alpha - ++s->img_n; - } - STBI_FREE(z->expanded); z->expanded = NULL; - // end of PNG chunk, read and skip CRC - stbi__get32be(s); - return 1; - } - - default: - // if critical, fail - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if ((c.type & (1 << 29)) == 0) { - #ifndef STBI_NO_FAILURE_STRINGS - // not threadsafe - static char invalid_chunk[] = "XXXX PNG chunk not known"; - invalid_chunk[0] = STBI__BYTECAST(c.type >> 24); - invalid_chunk[1] = STBI__BYTECAST(c.type >> 16); - invalid_chunk[2] = STBI__BYTECAST(c.type >> 8); - invalid_chunk[3] = STBI__BYTECAST(c.type >> 0); - #endif - return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type"); - } - stbi__skip(s, c.length); - break; - } - // end of PNG chunk, read and skip CRC - stbi__get32be(s); - } -} - -static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp, stbi__result_info *ri) -{ - void *result=NULL; - if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); - if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) { - if (p->depth <= 8) - ri->bits_per_channel = 8; - else if (p->depth == 16) - ri->bits_per_channel = 16; - else - return stbi__errpuc("bad bits_per_channel", "PNG not supported: unsupported color depth"); - result = p->out; - p->out = NULL; - if (req_comp && req_comp != p->s->img_out_n) { - if (ri->bits_per_channel == 8) - result = stbi__convert_format((unsigned char *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); - else - result = stbi__convert_format16((stbi__uint16 *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y); - p->s->img_out_n = req_comp; - if (result == NULL) return result; - } - *x = p->s->img_x; - *y = p->s->img_y; - if (n) *n = p->s->img_n; - } - STBI_FREE(p->out); p->out = NULL; - STBI_FREE(p->expanded); p->expanded = NULL; - STBI_FREE(p->idata); p->idata = NULL; - - return result; -} - -static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) -{ - stbi__png p; - p.s = s; - return stbi__do_png(&p, x,y,comp,req_comp, ri); -} - -static int stbi__png_test(stbi__context *s) -{ - int r; - r = stbi__check_png_header(s); - stbi__rewind(s); - return r; -} - -static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp) -{ - if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) { - stbi__rewind( p->s ); - return 0; - } - if (x) *x = p->s->img_x; - if (y) *y = p->s->img_y; - if (comp) *comp = p->s->img_n; - return 1; -} - -static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) -{ - stbi__png p; - p.s = s; - return stbi__png_info_raw(&p, x, y, comp); -} - -static int stbi__png_is16(stbi__context *s) -{ - stbi__png p; - p.s = s; - if (!stbi__png_info_raw(&p, NULL, NULL, NULL)) - return 0; - if (p.depth != 16) { - stbi__rewind(p.s); - return 0; - } - return 1; -} -#endif - -// Microsoft/Windows BMP image - -#ifndef STBI_NO_BMP -static int stbi__bmp_test_raw(stbi__context *s) -{ - int r; - int sz; - if (stbi__get8(s) != 'B') return 0; - if (stbi__get8(s) != 'M') return 0; - stbi__get32le(s); // discard filesize - stbi__get16le(s); // discard reserved - stbi__get16le(s); // discard reserved - stbi__get32le(s); // discard data offset - sz = stbi__get32le(s); - r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124); - return r; -} - -static int stbi__bmp_test(stbi__context *s) -{ - int r = stbi__bmp_test_raw(s); - stbi__rewind(s); - return r; -} - - -// returns 0..31 for the highest set bit -static int stbi__high_bit(unsigned int z) -{ - int n=0; - if (z == 0) return -1; - if (z >= 0x10000) { n += 16; z >>= 16; } - if (z >= 0x00100) { n += 8; z >>= 8; } - if (z >= 0x00010) { n += 4; z >>= 4; } - if (z >= 0x00004) { n += 2; z >>= 2; } - if (z >= 0x00002) { n += 1;/* >>= 1;*/ } - return n; -} - -static int stbi__bitcount(unsigned int a) -{ - a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2 - a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4 - a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits - a = (a + (a >> 8)); // max 16 per 8 bits - a = (a + (a >> 16)); // max 32 per 8 bits - return a & 0xff; -} - -// extract an arbitrarily-aligned N-bit value (N=bits) -// from v, and then make it 8-bits long and fractionally -// extend it to full full range. -static int stbi__shiftsigned(unsigned int v, int shift, int bits) -{ - static unsigned int mul_table[9] = { - 0, - 0xff/*0b11111111*/, 0x55/*0b01010101*/, 0x49/*0b01001001*/, 0x11/*0b00010001*/, - 0x21/*0b00100001*/, 0x41/*0b01000001*/, 0x81/*0b10000001*/, 0x01/*0b00000001*/, - }; - static unsigned int shift_table[9] = { - 0, 0,0,1,0,2,4,6,0, - }; - if (shift < 0) - v <<= -shift; - else - v >>= shift; - STBI_ASSERT(v < 256); - v >>= (8-bits); - STBI_ASSERT(bits >= 0 && bits <= 8); - return (int) ((unsigned) v * mul_table[bits]) >> shift_table[bits]; -} - -typedef struct -{ - int bpp, offset, hsz; - unsigned int mr,mg,mb,ma, all_a; - int extra_read; -} stbi__bmp_data; - -static int stbi__bmp_set_mask_defaults(stbi__bmp_data *info, int compress) -{ - // BI_BITFIELDS specifies masks explicitly, don't override - if (compress == 3) - return 1; - - if (compress == 0) { - if (info->bpp == 16) { - info->mr = 31u << 10; - info->mg = 31u << 5; - info->mb = 31u << 0; - } else if (info->bpp == 32) { - info->mr = 0xffu << 16; - info->mg = 0xffu << 8; - info->mb = 0xffu << 0; - info->ma = 0xffu << 24; - info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0 - } else { - // otherwise, use defaults, which is all-0 - info->mr = info->mg = info->mb = info->ma = 0; - } - return 1; - } - return 0; // error -} - -static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) -{ - int hsz; - if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP"); - stbi__get32le(s); // discard filesize - stbi__get16le(s); // discard reserved - stbi__get16le(s); // discard reserved - info->offset = stbi__get32le(s); - info->hsz = hsz = stbi__get32le(s); - info->mr = info->mg = info->mb = info->ma = 0; - info->extra_read = 14; - - if (info->offset < 0) return stbi__errpuc("bad BMP", "bad BMP"); - - if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown"); - if (hsz == 12) { - s->img_x = stbi__get16le(s); - s->img_y = stbi__get16le(s); - } else { - s->img_x = stbi__get32le(s); - s->img_y = stbi__get32le(s); - } - if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP"); - info->bpp = stbi__get16le(s); - if (hsz != 12) { - int compress = stbi__get32le(s); - if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE"); - if (compress >= 4) return stbi__errpuc("BMP JPEG/PNG", "BMP type not supported: unsupported compression"); // this includes PNG/JPEG modes - if (compress == 3 && info->bpp != 16 && info->bpp != 32) return stbi__errpuc("bad BMP", "bad BMP"); // bitfields requires 16 or 32 bits/pixel - stbi__get32le(s); // discard sizeof - stbi__get32le(s); // discard hres - stbi__get32le(s); // discard vres - stbi__get32le(s); // discard colorsused - stbi__get32le(s); // discard max important - if (hsz == 40 || hsz == 56) { - if (hsz == 56) { - stbi__get32le(s); - stbi__get32le(s); - stbi__get32le(s); - stbi__get32le(s); - } - if (info->bpp == 16 || info->bpp == 32) { - if (compress == 0) { - stbi__bmp_set_mask_defaults(info, compress); - } else if (compress == 3) { - info->mr = stbi__get32le(s); - info->mg = stbi__get32le(s); - info->mb = stbi__get32le(s); - info->extra_read += 12; - // not documented, but generated by photoshop and handled by mspaint - if (info->mr == info->mg && info->mg == info->mb) { - // ?!?!? - return stbi__errpuc("bad BMP", "bad BMP"); - } - } else - return stbi__errpuc("bad BMP", "bad BMP"); - } - } else { - // V4/V5 header - int i; - if (hsz != 108 && hsz != 124) - return stbi__errpuc("bad BMP", "bad BMP"); - info->mr = stbi__get32le(s); - info->mg = stbi__get32le(s); - info->mb = stbi__get32le(s); - info->ma = stbi__get32le(s); - if (compress != 3) // override mr/mg/mb unless in BI_BITFIELDS mode, as per docs - stbi__bmp_set_mask_defaults(info, compress); - stbi__get32le(s); // discard color space - for (i=0; i < 12; ++i) - stbi__get32le(s); // discard color space parameters - if (hsz == 124) { - stbi__get32le(s); // discard rendering intent - stbi__get32le(s); // discard offset of profile data - stbi__get32le(s); // discard size of profile data - stbi__get32le(s); // discard reserved - } - } - } - return (void *) 1; -} - - -static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) -{ - stbi_uc *out; - unsigned int mr=0,mg=0,mb=0,ma=0, all_a; - stbi_uc pal[256][4]; - int psize=0,i,j,width; - int flip_vertically, pad, target; - stbi__bmp_data info; - STBI_NOTUSED(ri); - - info.all_a = 255; - if (stbi__bmp_parse_header(s, &info) == NULL) - return NULL; // error code already set - - flip_vertically = ((int) s->img_y) > 0; - s->img_y = abs((int) s->img_y); - - if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - - mr = info.mr; - mg = info.mg; - mb = info.mb; - ma = info.ma; - all_a = info.all_a; - - if (info.hsz == 12) { - if (info.bpp < 24) - psize = (info.offset - info.extra_read - 24) / 3; - } else { - if (info.bpp < 16) - psize = (info.offset - info.extra_read - info.hsz) >> 2; - } - if (psize == 0) { - // accept some number of extra bytes after the header, but if the offset points either to before - // the header ends or implies a large amount of extra data, reject the file as malformed - int bytes_read_so_far = s->callback_already_read + (int)(s->img_buffer - s->img_buffer_original); - int header_limit = 1024; // max we actually read is below 256 bytes currently. - int extra_data_limit = 256*4; // what ordinarily goes here is a palette; 256 entries*4 bytes is its max size. - if (bytes_read_so_far <= 0 || bytes_read_so_far > header_limit) { - return stbi__errpuc("bad header", "Corrupt BMP"); - } - // we established that bytes_read_so_far is positive and sensible. - // the first half of this test rejects offsets that are either too small positives, or - // negative, and guarantees that info.offset >= bytes_read_so_far > 0. this in turn - // ensures the number computed in the second half of the test can't overflow. - if (info.offset < bytes_read_so_far || info.offset - bytes_read_so_far > extra_data_limit) { - return stbi__errpuc("bad offset", "Corrupt BMP"); - } else { - stbi__skip(s, info.offset - bytes_read_so_far); - } - } - - if (info.bpp == 24 && ma == 0xff000000) - s->img_n = 3; - else - s->img_n = ma ? 4 : 3; - if (req_comp && req_comp >= 3) // we can directly decode 3 or 4 - target = req_comp; - else - target = s->img_n; // if they want monochrome, we'll post-convert - - // sanity-check size - if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0)) - return stbi__errpuc("too large", "Corrupt BMP"); - - out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0); - if (!out) return stbi__errpuc("outofmem", "Out of memory"); - if (info.bpp < 16) { - int z=0; - if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); } - for (i=0; i < psize; ++i) { - pal[i][2] = stbi__get8(s); - pal[i][1] = stbi__get8(s); - pal[i][0] = stbi__get8(s); - if (info.hsz != 12) stbi__get8(s); - pal[i][3] = 255; - } - stbi__skip(s, info.offset - info.extra_read - info.hsz - psize * (info.hsz == 12 ? 3 : 4)); - if (info.bpp == 1) width = (s->img_x + 7) >> 3; - else if (info.bpp == 4) width = (s->img_x + 1) >> 1; - else if (info.bpp == 8) width = s->img_x; - else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); } - pad = (-width)&3; - if (info.bpp == 1) { - for (j=0; j < (int) s->img_y; ++j) { - int bit_offset = 7, v = stbi__get8(s); - for (i=0; i < (int) s->img_x; ++i) { - int color = (v>>bit_offset)&0x1; - out[z++] = pal[color][0]; - out[z++] = pal[color][1]; - out[z++] = pal[color][2]; - if (target == 4) out[z++] = 255; - if (i+1 == (int) s->img_x) break; - if((--bit_offset) < 0) { - bit_offset = 7; - v = stbi__get8(s); - } - } - stbi__skip(s, pad); - } - } else { - for (j=0; j < (int) s->img_y; ++j) { - for (i=0; i < (int) s->img_x; i += 2) { - int v=stbi__get8(s),v2=0; - if (info.bpp == 4) { - v2 = v & 15; - v >>= 4; - } - out[z++] = pal[v][0]; - out[z++] = pal[v][1]; - out[z++] = pal[v][2]; - if (target == 4) out[z++] = 255; - if (i+1 == (int) s->img_x) break; - v = (info.bpp == 8) ? stbi__get8(s) : v2; - out[z++] = pal[v][0]; - out[z++] = pal[v][1]; - out[z++] = pal[v][2]; - if (target == 4) out[z++] = 255; - } - stbi__skip(s, pad); - } - } - } else { - int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0; - int z = 0; - int easy=0; - stbi__skip(s, info.offset - info.extra_read - info.hsz); - if (info.bpp == 24) width = 3 * s->img_x; - else if (info.bpp == 16) width = 2*s->img_x; - else /* bpp = 32 and pad = 0 */ width=0; - pad = (-width) & 3; - if (info.bpp == 24) { - easy = 1; - } else if (info.bpp == 32) { - if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000) - easy = 2; - } - if (!easy) { - if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); } - // right shift amt to put high bit in position #7 - rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr); - gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg); - bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb); - ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma); - if (rcount > 8 || gcount > 8 || bcount > 8 || acount > 8) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); } - } - for (j=0; j < (int) s->img_y; ++j) { - if (easy) { - for (i=0; i < (int) s->img_x; ++i) { - unsigned char a; - out[z+2] = stbi__get8(s); - out[z+1] = stbi__get8(s); - out[z+0] = stbi__get8(s); - z += 3; - a = (easy == 2 ? stbi__get8(s) : 255); - all_a |= a; - if (target == 4) out[z++] = a; - } - } else { - int bpp = info.bpp; - for (i=0; i < (int) s->img_x; ++i) { - stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s)); - unsigned int a; - out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount)); - out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount)); - out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount)); - a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255); - all_a |= a; - if (target == 4) out[z++] = STBI__BYTECAST(a); - } - } - stbi__skip(s, pad); - } - } - - // if alpha channel is all 0s, replace with all 255s - if (target == 4 && all_a == 0) - for (i=4*s->img_x*s->img_y-1; i >= 0; i -= 4) - out[i] = 255; - - if (flip_vertically) { - stbi_uc t; - for (j=0; j < (int) s->img_y>>1; ++j) { - stbi_uc *p1 = out + j *s->img_x*target; - stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target; - for (i=0; i < (int) s->img_x*target; ++i) { - t = p1[i]; p1[i] = p2[i]; p2[i] = t; - } - } - } - - if (req_comp && req_comp != target) { - out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y); - if (out == NULL) return out; // stbi__convert_format frees input on failure - } - - *x = s->img_x; - *y = s->img_y; - if (comp) *comp = s->img_n; - return out; -} -#endif - -// Targa Truevision - TGA -// by Jonathan Dummer -#ifndef STBI_NO_TGA -// returns STBI_rgb or whatever, 0 on error -static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_rgb16) -{ - // only RGB or RGBA (incl. 16bit) or grey allowed - if (is_rgb16) *is_rgb16 = 0; - switch(bits_per_pixel) { - case 8: return STBI_grey; - case 16: if(is_grey) return STBI_grey_alpha; - // fallthrough - case 15: if(is_rgb16) *is_rgb16 = 1; - return STBI_rgb; - case 24: // fallthrough - case 32: return bits_per_pixel/8; - default: return 0; - } -} - -static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp) -{ - int tga_w, tga_h, tga_comp, tga_image_type, tga_bits_per_pixel, tga_colormap_bpp; - int sz, tga_colormap_type; - stbi__get8(s); // discard Offset - tga_colormap_type = stbi__get8(s); // colormap type - if( tga_colormap_type > 1 ) { - stbi__rewind(s); - return 0; // only RGB or indexed allowed - } - tga_image_type = stbi__get8(s); // image type - if ( tga_colormap_type == 1 ) { // colormapped (paletted) image - if (tga_image_type != 1 && tga_image_type != 9) { - stbi__rewind(s); - return 0; - } - stbi__skip(s,4); // skip index of first colormap entry and number of entries - sz = stbi__get8(s); // check bits per palette color entry - if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) { - stbi__rewind(s); - return 0; - } - stbi__skip(s,4); // skip image x and y origin - tga_colormap_bpp = sz; - } else { // "normal" image w/o colormap - only RGB or grey allowed, +/- RLE - if ( (tga_image_type != 2) && (tga_image_type != 3) && (tga_image_type != 10) && (tga_image_type != 11) ) { - stbi__rewind(s); - return 0; // only RGB or grey allowed, +/- RLE - } - stbi__skip(s,9); // skip colormap specification and image x/y origin - tga_colormap_bpp = 0; - } - tga_w = stbi__get16le(s); - if( tga_w < 1 ) { - stbi__rewind(s); - return 0; // test width - } - tga_h = stbi__get16le(s); - if( tga_h < 1 ) { - stbi__rewind(s); - return 0; // test height - } - tga_bits_per_pixel = stbi__get8(s); // bits per pixel - stbi__get8(s); // ignore alpha bits - if (tga_colormap_bpp != 0) { - if((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16)) { - // when using a colormap, tga_bits_per_pixel is the size of the indexes - // I don't think anything but 8 or 16bit indexes makes sense - stbi__rewind(s); - return 0; - } - tga_comp = stbi__tga_get_comp(tga_colormap_bpp, 0, NULL); - } else { - tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3) || (tga_image_type == 11), NULL); - } - if(!tga_comp) { - stbi__rewind(s); - return 0; - } - if (x) *x = tga_w; - if (y) *y = tga_h; - if (comp) *comp = tga_comp; - return 1; // seems to have passed everything -} - -static int stbi__tga_test(stbi__context *s) -{ - int res = 0; - int sz, tga_color_type; - stbi__get8(s); // discard Offset - tga_color_type = stbi__get8(s); // color type - if ( tga_color_type > 1 ) goto errorEnd; // only RGB or indexed allowed - sz = stbi__get8(s); // image type - if ( tga_color_type == 1 ) { // colormapped (paletted) image - if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9 - stbi__skip(s,4); // skip index of first colormap entry and number of entries - sz = stbi__get8(s); // check bits per palette color entry - if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd; - stbi__skip(s,4); // skip image x and y origin - } else { // "normal" image w/o colormap - if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE - stbi__skip(s,9); // skip colormap specification and image x/y origin - } - if ( stbi__get16le(s) < 1 ) goto errorEnd; // test width - if ( stbi__get16le(s) < 1 ) goto errorEnd; // test height - sz = stbi__get8(s); // bits per pixel - if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index - if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd; - - res = 1; // if we got this far, everything's good and we can return 1 instead of 0 - -errorEnd: - stbi__rewind(s); - return res; -} - -// read 16bit value and convert to 24bit RGB -static void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out) -{ - stbi__uint16 px = (stbi__uint16)stbi__get16le(s); - stbi__uint16 fiveBitMask = 31; - // we have 3 channels with 5bits each - int r = (px >> 10) & fiveBitMask; - int g = (px >> 5) & fiveBitMask; - int b = px & fiveBitMask; - // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later - out[0] = (stbi_uc)((r * 255)/31); - out[1] = (stbi_uc)((g * 255)/31); - out[2] = (stbi_uc)((b * 255)/31); - - // some people claim that the most significant bit might be used for alpha - // (possibly if an alpha-bit is set in the "image descriptor byte") - // but that only made 16bit test images completely translucent.. - // so let's treat all 15 and 16bit TGAs as RGB with no alpha. -} - -static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) -{ - // read in the TGA header stuff - int tga_offset = stbi__get8(s); - int tga_indexed = stbi__get8(s); - int tga_image_type = stbi__get8(s); - int tga_is_RLE = 0; - int tga_palette_start = stbi__get16le(s); - int tga_palette_len = stbi__get16le(s); - int tga_palette_bits = stbi__get8(s); - int tga_x_origin = stbi__get16le(s); - int tga_y_origin = stbi__get16le(s); - int tga_width = stbi__get16le(s); - int tga_height = stbi__get16le(s); - int tga_bits_per_pixel = stbi__get8(s); - int tga_comp, tga_rgb16=0; - int tga_inverted = stbi__get8(s); - // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?) - // image data - unsigned char *tga_data; - unsigned char *tga_palette = NULL; - int i, j; - unsigned char raw_data[4] = {0}; - int RLE_count = 0; - int RLE_repeating = 0; - int read_next_pixel = 1; - STBI_NOTUSED(ri); - STBI_NOTUSED(tga_x_origin); // @TODO - STBI_NOTUSED(tga_y_origin); // @TODO - - if (tga_height > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - if (tga_width > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - - // do a tiny bit of precessing - if ( tga_image_type >= 8 ) - { - tga_image_type -= 8; - tga_is_RLE = 1; - } - tga_inverted = 1 - ((tga_inverted >> 5) & 1); - - // If I'm paletted, then I'll use the number of bits from the palette - if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16); - else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16); - - if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency - return stbi__errpuc("bad format", "Can't find out TGA pixelformat"); - - // tga info - *x = tga_width; - *y = tga_height; - if (comp) *comp = tga_comp; - - if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0)) - return stbi__errpuc("too large", "Corrupt TGA"); - - tga_data = (unsigned char*)stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0); - if (!tga_data) return stbi__errpuc("outofmem", "Out of memory"); - - // skip to the data's starting position (offset usually = 0) - stbi__skip(s, tga_offset ); - - if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) { - for (i=0; i < tga_height; ++i) { - int row = tga_inverted ? tga_height -i - 1 : i; - stbi_uc *tga_row = tga_data + row*tga_width*tga_comp; - stbi__getn(s, tga_row, tga_width * tga_comp); - } - } else { - // do I need to load a palette? - if ( tga_indexed) - { - if (tga_palette_len == 0) { /* you have to have at least one entry! */ - STBI_FREE(tga_data); - return stbi__errpuc("bad palette", "Corrupt TGA"); - } - - // any data to skip? (offset usually = 0) - stbi__skip(s, tga_palette_start ); - // load the palette - tga_palette = (unsigned char*)stbi__malloc_mad2(tga_palette_len, tga_comp, 0); - if (!tga_palette) { - STBI_FREE(tga_data); - return stbi__errpuc("outofmem", "Out of memory"); - } - if (tga_rgb16) { - stbi_uc *pal_entry = tga_palette; - STBI_ASSERT(tga_comp == STBI_rgb); - for (i=0; i < tga_palette_len; ++i) { - stbi__tga_read_rgb16(s, pal_entry); - pal_entry += tga_comp; - } - } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) { - STBI_FREE(tga_data); - STBI_FREE(tga_palette); - return stbi__errpuc("bad palette", "Corrupt TGA"); - } - } - // load the data - for (i=0; i < tga_width * tga_height; ++i) - { - // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk? - if ( tga_is_RLE ) - { - if ( RLE_count == 0 ) - { - // yep, get the next byte as a RLE command - int RLE_cmd = stbi__get8(s); - RLE_count = 1 + (RLE_cmd & 127); - RLE_repeating = RLE_cmd >> 7; - read_next_pixel = 1; - } else if ( !RLE_repeating ) - { - read_next_pixel = 1; - } - } else - { - read_next_pixel = 1; - } - // OK, if I need to read a pixel, do it now - if ( read_next_pixel ) - { - // load however much data we did have - if ( tga_indexed ) - { - // read in index, then perform the lookup - int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s); - if ( pal_idx >= tga_palette_len ) { - // invalid index - pal_idx = 0; - } - pal_idx *= tga_comp; - for (j = 0; j < tga_comp; ++j) { - raw_data[j] = tga_palette[pal_idx+j]; - } - } else if(tga_rgb16) { - STBI_ASSERT(tga_comp == STBI_rgb); - stbi__tga_read_rgb16(s, raw_data); - } else { - // read in the data raw - for (j = 0; j < tga_comp; ++j) { - raw_data[j] = stbi__get8(s); - } - } - // clear the reading flag for the next pixel - read_next_pixel = 0; - } // end of reading a pixel - - // copy data - for (j = 0; j < tga_comp; ++j) - tga_data[i*tga_comp+j] = raw_data[j]; - - // in case we're in RLE mode, keep counting down - --RLE_count; - } - // do I need to invert the image? - if ( tga_inverted ) - { - for (j = 0; j*2 < tga_height; ++j) - { - int index1 = j * tga_width * tga_comp; - int index2 = (tga_height - 1 - j) * tga_width * tga_comp; - for (i = tga_width * tga_comp; i > 0; --i) - { - unsigned char temp = tga_data[index1]; - tga_data[index1] = tga_data[index2]; - tga_data[index2] = temp; - ++index1; - ++index2; - } - } - } - // clear my palette, if I had one - if ( tga_palette != NULL ) - { - STBI_FREE( tga_palette ); - } - } - - // swap RGB - if the source data was RGB16, it already is in the right order - if (tga_comp >= 3 && !tga_rgb16) - { - unsigned char* tga_pixel = tga_data; - for (i=0; i < tga_width * tga_height; ++i) - { - unsigned char temp = tga_pixel[0]; - tga_pixel[0] = tga_pixel[2]; - tga_pixel[2] = temp; - tga_pixel += tga_comp; - } - } - - // convert to target component count - if (req_comp && req_comp != tga_comp) - tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height); - - // the things I do to get rid of an error message, and yet keep - // Microsoft's C compilers happy... [8^( - tga_palette_start = tga_palette_len = tga_palette_bits = - tga_x_origin = tga_y_origin = 0; - STBI_NOTUSED(tga_palette_start); - // OK, done - return tga_data; -} -#endif - -// ************************************************************************************************* -// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB - -#ifndef STBI_NO_PSD -static int stbi__psd_test(stbi__context *s) -{ - int r = (stbi__get32be(s) == 0x38425053); - stbi__rewind(s); - return r; -} - -static int stbi__psd_decode_rle(stbi__context *s, stbi_uc *p, int pixelCount) -{ - int count, nleft, len; - - count = 0; - while ((nleft = pixelCount - count) > 0) { - len = stbi__get8(s); - if (len == 128) { - // No-op. - } else if (len < 128) { - // Copy next len+1 bytes literally. - len++; - if (len > nleft) return 0; // corrupt data - count += len; - while (len) { - *p = stbi__get8(s); - p += 4; - len--; - } - } else if (len > 128) { - stbi_uc val; - // Next -len+1 bytes in the dest are replicated from next source byte. - // (Interpret len as a negative 8-bit int.) - len = 257 - len; - if (len > nleft) return 0; // corrupt data - val = stbi__get8(s); - count += len; - while (len) { - *p = val; - p += 4; - len--; - } - } - } - - return 1; -} - -static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc) -{ - int pixelCount; - int channelCount, compression; - int channel, i; - int bitdepth; - int w,h; - stbi_uc *out; - STBI_NOTUSED(ri); - - // Check identifier - if (stbi__get32be(s) != 0x38425053) // "8BPS" - return stbi__errpuc("not PSD", "Corrupt PSD image"); - - // Check file type version. - if (stbi__get16be(s) != 1) - return stbi__errpuc("wrong version", "Unsupported version of PSD image"); - - // Skip 6 reserved bytes. - stbi__skip(s, 6 ); - - // Read the number of channels (R, G, B, A, etc). - channelCount = stbi__get16be(s); - if (channelCount < 0 || channelCount > 16) - return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image"); - - // Read the rows and columns of the image. - h = stbi__get32be(s); - w = stbi__get32be(s); - - if (h > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - if (w > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - - // Make sure the depth is 8 bits. - bitdepth = stbi__get16be(s); - if (bitdepth != 8 && bitdepth != 16) - return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit"); - - // Make sure the color mode is RGB. - // Valid options are: - // 0: Bitmap - // 1: Grayscale - // 2: Indexed color - // 3: RGB color - // 4: CMYK color - // 7: Multichannel - // 8: Duotone - // 9: Lab color - if (stbi__get16be(s) != 3) - return stbi__errpuc("wrong color format", "PSD is not in RGB color format"); - - // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.) - stbi__skip(s,stbi__get32be(s) ); - - // Skip the image resources. (resolution, pen tool paths, etc) - stbi__skip(s, stbi__get32be(s) ); - - // Skip the reserved data. - stbi__skip(s, stbi__get32be(s) ); - - // Find out if the data is compressed. - // Known values: - // 0: no compression - // 1: RLE compressed - compression = stbi__get16be(s); - if (compression > 1) - return stbi__errpuc("bad compression", "PSD has an unknown compression format"); - - // Check size - if (!stbi__mad3sizes_valid(4, w, h, 0)) - return stbi__errpuc("too large", "Corrupt PSD"); - - // Create the destination image. - - if (!compression && bitdepth == 16 && bpc == 16) { - out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0); - ri->bits_per_channel = 16; - } else - out = (stbi_uc *) stbi__malloc(4 * w*h); - - if (!out) return stbi__errpuc("outofmem", "Out of memory"); - pixelCount = w*h; - - // Initialize the data to zero. - //memset( out, 0, pixelCount * 4 ); - - // Finally, the image data. - if (compression) { - // RLE as used by .PSD and .TIFF - // Loop until you get the number of unpacked bytes you are expecting: - // Read the next source byte into n. - // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally. - // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times. - // Else if n is 128, noop. - // Endloop - - // The RLE-compressed data is preceded by a 2-byte data count for each row in the data, - // which we're going to just skip. - stbi__skip(s, h * channelCount * 2 ); - - // Read the RLE data by channel. - for (channel = 0; channel < 4; channel++) { - stbi_uc *p; - - p = out+channel; - if (channel >= channelCount) { - // Fill this channel with default data. - for (i = 0; i < pixelCount; i++, p += 4) - *p = (channel == 3 ? 255 : 0); - } else { - // Read the RLE data. - if (!stbi__psd_decode_rle(s, p, pixelCount)) { - STBI_FREE(out); - return stbi__errpuc("corrupt", "bad RLE data"); - } - } - } - - } else { - // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...) - // where each channel consists of an 8-bit (or 16-bit) value for each pixel in the image. - - // Read the data by channel. - for (channel = 0; channel < 4; channel++) { - if (channel >= channelCount) { - // Fill this channel with default data. - if (bitdepth == 16 && bpc == 16) { - stbi__uint16 *q = ((stbi__uint16 *) out) + channel; - stbi__uint16 val = channel == 3 ? 65535 : 0; - for (i = 0; i < pixelCount; i++, q += 4) - *q = val; - } else { - stbi_uc *p = out+channel; - stbi_uc val = channel == 3 ? 255 : 0; - for (i = 0; i < pixelCount; i++, p += 4) - *p = val; - } - } else { - if (ri->bits_per_channel == 16) { // output bpc - stbi__uint16 *q = ((stbi__uint16 *) out) + channel; - for (i = 0; i < pixelCount; i++, q += 4) - *q = (stbi__uint16) stbi__get16be(s); - } else { - stbi_uc *p = out+channel; - if (bitdepth == 16) { // input bpc - for (i = 0; i < pixelCount; i++, p += 4) - *p = (stbi_uc) (stbi__get16be(s) >> 8); - } else { - for (i = 0; i < pixelCount; i++, p += 4) - *p = stbi__get8(s); - } - } - } - } - } - - // remove weird white matte from PSD - if (channelCount >= 4) { - if (ri->bits_per_channel == 16) { - for (i=0; i < w*h; ++i) { - stbi__uint16 *pixel = (stbi__uint16 *) out + 4*i; - if (pixel[3] != 0 && pixel[3] != 65535) { - float a = pixel[3] / 65535.0f; - float ra = 1.0f / a; - float inv_a = 65535.0f * (1 - ra); - pixel[0] = (stbi__uint16) (pixel[0]*ra + inv_a); - pixel[1] = (stbi__uint16) (pixel[1]*ra + inv_a); - pixel[2] = (stbi__uint16) (pixel[2]*ra + inv_a); - } - } - } else { - for (i=0; i < w*h; ++i) { - unsigned char *pixel = out + 4*i; - if (pixel[3] != 0 && pixel[3] != 255) { - float a = pixel[3] / 255.0f; - float ra = 1.0f / a; - float inv_a = 255.0f * (1 - ra); - pixel[0] = (unsigned char) (pixel[0]*ra + inv_a); - pixel[1] = (unsigned char) (pixel[1]*ra + inv_a); - pixel[2] = (unsigned char) (pixel[2]*ra + inv_a); - } - } - } - } - - // convert to desired output format - if (req_comp && req_comp != 4) { - if (ri->bits_per_channel == 16) - out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, 4, req_comp, w, h); - else - out = stbi__convert_format(out, 4, req_comp, w, h); - if (out == NULL) return out; // stbi__convert_format frees input on failure - } - - if (comp) *comp = 4; - *y = h; - *x = w; - - return out; -} -#endif - -// ************************************************************************************************* -// Softimage PIC loader -// by Tom Seddon -// -// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format -// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/ - -#ifndef STBI_NO_PIC -static int stbi__pic_is4(stbi__context *s,const char *str) -{ - int i; - for (i=0; i<4; ++i) - if (stbi__get8(s) != (stbi_uc)str[i]) - return 0; - - return 1; -} - -static int stbi__pic_test_core(stbi__context *s) -{ - int i; - - if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) - return 0; - - for(i=0;i<84;++i) - stbi__get8(s); - - if (!stbi__pic_is4(s,"PICT")) - return 0; - - return 1; -} - -typedef struct -{ - stbi_uc size,type,channel; -} stbi__pic_packet; - -static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest) -{ - int mask=0x80, i; - - for (i=0; i<4; ++i, mask>>=1) { - if (channel & mask) { - if (stbi__at_eof(s)) return stbi__errpuc("bad file","PIC file too short"); - dest[i]=stbi__get8(s); - } - } - - return dest; -} - -static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src) -{ - int mask=0x80,i; - - for (i=0;i<4; ++i, mask>>=1) - if (channel&mask) - dest[i]=src[i]; -} - -static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result) -{ - int act_comp=0,num_packets=0,y,chained; - stbi__pic_packet packets[10]; - - // this will (should...) cater for even some bizarre stuff like having data - // for the same channel in multiple packets. - do { - stbi__pic_packet *packet; - - if (num_packets==sizeof(packets)/sizeof(packets[0])) - return stbi__errpuc("bad format","too many packets"); - - packet = &packets[num_packets++]; - - chained = stbi__get8(s); - packet->size = stbi__get8(s); - packet->type = stbi__get8(s); - packet->channel = stbi__get8(s); - - act_comp |= packet->channel; - - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (reading packets)"); - if (packet->size != 8) return stbi__errpuc("bad format","packet isn't 8bpp"); - } while (chained); - - *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel? - - for(y=0; ytype) { - default: - return stbi__errpuc("bad format","packet has bad compression type"); - - case 0: {//uncompressed - int x; - - for(x=0;xchannel,dest)) - return 0; - break; - } - - case 1://Pure RLE - { - int left=width, i; - - while (left>0) { - stbi_uc count,value[4]; - - count=stbi__get8(s); - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pure read count)"); - - if (count > left) - count = (stbi_uc) left; - - if (!stbi__readval(s,packet->channel,value)) return 0; - - for(i=0; ichannel,dest,value); - left -= count; - } - } - break; - - case 2: {//Mixed RLE - int left=width; - while (left>0) { - int count = stbi__get8(s), i; - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (mixed read count)"); - - if (count >= 128) { // Repeated - stbi_uc value[4]; - - if (count==128) - count = stbi__get16be(s); - else - count -= 127; - if (count > left) - return stbi__errpuc("bad file","scanline overrun"); - - if (!stbi__readval(s,packet->channel,value)) - return 0; - - for(i=0;ichannel,dest,value); - } else { // Raw - ++count; - if (count>left) return stbi__errpuc("bad file","scanline overrun"); - - for(i=0;ichannel,dest)) - return 0; - } - left-=count; - } - break; - } - } - } - } - - return result; -} - -static void *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp, stbi__result_info *ri) -{ - stbi_uc *result; - int i, x,y, internal_comp; - STBI_NOTUSED(ri); - - if (!comp) comp = &internal_comp; - - for (i=0; i<92; ++i) - stbi__get8(s); - - x = stbi__get16be(s); - y = stbi__get16be(s); - - if (y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - if (x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)"); - if (!stbi__mad3sizes_valid(x, y, 4, 0)) return stbi__errpuc("too large", "PIC image too large to decode"); - - stbi__get32be(s); //skip `ratio' - stbi__get16be(s); //skip `fields' - stbi__get16be(s); //skip `pad' - - // intermediate buffer is RGBA - result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0); - if (!result) return stbi__errpuc("outofmem", "Out of memory"); - memset(result, 0xff, x*y*4); - - if (!stbi__pic_load_core(s,x,y,comp, result)) { - STBI_FREE(result); - result=0; - } - *px = x; - *py = y; - if (req_comp == 0) req_comp = *comp; - result=stbi__convert_format(result,4,req_comp,x,y); - - return result; -} - -static int stbi__pic_test(stbi__context *s) -{ - int r = stbi__pic_test_core(s); - stbi__rewind(s); - return r; -} -#endif - -// ************************************************************************************************* -// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb - -#ifndef STBI_NO_GIF -typedef struct -{ - stbi__int16 prefix; - stbi_uc first; - stbi_uc suffix; -} stbi__gif_lzw; - -typedef struct -{ - int w,h; - stbi_uc *out; // output buffer (always 4 components) - stbi_uc *background; // The current "background" as far as a gif is concerned - stbi_uc *history; - int flags, bgindex, ratio, transparent, eflags; - stbi_uc pal[256][4]; - stbi_uc lpal[256][4]; - stbi__gif_lzw codes[8192]; - stbi_uc *color_table; - int parse, step; - int lflags; - int start_x, start_y; - int max_x, max_y; - int cur_x, cur_y; - int line_size; - int delay; -} stbi__gif; - -static int stbi__gif_test_raw(stbi__context *s) -{ - int sz; - if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0; - sz = stbi__get8(s); - if (sz != '9' && sz != '7') return 0; - if (stbi__get8(s) != 'a') return 0; - return 1; -} - -static int stbi__gif_test(stbi__context *s) -{ - int r = stbi__gif_test_raw(s); - stbi__rewind(s); - return r; -} - -static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp) -{ - int i; - for (i=0; i < num_entries; ++i) { - pal[i][2] = stbi__get8(s); - pal[i][1] = stbi__get8(s); - pal[i][0] = stbi__get8(s); - pal[i][3] = transp == i ? 0 : 255; - } -} - -static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info) -{ - stbi_uc version; - if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') - return stbi__err("not GIF", "Corrupt GIF"); - - version = stbi__get8(s); - if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF"); - if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF"); - - stbi__g_failure_reason = ""; - g->w = stbi__get16le(s); - g->h = stbi__get16le(s); - g->flags = stbi__get8(s); - g->bgindex = stbi__get8(s); - g->ratio = stbi__get8(s); - g->transparent = -1; - - if (g->w > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); - if (g->h > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); - - if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments - - if (is_info) return 1; - - if (g->flags & 0x80) - stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1); - - return 1; -} - -static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp) -{ - stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); - if (!g) return stbi__err("outofmem", "Out of memory"); - if (!stbi__gif_header(s, g, comp, 1)) { - STBI_FREE(g); - stbi__rewind( s ); - return 0; - } - if (x) *x = g->w; - if (y) *y = g->h; - STBI_FREE(g); - return 1; -} - -static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code) -{ - stbi_uc *p, *c; - int idx; - - // recurse to decode the prefixes, since the linked-list is backwards, - // and working backwards through an interleaved image would be nasty - if (g->codes[code].prefix >= 0) - stbi__out_gif_code(g, g->codes[code].prefix); - - if (g->cur_y >= g->max_y) return; - - idx = g->cur_x + g->cur_y; - p = &g->out[idx]; - g->history[idx / 4] = 1; - - c = &g->color_table[g->codes[code].suffix * 4]; - if (c[3] > 128) { // don't render transparent pixels; - p[0] = c[2]; - p[1] = c[1]; - p[2] = c[0]; - p[3] = c[3]; - } - g->cur_x += 4; - - if (g->cur_x >= g->max_x) { - g->cur_x = g->start_x; - g->cur_y += g->step; - - while (g->cur_y >= g->max_y && g->parse > 0) { - g->step = (1 << g->parse) * g->line_size; - g->cur_y = g->start_y + (g->step >> 1); - --g->parse; - } - } -} - -static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) -{ - stbi_uc lzw_cs; - stbi__int32 len, init_code; - stbi__uint32 first; - stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear; - stbi__gif_lzw *p; - - lzw_cs = stbi__get8(s); - if (lzw_cs > 12) return NULL; - clear = 1 << lzw_cs; - first = 1; - codesize = lzw_cs + 1; - codemask = (1 << codesize) - 1; - bits = 0; - valid_bits = 0; - for (init_code = 0; init_code < clear; init_code++) { - g->codes[init_code].prefix = -1; - g->codes[init_code].first = (stbi_uc) init_code; - g->codes[init_code].suffix = (stbi_uc) init_code; - } - - // support no starting clear code - avail = clear+2; - oldcode = -1; - - len = 0; - for(;;) { - if (valid_bits < codesize) { - if (len == 0) { - len = stbi__get8(s); // start new block - if (len == 0) - return g->out; - } - --len; - bits |= (stbi__int32) stbi__get8(s) << valid_bits; - valid_bits += 8; - } else { - stbi__int32 code = bits & codemask; - bits >>= codesize; - valid_bits -= codesize; - // @OPTIMIZE: is there some way we can accelerate the non-clear path? - if (code == clear) { // clear code - codesize = lzw_cs + 1; - codemask = (1 << codesize) - 1; - avail = clear + 2; - oldcode = -1; - first = 0; - } else if (code == clear + 1) { // end of stream code - stbi__skip(s, len); - while ((len = stbi__get8(s)) > 0) - stbi__skip(s,len); - return g->out; - } else if (code <= avail) { - if (first) { - return stbi__errpuc("no clear code", "Corrupt GIF"); - } - - if (oldcode >= 0) { - p = &g->codes[avail++]; - if (avail > 8192) { - return stbi__errpuc("too many codes", "Corrupt GIF"); - } - - p->prefix = (stbi__int16) oldcode; - p->first = g->codes[oldcode].first; - p->suffix = (code == avail) ? p->first : g->codes[code].first; - } else if (code == avail) - return stbi__errpuc("illegal code in raster", "Corrupt GIF"); - - stbi__out_gif_code(g, (stbi__uint16) code); - - if ((avail & codemask) == 0 && avail <= 0x0FFF) { - codesize++; - codemask = (1 << codesize) - 1; - } - - oldcode = code; - } else { - return stbi__errpuc("illegal code in raster", "Corrupt GIF"); - } - } - } -} - -// this function is designed to support animated gifs, although stb_image doesn't support it -// two back is the image from two frames ago, used for a very specific disposal format -static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp, stbi_uc *two_back) -{ - int dispose; - int first_frame; - int pi; - int pcount; - STBI_NOTUSED(req_comp); - - // on first frame, any non-written pixels get the background colour (non-transparent) - first_frame = 0; - if (g->out == 0) { - if (!stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header - if (!stbi__mad3sizes_valid(4, g->w, g->h, 0)) - return stbi__errpuc("too large", "GIF image is too large"); - pcount = g->w * g->h; - g->out = (stbi_uc *) stbi__malloc(4 * pcount); - g->background = (stbi_uc *) stbi__malloc(4 * pcount); - g->history = (stbi_uc *) stbi__malloc(pcount); - if (!g->out || !g->background || !g->history) - return stbi__errpuc("outofmem", "Out of memory"); - - // image is treated as "transparent" at the start - ie, nothing overwrites the current background; - // background colour is only used for pixels that are not rendered first frame, after that "background" - // color refers to the color that was there the previous frame. - memset(g->out, 0x00, 4 * pcount); - memset(g->background, 0x00, 4 * pcount); // state of the background (starts transparent) - memset(g->history, 0x00, pcount); // pixels that were affected previous frame - first_frame = 1; - } else { - // second frame - how do we dispose of the previous one? - dispose = (g->eflags & 0x1C) >> 2; - pcount = g->w * g->h; - - if ((dispose == 3) && (two_back == 0)) { - dispose = 2; // if I don't have an image to revert back to, default to the old background - } - - if (dispose == 3) { // use previous graphic - for (pi = 0; pi < pcount; ++pi) { - if (g->history[pi]) { - memcpy( &g->out[pi * 4], &two_back[pi * 4], 4 ); - } - } - } else if (dispose == 2) { - // restore what was changed last frame to background before that frame; - for (pi = 0; pi < pcount; ++pi) { - if (g->history[pi]) { - memcpy( &g->out[pi * 4], &g->background[pi * 4], 4 ); - } - } - } else { - // This is a non-disposal case eithe way, so just - // leave the pixels as is, and they will become the new background - // 1: do not dispose - // 0: not specified. - } - - // background is what out is after the undoing of the previou frame; - memcpy( g->background, g->out, 4 * g->w * g->h ); - } - - // clear my history; - memset( g->history, 0x00, g->w * g->h ); // pixels that were affected previous frame - - for (;;) { - int tag = stbi__get8(s); - switch (tag) { - case 0x2C: /* Image Descriptor */ - { - stbi__int32 x, y, w, h; - stbi_uc *o; - - x = stbi__get16le(s); - y = stbi__get16le(s); - w = stbi__get16le(s); - h = stbi__get16le(s); - if (((x + w) > (g->w)) || ((y + h) > (g->h))) - return stbi__errpuc("bad Image Descriptor", "Corrupt GIF"); - - g->line_size = g->w * 4; - g->start_x = x * 4; - g->start_y = y * g->line_size; - g->max_x = g->start_x + w * 4; - g->max_y = g->start_y + h * g->line_size; - g->cur_x = g->start_x; - g->cur_y = g->start_y; - - // if the width of the specified rectangle is 0, that means - // we may not see *any* pixels or the image is malformed; - // to make sure this is caught, move the current y down to - // max_y (which is what out_gif_code checks). - if (w == 0) - g->cur_y = g->max_y; - - g->lflags = stbi__get8(s); - - if (g->lflags & 0x40) { - g->step = 8 * g->line_size; // first interlaced spacing - g->parse = 3; - } else { - g->step = g->line_size; - g->parse = 0; - } - - if (g->lflags & 0x80) { - stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1); - g->color_table = (stbi_uc *) g->lpal; - } else if (g->flags & 0x80) { - g->color_table = (stbi_uc *) g->pal; - } else - return stbi__errpuc("missing color table", "Corrupt GIF"); - - o = stbi__process_gif_raster(s, g); - if (!o) return NULL; - - // if this was the first frame, - pcount = g->w * g->h; - if (first_frame && (g->bgindex > 0)) { - // if first frame, any pixel not drawn to gets the background color - for (pi = 0; pi < pcount; ++pi) { - if (g->history[pi] == 0) { - g->pal[g->bgindex][3] = 255; // just in case it was made transparent, undo that; It will be reset next frame if need be; - memcpy( &g->out[pi * 4], &g->pal[g->bgindex], 4 ); - } - } - } - - return o; - } - - case 0x21: // Comment Extension. - { - int len; - int ext = stbi__get8(s); - if (ext == 0xF9) { // Graphic Control Extension. - len = stbi__get8(s); - if (len == 4) { - g->eflags = stbi__get8(s); - g->delay = 10 * stbi__get16le(s); // delay - 1/100th of a second, saving as 1/1000ths. - - // unset old transparent - if (g->transparent >= 0) { - g->pal[g->transparent][3] = 255; - } - if (g->eflags & 0x01) { - g->transparent = stbi__get8(s); - if (g->transparent >= 0) { - g->pal[g->transparent][3] = 0; - } - } else { - // don't need transparent - stbi__skip(s, 1); - g->transparent = -1; - } - } else { - stbi__skip(s, len); - break; - } - } - while ((len = stbi__get8(s)) != 0) { - stbi__skip(s, len); - } - break; - } - - case 0x3B: // gif stream termination code - return (stbi_uc *) s; // using '1' causes warning on some compilers - - default: - return stbi__errpuc("unknown code", "Corrupt GIF"); - } - } -} - -static void *stbi__load_gif_main_outofmem(stbi__gif *g, stbi_uc *out, int **delays) -{ - STBI_FREE(g->out); - STBI_FREE(g->history); - STBI_FREE(g->background); - - if (out) STBI_FREE(out); - if (delays && *delays) STBI_FREE(*delays); - return stbi__errpuc("outofmem", "Out of memory"); -} - -static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, int *z, int *comp, int req_comp) -{ - if (stbi__gif_test(s)) { - int layers = 0; - stbi_uc *u = 0; - stbi_uc *out = 0; - stbi_uc *two_back = 0; - stbi__gif g; - int stride; - int out_size = 0; - int delays_size = 0; - - STBI_NOTUSED(out_size); - STBI_NOTUSED(delays_size); - - memset(&g, 0, sizeof(g)); - if (delays) { - *delays = 0; - } - - do { - u = stbi__gif_load_next(s, &g, comp, req_comp, two_back); - if (u == (stbi_uc *) s) u = 0; // end of animated gif marker - - if (u) { - *x = g.w; - *y = g.h; - ++layers; - stride = g.w * g.h * 4; - - if (out) { - void *tmp = (stbi_uc*) STBI_REALLOC_SIZED( out, out_size, layers * stride ); - if (!tmp) - return stbi__load_gif_main_outofmem(&g, out, delays); - else { - out = (stbi_uc*) tmp; - out_size = layers * stride; - } - - if (delays) { - int *new_delays = (int*) STBI_REALLOC_SIZED( *delays, delays_size, sizeof(int) * layers ); - if (!new_delays) - return stbi__load_gif_main_outofmem(&g, out, delays); - *delays = new_delays; - delays_size = layers * sizeof(int); - } - } else { - out = (stbi_uc*)stbi__malloc( layers * stride ); - if (!out) - return stbi__load_gif_main_outofmem(&g, out, delays); - out_size = layers * stride; - if (delays) { - *delays = (int*) stbi__malloc( layers * sizeof(int) ); - if (!*delays) - return stbi__load_gif_main_outofmem(&g, out, delays); - delays_size = layers * sizeof(int); - } - } - memcpy( out + ((layers - 1) * stride), u, stride ); - if (layers >= 2) { - two_back = out - 2 * stride; - } - - if (delays) { - (*delays)[layers - 1U] = g.delay; - } - } - } while (u != 0); - - // free temp buffer; - STBI_FREE(g.out); - STBI_FREE(g.history); - STBI_FREE(g.background); - - // do the final conversion after loading everything; - if (req_comp && req_comp != 4) - out = stbi__convert_format(out, 4, req_comp, layers * g.w, g.h); - - *z = layers; - return out; - } else { - return stbi__errpuc("not GIF", "Image was not as a gif type."); - } -} - -static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) -{ - stbi_uc *u = 0; - stbi__gif g; - memset(&g, 0, sizeof(g)); - STBI_NOTUSED(ri); - - u = stbi__gif_load_next(s, &g, comp, req_comp, 0); - if (u == (stbi_uc *) s) u = 0; // end of animated gif marker - if (u) { - *x = g.w; - *y = g.h; - - // moved conversion to after successful load so that the same - // can be done for multiple frames. - if (req_comp && req_comp != 4) - u = stbi__convert_format(u, 4, req_comp, g.w, g.h); - } else if (g.out) { - // if there was an error and we allocated an image buffer, free it! - STBI_FREE(g.out); - } - - // free buffers needed for multiple frame loading; - STBI_FREE(g.history); - STBI_FREE(g.background); - - return u; -} - -static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp) -{ - return stbi__gif_info_raw(s,x,y,comp); -} -#endif - -// ************************************************************************************************* -// Radiance RGBE HDR loader -// originally by Nicolas Schulz -#ifndef STBI_NO_HDR -static int stbi__hdr_test_core(stbi__context *s, const char *signature) -{ - int i; - for (i=0; signature[i]; ++i) - if (stbi__get8(s) != signature[i]) - return 0; - stbi__rewind(s); - return 1; -} - -static int stbi__hdr_test(stbi__context* s) -{ - int r = stbi__hdr_test_core(s, "#?RADIANCE\n"); - stbi__rewind(s); - if(!r) { - r = stbi__hdr_test_core(s, "#?RGBE\n"); - stbi__rewind(s); - } - return r; -} - -#define STBI__HDR_BUFLEN 1024 -static char *stbi__hdr_gettoken(stbi__context *z, char *buffer) -{ - int len=0; - char c = '\0'; - - c = (char) stbi__get8(z); - - while (!stbi__at_eof(z) && c != '\n') { - buffer[len++] = c; - if (len == STBI__HDR_BUFLEN-1) { - // flush to end of line - while (!stbi__at_eof(z) && stbi__get8(z) != '\n') - ; - break; - } - c = (char) stbi__get8(z); - } - - buffer[len] = 0; - return buffer; -} - -static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp) -{ - if ( input[3] != 0 ) { - float f1; - // Exponent - f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8)); - if (req_comp <= 2) - output[0] = (input[0] + input[1] + input[2]) * f1 / 3; - else { - output[0] = input[0] * f1; - output[1] = input[1] * f1; - output[2] = input[2] * f1; - } - if (req_comp == 2) output[1] = 1; - if (req_comp == 4) output[3] = 1; - } else { - switch (req_comp) { - case 4: output[3] = 1; /* fallthrough */ - case 3: output[0] = output[1] = output[2] = 0; - break; - case 2: output[1] = 1; /* fallthrough */ - case 1: output[0] = 0; - break; - } - } -} - -static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) -{ - char buffer[STBI__HDR_BUFLEN]; - char *token; - int valid = 0; - int width, height; - stbi_uc *scanline; - float *hdr_data; - int len; - unsigned char count, value; - int i, j, k, c1,c2, z; - const char *headerToken; - STBI_NOTUSED(ri); - - // Check identifier - headerToken = stbi__hdr_gettoken(s,buffer); - if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0) - return stbi__errpf("not HDR", "Corrupt HDR image"); - - // Parse header - for(;;) { - token = stbi__hdr_gettoken(s,buffer); - if (token[0] == 0) break; - if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; - } - - if (!valid) return stbi__errpf("unsupported format", "Unsupported HDR format"); - - // Parse width and height - // can't use sscanf() if we're not using stdio! - token = stbi__hdr_gettoken(s,buffer); - if (strncmp(token, "-Y ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format"); - token += 3; - height = (int) strtol(token, &token, 10); - while (*token == ' ') ++token; - if (strncmp(token, "+X ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format"); - token += 3; - width = (int) strtol(token, NULL, 10); - - if (height > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)"); - if (width > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)"); - - *x = width; - *y = height; - - if (comp) *comp = 3; - if (req_comp == 0) req_comp = 3; - - if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0)) - return stbi__errpf("too large", "HDR image is too large"); - - // Read data - hdr_data = (float *) stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0); - if (!hdr_data) - return stbi__errpf("outofmem", "Out of memory"); - - // Load image data - // image data is stored as some number of sca - if ( width < 8 || width >= 32768) { - // Read flat data - for (j=0; j < height; ++j) { - for (i=0; i < width; ++i) { - stbi_uc rgbe[4]; - main_decode_loop: - stbi__getn(s, rgbe, 4); - stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp); - } - } - } else { - // Read RLE-encoded data - scanline = NULL; - - for (j = 0; j < height; ++j) { - c1 = stbi__get8(s); - c2 = stbi__get8(s); - len = stbi__get8(s); - if (c1 != 2 || c2 != 2 || (len & 0x80)) { - // not run-length encoded, so we have to actually use THIS data as a decoded - // pixel (note this can't be a valid pixel--one of RGB must be >= 128) - stbi_uc rgbe[4]; - rgbe[0] = (stbi_uc) c1; - rgbe[1] = (stbi_uc) c2; - rgbe[2] = (stbi_uc) len; - rgbe[3] = (stbi_uc) stbi__get8(s); - stbi__hdr_convert(hdr_data, rgbe, req_comp); - i = 1; - j = 0; - STBI_FREE(scanline); - goto main_decode_loop; // yes, this makes no sense - } - len <<= 8; - len |= stbi__get8(s); - if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); } - if (scanline == NULL) { - scanline = (stbi_uc *) stbi__malloc_mad2(width, 4, 0); - if (!scanline) { - STBI_FREE(hdr_data); - return stbi__errpf("outofmem", "Out of memory"); - } - } - - for (k = 0; k < 4; ++k) { - int nleft; - i = 0; - while ((nleft = width - i) > 0) { - count = stbi__get8(s); - if (count > 128) { - // Run - value = stbi__get8(s); - count -= 128; - if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); } - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = value; - } else { - // Dump - if ((count == 0) || (count > nleft)) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); } - for (z = 0; z < count; ++z) - scanline[i++ * 4 + k] = stbi__get8(s); - } - } - } - for (i=0; i < width; ++i) - stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp); - } - if (scanline) - STBI_FREE(scanline); - } - - return hdr_data; -} - -static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp) -{ - char buffer[STBI__HDR_BUFLEN]; - char *token; - int valid = 0; - int dummy; - - if (!x) x = &dummy; - if (!y) y = &dummy; - if (!comp) comp = &dummy; - - if (stbi__hdr_test(s) == 0) { - stbi__rewind( s ); - return 0; - } - - for(;;) { - token = stbi__hdr_gettoken(s,buffer); - if (token[0] == 0) break; - if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1; - } - - if (!valid) { - stbi__rewind( s ); - return 0; - } - token = stbi__hdr_gettoken(s,buffer); - if (strncmp(token, "-Y ", 3)) { - stbi__rewind( s ); - return 0; - } - token += 3; - *y = (int) strtol(token, &token, 10); - while (*token == ' ') ++token; - if (strncmp(token, "+X ", 3)) { - stbi__rewind( s ); - return 0; - } - token += 3; - *x = (int) strtol(token, NULL, 10); - *comp = 3; - return 1; -} -#endif // STBI_NO_HDR - -#ifndef STBI_NO_BMP -static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp) -{ - void *p; - stbi__bmp_data info; - - info.all_a = 255; - p = stbi__bmp_parse_header(s, &info); - if (p == NULL) { - stbi__rewind( s ); - return 0; - } - if (x) *x = s->img_x; - if (y) *y = s->img_y; - if (comp) { - if (info.bpp == 24 && info.ma == 0xff000000) - *comp = 3; - else - *comp = info.ma ? 4 : 3; - } - return 1; -} -#endif - -#ifndef STBI_NO_PSD -static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp) -{ - int channelCount, dummy, depth; - if (!x) x = &dummy; - if (!y) y = &dummy; - if (!comp) comp = &dummy; - if (stbi__get32be(s) != 0x38425053) { - stbi__rewind( s ); - return 0; - } - if (stbi__get16be(s) != 1) { - stbi__rewind( s ); - return 0; - } - stbi__skip(s, 6); - channelCount = stbi__get16be(s); - if (channelCount < 0 || channelCount > 16) { - stbi__rewind( s ); - return 0; - } - *y = stbi__get32be(s); - *x = stbi__get32be(s); - depth = stbi__get16be(s); - if (depth != 8 && depth != 16) { - stbi__rewind( s ); - return 0; - } - if (stbi__get16be(s) != 3) { - stbi__rewind( s ); - return 0; - } - *comp = 4; - return 1; -} - -static int stbi__psd_is16(stbi__context *s) -{ - int channelCount, depth; - if (stbi__get32be(s) != 0x38425053) { - stbi__rewind( s ); - return 0; - } - if (stbi__get16be(s) != 1) { - stbi__rewind( s ); - return 0; - } - stbi__skip(s, 6); - channelCount = stbi__get16be(s); - if (channelCount < 0 || channelCount > 16) { - stbi__rewind( s ); - return 0; - } - STBI_NOTUSED(stbi__get32be(s)); - STBI_NOTUSED(stbi__get32be(s)); - depth = stbi__get16be(s); - if (depth != 16) { - stbi__rewind( s ); - return 0; - } - return 1; -} -#endif - -#ifndef STBI_NO_PIC -static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp) -{ - int act_comp=0,num_packets=0,chained,dummy; - stbi__pic_packet packets[10]; - - if (!x) x = &dummy; - if (!y) y = &dummy; - if (!comp) comp = &dummy; - - if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) { - stbi__rewind(s); - return 0; - } - - stbi__skip(s, 88); - - *x = stbi__get16be(s); - *y = stbi__get16be(s); - if (stbi__at_eof(s)) { - stbi__rewind( s); - return 0; - } - if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) { - stbi__rewind( s ); - return 0; - } - - stbi__skip(s, 8); - - do { - stbi__pic_packet *packet; - - if (num_packets==sizeof(packets)/sizeof(packets[0])) - return 0; - - packet = &packets[num_packets++]; - chained = stbi__get8(s); - packet->size = stbi__get8(s); - packet->type = stbi__get8(s); - packet->channel = stbi__get8(s); - act_comp |= packet->channel; - - if (stbi__at_eof(s)) { - stbi__rewind( s ); - return 0; - } - if (packet->size != 8) { - stbi__rewind( s ); - return 0; - } - } while (chained); - - *comp = (act_comp & 0x10 ? 4 : 3); - - return 1; -} -#endif - -// ************************************************************************************************* -// Portable Gray Map and Portable Pixel Map loader -// by Ken Miller -// -// PGM: http://netpbm.sourceforge.net/doc/pgm.html -// PPM: http://netpbm.sourceforge.net/doc/ppm.html -// -// Known limitations: -// Does not support comments in the header section -// Does not support ASCII image data (formats P2 and P3) - -#ifndef STBI_NO_PNM - -static int stbi__pnm_test(stbi__context *s) -{ - char p, t; - p = (char) stbi__get8(s); - t = (char) stbi__get8(s); - if (p != 'P' || (t != '5' && t != '6')) { - stbi__rewind( s ); - return 0; - } - return 1; -} - -static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri) -{ - stbi_uc *out; - STBI_NOTUSED(ri); - - ri->bits_per_channel = stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n); - if (ri->bits_per_channel == 0) - return 0; - - if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - - *x = s->img_x; - *y = s->img_y; - if (comp) *comp = s->img_n; - - if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0)) - return stbi__errpuc("too large", "PNM too large"); - - out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0); - if (!out) return stbi__errpuc("outofmem", "Out of memory"); - if (!stbi__getn(s, out, s->img_n * s->img_x * s->img_y * (ri->bits_per_channel / 8))) { - STBI_FREE(out); - return stbi__errpuc("bad PNM", "PNM file truncated"); - } - - if (req_comp && req_comp != s->img_n) { - if (ri->bits_per_channel == 16) { - out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, s->img_n, req_comp, s->img_x, s->img_y); - } else { - out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y); - } - if (out == NULL) return out; // stbi__convert_format frees input on failure - } - return out; -} - -static int stbi__pnm_isspace(char c) -{ - return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r'; -} - -static void stbi__pnm_skip_whitespace(stbi__context *s, char *c) -{ - for (;;) { - while (!stbi__at_eof(s) && stbi__pnm_isspace(*c)) - *c = (char) stbi__get8(s); - - if (stbi__at_eof(s) || *c != '#') - break; - - while (!stbi__at_eof(s) && *c != '\n' && *c != '\r' ) - *c = (char) stbi__get8(s); - } -} - -static int stbi__pnm_isdigit(char c) -{ - return c >= '0' && c <= '9'; -} - -static int stbi__pnm_getinteger(stbi__context *s, char *c) -{ - int value = 0; - - while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) { - value = value*10 + (*c - '0'); - *c = (char) stbi__get8(s); - if((value > 214748364) || (value == 214748364 && *c > '7')) - return stbi__err("integer parse overflow", "Parsing an integer in the PPM header overflowed a 32-bit int"); - } - - return value; -} - -static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp) -{ - int maxv, dummy; - char c, p, t; - - if (!x) x = &dummy; - if (!y) y = &dummy; - if (!comp) comp = &dummy; - - stbi__rewind(s); - - // Get identifier - p = (char) stbi__get8(s); - t = (char) stbi__get8(s); - if (p != 'P' || (t != '5' && t != '6')) { - stbi__rewind(s); - return 0; - } - - *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm - - c = (char) stbi__get8(s); - stbi__pnm_skip_whitespace(s, &c); - - *x = stbi__pnm_getinteger(s, &c); // read width - if(*x == 0) - return stbi__err("invalid width", "PPM image header had zero or overflowing width"); - stbi__pnm_skip_whitespace(s, &c); - - *y = stbi__pnm_getinteger(s, &c); // read height - if (*y == 0) - return stbi__err("invalid width", "PPM image header had zero or overflowing width"); - stbi__pnm_skip_whitespace(s, &c); - - maxv = stbi__pnm_getinteger(s, &c); // read max value - if (maxv > 65535) - return stbi__err("max value > 65535", "PPM image supports only 8-bit and 16-bit images"); - else if (maxv > 255) - return 16; - else - return 8; -} - -static int stbi__pnm_is16(stbi__context *s) -{ - if (stbi__pnm_info(s, NULL, NULL, NULL) == 16) - return 1; - return 0; -} -#endif - -static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) -{ - #ifndef STBI_NO_JPEG - if (stbi__jpeg_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PNG - if (stbi__png_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_GIF - if (stbi__gif_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_BMP - if (stbi__bmp_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PSD - if (stbi__psd_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PIC - if (stbi__pic_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PNM - if (stbi__pnm_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_HDR - if (stbi__hdr_info(s, x, y, comp)) return 1; - #endif - - // test tga last because it's a crappy test! - #ifndef STBI_NO_TGA - if (stbi__tga_info(s, x, y, comp)) - return 1; - #endif - return stbi__err("unknown image type", "Image not of any known type, or corrupt"); -} - -static int stbi__is_16_main(stbi__context *s) -{ - #ifndef STBI_NO_PNG - if (stbi__png_is16(s)) return 1; - #endif - - #ifndef STBI_NO_PSD - if (stbi__psd_is16(s)) return 1; - #endif - - #ifndef STBI_NO_PNM - if (stbi__pnm_is16(s)) return 1; - #endif - return 0; -} - -#ifndef STBI_NO_STDIO -STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp) -{ - FILE *f = stbi__fopen(filename, "rb"); - int result; - if (!f) return stbi__err("can't fopen", "Unable to open file"); - result = stbi_info_from_file(f, x, y, comp); - fclose(f); - return result; -} - -STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp) -{ - int r; - stbi__context s; - long pos = ftell(f); - stbi__start_file(&s, f); - r = stbi__info_main(&s,x,y,comp); - fseek(f,pos,SEEK_SET); - return r; -} - -STBIDEF int stbi_is_16_bit(char const *filename) -{ - FILE *f = stbi__fopen(filename, "rb"); - int result; - if (!f) return stbi__err("can't fopen", "Unable to open file"); - result = stbi_is_16_bit_from_file(f); - fclose(f); - return result; -} - -STBIDEF int stbi_is_16_bit_from_file(FILE *f) -{ - int r; - stbi__context s; - long pos = ftell(f); - stbi__start_file(&s, f); - r = stbi__is_16_main(&s); - fseek(f,pos,SEEK_SET); - return r; -} -#endif // !STBI_NO_STDIO - -STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp) -{ - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__info_main(&s,x,y,comp); -} - -STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp) -{ - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user); - return stbi__info_main(&s,x,y,comp); -} - -STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len) -{ - stbi__context s; - stbi__start_mem(&s,buffer,len); - return stbi__is_16_main(&s); -} - -STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *c, void *user) -{ - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user); - return stbi__is_16_main(&s); -} - -#endif // STB_IMAGE_IMPLEMENTATION - -/* - revision history: - 2.20 (2019-02-07) support utf8 filenames in Windows; fix warnings and platform ifdefs - 2.19 (2018-02-11) fix warning - 2.18 (2018-01-30) fix warnings - 2.17 (2018-01-29) change sbti__shiftsigned to avoid clang -O2 bug - 1-bit BMP - *_is_16_bit api - avoid warnings - 2.16 (2017-07-23) all functions have 16-bit variants; - STBI_NO_STDIO works again; - compilation fixes; - fix rounding in unpremultiply; - optimize vertical flip; - disable raw_len validation; - documentation fixes - 2.15 (2017-03-18) fix png-1,2,4 bug; now all Imagenet JPGs decode; - warning fixes; disable run-time SSE detection on gcc; - uniform handling of optional "return" values; - thread-safe initialization of zlib tables - 2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs - 2.13 (2016-11-29) add 16-bit API, only supported for PNG right now - 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes - 2.11 (2016-04-02) allocate large structures on the stack - remove white matting for transparent PSD - fix reported channel count for PNG & BMP - re-enable SSE2 in non-gcc 64-bit - support RGB-formatted JPEG - read 16-bit PNGs (only as 8-bit) - 2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED - 2.09 (2016-01-16) allow comments in PNM files - 16-bit-per-pixel TGA (not bit-per-component) - info() for TGA could break due to .hdr handling - info() for BMP to shares code instead of sloppy parse - can use STBI_REALLOC_SIZED if allocator doesn't support realloc - code cleanup - 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA - 2.07 (2015-09-13) fix compiler warnings - partial animated GIF support - limited 16-bpc PSD support - #ifdef unused functions - bug with < 92 byte PIC,PNM,HDR,TGA - 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value - 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning - 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit - 2.03 (2015-04-12) extra corruption checking (mmozeiko) - stbi_set_flip_vertically_on_load (nguillemot) - fix NEON support; fix mingw support - 2.02 (2015-01-19) fix incorrect assert, fix warning - 2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2 - 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG - 2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg) - progressive JPEG (stb) - PGM/PPM support (Ken Miller) - STBI_MALLOC,STBI_REALLOC,STBI_FREE - GIF bugfix -- seemingly never worked - STBI_NO_*, STBI_ONLY_* - 1.48 (2014-12-14) fix incorrectly-named assert() - 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb) - optimize PNG (ryg) - fix bug in interlaced PNG with user-specified channel count (stb) - 1.46 (2014-08-26) - fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG - 1.45 (2014-08-16) - fix MSVC-ARM internal compiler error by wrapping malloc - 1.44 (2014-08-07) - various warning fixes from Ronny Chevalier - 1.43 (2014-07-15) - fix MSVC-only compiler problem in code changed in 1.42 - 1.42 (2014-07-09) - don't define _CRT_SECURE_NO_WARNINGS (affects user code) - fixes to stbi__cleanup_jpeg path - added STBI_ASSERT to avoid requiring assert.h - 1.41 (2014-06-25) - fix search&replace from 1.36 that messed up comments/error messages - 1.40 (2014-06-22) - fix gcc struct-initialization warning - 1.39 (2014-06-15) - fix to TGA optimization when req_comp != number of components in TGA; - fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite) - add support for BMP version 5 (more ignored fields) - 1.38 (2014-06-06) - suppress MSVC warnings on integer casts truncating values - fix accidental rename of 'skip' field of I/O - 1.37 (2014-06-04) - remove duplicate typedef - 1.36 (2014-06-03) - convert to header file single-file library - if de-iphone isn't set, load iphone images color-swapped instead of returning NULL - 1.35 (2014-05-27) - various warnings - fix broken STBI_SIMD path - fix bug where stbi_load_from_file no longer left file pointer in correct place - fix broken non-easy path for 32-bit BMP (possibly never used) - TGA optimization by Arseny Kapoulkine - 1.34 (unknown) - use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case - 1.33 (2011-07-14) - make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements - 1.32 (2011-07-13) - support for "info" function for all supported filetypes (SpartanJ) - 1.31 (2011-06-20) - a few more leak fixes, bug in PNG handling (SpartanJ) - 1.30 (2011-06-11) - added ability to load files via callbacks to accomidate custom input streams (Ben Wenger) - removed deprecated format-specific test/load functions - removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway - error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha) - fix inefficiency in decoding 32-bit BMP (David Woo) - 1.29 (2010-08-16) - various warning fixes from Aurelien Pocheville - 1.28 (2010-08-01) - fix bug in GIF palette transparency (SpartanJ) - 1.27 (2010-08-01) - cast-to-stbi_uc to fix warnings - 1.26 (2010-07-24) - fix bug in file buffering for PNG reported by SpartanJ - 1.25 (2010-07-17) - refix trans_data warning (Won Chun) - 1.24 (2010-07-12) - perf improvements reading from files on platforms with lock-heavy fgetc() - minor perf improvements for jpeg - deprecated type-specific functions so we'll get feedback if they're needed - attempt to fix trans_data warning (Won Chun) - 1.23 fixed bug in iPhone support - 1.22 (2010-07-10) - removed image *writing* support - stbi_info support from Jetro Lauha - GIF support from Jean-Marc Lienher - iPhone PNG-extensions from James Brown - warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva) - 1.21 fix use of 'stbi_uc' in header (reported by jon blow) - 1.20 added support for Softimage PIC, by Tom Seddon - 1.19 bug in interlaced PNG corruption check (found by ryg) - 1.18 (2008-08-02) - fix a threading bug (local mutable static) - 1.17 support interlaced PNG - 1.16 major bugfix - stbi__convert_format converted one too many pixels - 1.15 initialize some fields for thread safety - 1.14 fix threadsafe conversion bug - header-file-only version (#define STBI_HEADER_FILE_ONLY before including) - 1.13 threadsafe - 1.12 const qualifiers in the API - 1.11 Support installable IDCT, colorspace conversion routines - 1.10 Fixes for 64-bit (don't use "unsigned long") - optimized upsampling by Fabian "ryg" Giesen - 1.09 Fix format-conversion for PSD code (bad global variables!) - 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz - 1.07 attempt to fix C++ warning/errors again - 1.06 attempt to fix C++ warning/errors again - 1.05 fix TGA loading to return correct *comp and use good luminance calc - 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free - 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR - 1.02 support for (subset of) HDR files, float interface for preferred access to them - 1.01 fix bug: possible bug in handling right-side up bmps... not sure - fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all - 1.00 interface to zlib that skips zlib header - 0.99 correct handling of alpha in palette - 0.98 TGA loader by lonesock; dynamically add loaders (untested) - 0.97 jpeg errors on too large a file; also catch another malloc failure - 0.96 fix detection of invalid v value - particleman@mollyrocket forum - 0.95 during header scan, seek to markers in case of padding - 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same - 0.93 handle jpegtran output; verbose errors - 0.92 read 4,8,16,24,32-bit BMP files of several formats - 0.91 output 24-bit Windows 3.0 BMP files - 0.90 fix a few more warnings; bump version number to approach 1.0 - 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd - 0.60 fix compiling as c++ - 0.59 fix warnings: merge Dave Moore's -Wall fixes - 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian - 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available - 0.56 fix bug: zlib uncompressed mode len vs. nlen - 0.55 fix bug: restart_interval not initialized to 0 - 0.54 allow NULL for 'int *comp' - 0.53 fix bug in png 3->4; speedup png decoding - 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments - 0.51 obey req_comp requests, 1-component jpegs return as 1-component, - on 'test' only check type, not whether we support this variant - 0.50 (2006-11-19) - first released version -*/ - - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_image_resize.h b/FCLauncher/src/main/jni/lwjgl/stb/stb_image_resize.h deleted file mode 100644 index ef9e6fe8..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_image_resize.h +++ /dev/null @@ -1,2634 +0,0 @@ -/* stb_image_resize - v0.97 - public domain image resizing - by Jorge L Rodriguez (@VinoBS) - 2014 - http://github.com/nothings/stb - - 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. - - COMPILING & LINKING - In one C/C++ file that #includes this file, do this: - #define STB_IMAGE_RESIZE_IMPLEMENTATION - before the #include. That will create the implementation in that file. - - 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 - - FULL API - See the "header file" section of the source for API documentation. - - ADDITIONAL DOCUMENTATION - - SRGB & FLOATING POINT REPRESENTATION - The sRGB functions presume IEEE floating point. If you do not have - IEEE floating point, define STBIR_NON_IEEE_FLOAT. This will use - a slower implementation. - - MEMORY ALLOCATION - The resize functions here perform a single memory allocation using - malloc. To control the memory allocation, before the #include that - triggers the implementation, do: - - #define STBIR_MALLOC(size,context) ... - #define STBIR_FREE(ptr,context) ... - - Each resize function makes exactly one call to malloc/free, so to use - temp memory, store the temp memory in the context and return that. - - ASSERT - Define STBIR_ASSERT(boolval) to override assert() and not use assert.h - - OPTIMIZATION - Define STBIR_SATURATE_INT to compute clamp values in-range using - integer operations instead of float operations. This may be faster - on some platforms. - - DEFAULT FILTERS - For functions which don't provide explicit control over what filters - to use, you can change the compile-time defaults with - - #define STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_something - #define STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_something - - See stbir_filter in the header-file section for the list of filters. - - NEW FILTERS - A number of 1D filter kernels are used. For a list of - supported filters see the stbir_filter enum. To add a new filter, - write a filter function and add it to stbir__filter_info_table. - - PROGRESS - For interactive use with slow resize operations, you can install - a progress-report callback: - - #define STBIR_PROGRESS_REPORT(val) some_func(val) - - The parameter val is a float which goes from 0 to 1 as progress is made. - - For example: - - static void my_progress_report(float progress); - #define STBIR_PROGRESS_REPORT(val) my_progress_report(val) - - #define STB_IMAGE_RESIZE_IMPLEMENTATION - #include "stb_image_resize.h" - - static void my_progress_report(float progress) - { - printf("Progress: %f%%\n", progress*100); - } - - MAX CHANNELS - If your image has more than 64 channels, define STBIR_MAX_CHANNELS - to the max you'll have. - - 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 50/50 average of 99% transparent bright green - and 1% transparent 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. Artists should not edit premultiplied-alpha images; artists - want non-premultiplied alpha images. Thus, art tools generally output - non-premultiplied alpha images. - - 3. You will get best results in most cases by converting images - to premultiplied alpha before processing them mathematically. - - 4. If you pass the flag STBIR_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. - - 5. If you do not pass the flag STBIR_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 alpha=0 do - not contribute at all to output pixels unless _all_ of the input - pixels affecting that output pixel have alpha=0, in which case - the result for that pixel is the same as it would be without - STBIR_FLAG_ALPHA_PREMULTIPLIED. However, this is only true for - input images in integer formats. For input images in float format, - input pixels with alpha=0 have no effect, and output pixels - which have 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.) - - 6. You can suppress the behavior described in #5 and make - all-0-alpha pixels have 0 in all channels by #defining - STBIR_NO_ALPHA_EPSILON. - - 7. 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.) - - CONTRIBUTORS - Jorge L Rodriguez: Implementation - Sean Barrett: API design, optimizations - Aras Pranckevicius: bugfix - Nathan Reed: warning fixes - - REVISIONS - 0.97 (2020-02-02) fixed warning - 0.96 (2019-03-04) fixed warnings - 0.95 (2017-07-23) fixed warnings - 0.94 (2017-03-18) fixed warnings - 0.93 (2017-03-03) fixed bug with certain combinations of heights - 0.92 (2017-01-02) fix integer overflow on large (>2GB) images - 0.91 (2016-04-02) fix warnings; fix handling of subpixel regions - 0.90 (2014-09-17) first released version - - LICENSE - See end of file for license information. - - TODO - Don't decode all of the image data when only processing a partial tile - Don't use full-width decode buffers when only processing a partial tile - When processing wide images, break processing into tiles so data fits in L1 cache - Installable filters? - Resize that respects alpha test coverage - (Reference code: FloatImage::alphaTestCoverage and FloatImage::scaleAlphaToCoverage: - https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvimage/FloatImage.cpp ) -*/ - -#ifndef STBIR_INCLUDE_STB_IMAGE_RESIZE_H -#define STBIR_INCLUDE_STB_IMAGE_RESIZE_H - -#ifdef _MSC_VER -typedef unsigned char stbir_uint8; -typedef unsigned short stbir_uint16; -typedef unsigned int stbir_uint32; -#else -#include -typedef uint8_t stbir_uint8; -typedef uint16_t stbir_uint16; -typedef uint32_t stbir_uint32; -#endif - -#ifndef STBIRDEF -#ifdef STB_IMAGE_RESIZE_STATIC -#define STBIRDEF static -#else -#ifdef __cplusplus -#define STBIRDEF extern "C" -#else -#define STBIRDEF extern -#endif -#endif -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// Easy-to-use API: -// -// * "input pixels" points to an array of image data with 'num_channels' channels (e.g. RGB=3, RGBA=4) -// * input_w is input image width (x-axis), input_h is input image height (y-axis) -// * stride is the offset between successive rows of image data in memory, in bytes. you can -// specify 0 to mean packed continuously in memory -// * alpha channel is treated identically to other channels. -// * colorspace is linear or sRGB as specified by function name -// * returned result is 1 for success or 0 in case of an error. -// #define STBIR_ASSERT() to trigger an assert on parameter validation errors. -// * Memory required grows approximately linearly with input and output size, but with -// discontinuities at input_w == output_w and input_h == output_h. -// * These functions use a "default" resampling filter defined at compile time. To change the filter, -// you can change the compile-time defaults by #defining STBIR_DEFAULT_FILTER_UPSAMPLE -// and STBIR_DEFAULT_FILTER_DOWNSAMPLE, or you can use the medium-complexity API. - -STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels); - -STBIRDEF int stbir_resize_float( const 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); - - -// The following functions interpret image data as gamma-corrected sRGB. -// Specify STBIR_ALPHA_CHANNEL_NONE if you have no alpha channel, -// or otherwise provide the index of the alpha channel. Flags value -// of 0 will probably do the right thing if you're not sure what -// the flags mean. - -#define 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). -#define STBIR_FLAG_ALPHA_PREMULTIPLIED (1 << 0) -// The specified alpha channel should be handled as gamma-corrected value even -// when doing sRGB operations. -#define STBIR_FLAG_ALPHA_USES_COLORSPACE (1 << 1) - -STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags); - - -typedef enum -{ - STBIR_EDGE_CLAMP = 1, - STBIR_EDGE_REFLECT = 2, - STBIR_EDGE_WRAP = 3, - STBIR_EDGE_ZERO = 4, -} stbir_edge; - -// This function adds the ability to specify how requests to sample off the edge of the image are handled. -STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode); - -////////////////////////////////////////////////////////////////////////////// -// -// Medium-complexity API -// -// This extends the easy-to-use API as follows: -// -// * Alpha-channel can be processed separately -// * If alpha_channel is not STBIR_ALPHA_CHANNEL_NONE -// * Alpha channel will not be gamma corrected (unless flags&STBIR_FLAG_GAMMA_CORRECT) -// * Filters will be weighted by alpha channel (unless flags&STBIR_FLAG_ALPHA_PREMULTIPLIED) -// * Filter can be selected explicitly -// * uint16 image type -// * sRGB colorspace available for all types -// * context parameter for passing to STBIR_MALLOC - -typedef enum -{ - STBIR_FILTER_DEFAULT = 0, // use same filter type that easy-to-use API chooses - STBIR_FILTER_BOX = 1, // A trapezoid w/1-pixel wide ramps, same result as box for integer scale ratios - STBIR_FILTER_TRIANGLE = 2, // On upsampling, produces same results as bilinear texture filtering - STBIR_FILTER_CUBICBSPLINE = 3, // The cubic b-spline (aka Mitchell-Netrevalli with B=1,C=0), gaussian-esque - STBIR_FILTER_CATMULLROM = 4, // An interpolating cubic spline - STBIR_FILTER_MITCHELL = 5, // Mitchell-Netrevalli filter with B=1/3, C=1/3 -} stbir_filter; - -typedef enum -{ - STBIR_COLORSPACE_LINEAR, - STBIR_COLORSPACE_SRGB, - - STBIR_MAX_COLORSPACES, -} stbir_colorspace; - -// The following functions are all identical except for the type of the image data - -STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - -STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - -STBIRDEF int stbir_resize_float_generic( const 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, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - - - -////////////////////////////////////////////////////////////////////////////// -// -// Full-complexity API -// -// This extends the medium API as follows: -// -// * uint32 image type -// * not typesafe -// * separate filter types for each axis -// * separate edge modes for each axis -// * can specify scale explicitly for subpixel correctness -// * can specify image source tile using texture coordinates - -typedef enum -{ - STBIR_TYPE_UINT8 , - STBIR_TYPE_UINT16, - STBIR_TYPE_UINT32, - STBIR_TYPE_FLOAT , - - STBIR_MAX_TYPES -} stbir_datatype; - -STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context); - -STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float x_scale, float y_scale, - float x_offset, float y_offset); - -STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float s0, float t0, float s1, float t1); -// (s0, t0) & (s1, t1) are the top-left and bottom right corner (uv addressing style: [0, 1]x[0, 1]) of a region of the input image to use. - -// -// -//// end header file ///////////////////////////////////////////////////// -#endif // STBIR_INCLUDE_STB_IMAGE_RESIZE_H - - - - - -#ifdef STB_IMAGE_RESIZE_IMPLEMENTATION - -#ifndef STBIR_ASSERT -#include -#define STBIR_ASSERT(x) assert(x) -#endif - -// For memset -#include - -#include - -#ifndef STBIR_MALLOC -#include -// use comma operator to evaluate c, to avoid "unused parameter" warnings -#define STBIR_MALLOC(size,c) ((void)(c), malloc(size)) -#define STBIR_FREE(ptr,c) ((void)(c), free(ptr)) -#endif - -#ifndef _MSC_VER -#ifdef __cplusplus -#define stbir__inline inline -#else -#define stbir__inline -#endif -#else -#define stbir__inline __forceinline -#endif - - -// should produce compiler error if size is wrong -typedef unsigned char stbir__validate_uint32[sizeof(stbir_uint32) == 4 ? 1 : -1]; - -#ifdef _MSC_VER -#define STBIR__NOTUSED(v) (void)(v) -#else -#define STBIR__NOTUSED(v) (void)sizeof(v) -#endif - -#define STBIR__ARRAY_SIZE(a) (sizeof((a))/sizeof((a)[0])) - -#ifndef STBIR_DEFAULT_FILTER_UPSAMPLE -#define STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM -#endif - -#ifndef STBIR_DEFAULT_FILTER_DOWNSAMPLE -#define STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_MITCHELL -#endif - -#ifndef STBIR_PROGRESS_REPORT -#define STBIR_PROGRESS_REPORT(float_0_to_1) -#endif - -#ifndef STBIR_MAX_CHANNELS -#define STBIR_MAX_CHANNELS 64 -#endif - -#if STBIR_MAX_CHANNELS > 65536 -#error "Too many channels; STBIR_MAX_CHANNELS must be no more than 65536." -// because we store the indices in 16-bit variables -#endif - -// This value is added to alpha just before premultiplication to avoid -// zeroing out color values. It is equivalent to 2^-80. If you don't want -// that behavior (it may interfere if you have floating point images with -// very small alpha values) then you can define STBIR_NO_ALPHA_EPSILON to -// disable it. -#ifndef STBIR_ALPHA_EPSILON -#define STBIR_ALPHA_EPSILON ((float)1 / (1 << 20) / (1 << 20) / (1 << 20) / (1 << 20)) -#endif - - - -#ifdef _MSC_VER -#define STBIR__UNUSED_PARAM(v) (void)(v) -#else -#define STBIR__UNUSED_PARAM(v) (void)sizeof(v) -#endif - -// must match stbir_datatype -static unsigned char stbir__type_size[] = { - 1, // STBIR_TYPE_UINT8 - 2, // STBIR_TYPE_UINT16 - 4, // STBIR_TYPE_UINT32 - 4, // STBIR_TYPE_FLOAT -}; - -// Kernel function centered at 0 -typedef float (stbir__kernel_fn)(float x, float scale); -typedef float (stbir__support_fn)(float scale); - -typedef struct -{ - stbir__kernel_fn* kernel; - stbir__support_fn* support; -} stbir__filter_info; - -// When upsampling, the contributors are which source pixels contribute. -// When downsampling, the contributors are which destination pixels are contributed to. -typedef struct -{ - int n0; // First contributing pixel - int n1; // Last contributing pixel -} stbir__contributors; - -typedef struct -{ - const void* input_data; - int input_w; - int input_h; - int input_stride_bytes; - - void* output_data; - int output_w; - int output_h; - int output_stride_bytes; - - float s0, t0, s1, t1; - - float horizontal_shift; // Units: output pixels - float vertical_shift; // Units: output pixels - float horizontal_scale; - float vertical_scale; - - int channels; - int alpha_channel; - stbir_uint32 flags; - stbir_datatype type; - stbir_filter horizontal_filter; - stbir_filter vertical_filter; - stbir_edge edge_horizontal; - stbir_edge edge_vertical; - stbir_colorspace colorspace; - - stbir__contributors* horizontal_contributors; - float* horizontal_coefficients; - - stbir__contributors* vertical_contributors; - float* vertical_coefficients; - - int decode_buffer_pixels; - float* decode_buffer; - - float* horizontal_buffer; - - // cache these because ceil/floor are inexplicably showing up in profile - int horizontal_coefficient_width; - int vertical_coefficient_width; - int horizontal_filter_pixel_width; - int vertical_filter_pixel_width; - int horizontal_filter_pixel_margin; - int vertical_filter_pixel_margin; - int horizontal_num_contributors; - int vertical_num_contributors; - - int ring_buffer_length_bytes; // The length of an individual entry in the ring buffer. The total number of ring buffers is stbir__get_filter_pixel_width(filter) - int ring_buffer_num_entries; // Total number of entries in the ring buffer. - int ring_buffer_first_scanline; - int ring_buffer_last_scanline; - int ring_buffer_begin_index; // first_scanline is at this index in the ring buffer - float* ring_buffer; - - float* encode_buffer; // A temporary buffer to store floats so we don't lose precision while we do multiply-adds. - - int horizontal_contributors_size; - int horizontal_coefficients_size; - int vertical_contributors_size; - int vertical_coefficients_size; - int decode_buffer_size; - int horizontal_buffer_size; - int ring_buffer_size; - int encode_buffer_size; -} stbir__info; - - -static const float stbir__max_uint8_as_float = 255.0f; -static const float stbir__max_uint16_as_float = 65535.0f; -static const double stbir__max_uint32_as_float = 4294967295.0; - - -static stbir__inline int stbir__min(int a, int b) -{ - return a < b ? a : b; -} - -static stbir__inline float stbir__saturate(float x) -{ - if (x < 0) - return 0; - - if (x > 1) - return 1; - - return x; -} - -#ifdef STBIR_SATURATE_INT -static stbir__inline stbir_uint8 stbir__saturate8(int x) -{ - if ((unsigned int) x <= 255) - return x; - - if (x < 0) - return 0; - - return 255; -} - -static stbir__inline stbir_uint16 stbir__saturate16(int x) -{ - if ((unsigned int) x <= 65535) - return x; - - if (x < 0) - return 0; - - return 65535; -} -#endif - -static float stbir__srgb_uchar_to_linear_float[256] = { - 0.000000f, 0.000304f, 0.000607f, 0.000911f, 0.001214f, 0.001518f, 0.001821f, 0.002125f, 0.002428f, 0.002732f, 0.003035f, - 0.003347f, 0.003677f, 0.004025f, 0.004391f, 0.004777f, 0.005182f, 0.005605f, 0.006049f, 0.006512f, 0.006995f, 0.007499f, - 0.008023f, 0.008568f, 0.009134f, 0.009721f, 0.010330f, 0.010960f, 0.011612f, 0.012286f, 0.012983f, 0.013702f, 0.014444f, - 0.015209f, 0.015996f, 0.016807f, 0.017642f, 0.018500f, 0.019382f, 0.020289f, 0.021219f, 0.022174f, 0.023153f, 0.024158f, - 0.025187f, 0.026241f, 0.027321f, 0.028426f, 0.029557f, 0.030713f, 0.031896f, 0.033105f, 0.034340f, 0.035601f, 0.036889f, - 0.038204f, 0.039546f, 0.040915f, 0.042311f, 0.043735f, 0.045186f, 0.046665f, 0.048172f, 0.049707f, 0.051269f, 0.052861f, - 0.054480f, 0.056128f, 0.057805f, 0.059511f, 0.061246f, 0.063010f, 0.064803f, 0.066626f, 0.068478f, 0.070360f, 0.072272f, - 0.074214f, 0.076185f, 0.078187f, 0.080220f, 0.082283f, 0.084376f, 0.086500f, 0.088656f, 0.090842f, 0.093059f, 0.095307f, - 0.097587f, 0.099899f, 0.102242f, 0.104616f, 0.107023f, 0.109462f, 0.111932f, 0.114435f, 0.116971f, 0.119538f, 0.122139f, - 0.124772f, 0.127438f, 0.130136f, 0.132868f, 0.135633f, 0.138432f, 0.141263f, 0.144128f, 0.147027f, 0.149960f, 0.152926f, - 0.155926f, 0.158961f, 0.162029f, 0.165132f, 0.168269f, 0.171441f, 0.174647f, 0.177888f, 0.181164f, 0.184475f, 0.187821f, - 0.191202f, 0.194618f, 0.198069f, 0.201556f, 0.205079f, 0.208637f, 0.212231f, 0.215861f, 0.219526f, 0.223228f, 0.226966f, - 0.230740f, 0.234551f, 0.238398f, 0.242281f, 0.246201f, 0.250158f, 0.254152f, 0.258183f, 0.262251f, 0.266356f, 0.270498f, - 0.274677f, 0.278894f, 0.283149f, 0.287441f, 0.291771f, 0.296138f, 0.300544f, 0.304987f, 0.309469f, 0.313989f, 0.318547f, - 0.323143f, 0.327778f, 0.332452f, 0.337164f, 0.341914f, 0.346704f, 0.351533f, 0.356400f, 0.361307f, 0.366253f, 0.371238f, - 0.376262f, 0.381326f, 0.386430f, 0.391573f, 0.396755f, 0.401978f, 0.407240f, 0.412543f, 0.417885f, 0.423268f, 0.428691f, - 0.434154f, 0.439657f, 0.445201f, 0.450786f, 0.456411f, 0.462077f, 0.467784f, 0.473532f, 0.479320f, 0.485150f, 0.491021f, - 0.496933f, 0.502887f, 0.508881f, 0.514918f, 0.520996f, 0.527115f, 0.533276f, 0.539480f, 0.545725f, 0.552011f, 0.558340f, - 0.564712f, 0.571125f, 0.577581f, 0.584078f, 0.590619f, 0.597202f, 0.603827f, 0.610496f, 0.617207f, 0.623960f, 0.630757f, - 0.637597f, 0.644480f, 0.651406f, 0.658375f, 0.665387f, 0.672443f, 0.679543f, 0.686685f, 0.693872f, 0.701102f, 0.708376f, - 0.715694f, 0.723055f, 0.730461f, 0.737911f, 0.745404f, 0.752942f, 0.760525f, 0.768151f, 0.775822f, 0.783538f, 0.791298f, - 0.799103f, 0.806952f, 0.814847f, 0.822786f, 0.830770f, 0.838799f, 0.846873f, 0.854993f, 0.863157f, 0.871367f, 0.879622f, - 0.887923f, 0.896269f, 0.904661f, 0.913099f, 0.921582f, 0.930111f, 0.938686f, 0.947307f, 0.955974f, 0.964686f, 0.973445f, - 0.982251f, 0.991102f, 1.0f -}; - -static float stbir__srgb_to_linear(float f) -{ - if (f <= 0.04045f) - return f / 12.92f; - else - return (float)pow((f + 0.055f) / 1.055f, 2.4f); -} - -static float stbir__linear_to_srgb(float f) -{ - if (f <= 0.0031308f) - return f * 12.92f; - else - return 1.055f * (float)pow(f, 1 / 2.4f) - 0.055f; -} - -#ifndef STBIR_NON_IEEE_FLOAT -// From https://gist.github.com/rygorous/2203834 - -typedef union -{ - stbir_uint32 u; - float f; -} stbir__FP32; - -static const stbir_uint32 fp32_to_srgb8_tab4[104] = { - 0x0073000d, 0x007a000d, 0x0080000d, 0x0087000d, 0x008d000d, 0x0094000d, 0x009a000d, 0x00a1000d, - 0x00a7001a, 0x00b4001a, 0x00c1001a, 0x00ce001a, 0x00da001a, 0x00e7001a, 0x00f4001a, 0x0101001a, - 0x010e0033, 0x01280033, 0x01410033, 0x015b0033, 0x01750033, 0x018f0033, 0x01a80033, 0x01c20033, - 0x01dc0067, 0x020f0067, 0x02430067, 0x02760067, 0x02aa0067, 0x02dd0067, 0x03110067, 0x03440067, - 0x037800ce, 0x03df00ce, 0x044600ce, 0x04ad00ce, 0x051400ce, 0x057b00c5, 0x05dd00bc, 0x063b00b5, - 0x06970158, 0x07420142, 0x07e30130, 0x087b0120, 0x090b0112, 0x09940106, 0x0a1700fc, 0x0a9500f2, - 0x0b0f01cb, 0x0bf401ae, 0x0ccb0195, 0x0d950180, 0x0e56016e, 0x0f0d015e, 0x0fbc0150, 0x10630143, - 0x11070264, 0x1238023e, 0x1357021d, 0x14660201, 0x156601e9, 0x165a01d3, 0x174401c0, 0x182401af, - 0x18fe0331, 0x1a9602fe, 0x1c1502d2, 0x1d7e02ad, 0x1ed4028d, 0x201a0270, 0x21520256, 0x227d0240, - 0x239f0443, 0x25c003fe, 0x27bf03c4, 0x29a10392, 0x2b6a0367, 0x2d1d0341, 0x2ebe031f, 0x304d0300, - 0x31d105b0, 0x34a80555, 0x37520507, 0x39d504c5, 0x3c37048b, 0x3e7c0458, 0x40a8042a, 0x42bd0401, - 0x44c20798, 0x488e071e, 0x4c1c06b6, 0x4f76065d, 0x52a50610, 0x55ac05cc, 0x5892058f, 0x5b590559, - 0x5e0c0a23, 0x631c0980, 0x67db08f6, 0x6c55087f, 0x70940818, 0x74a007bd, 0x787d076c, 0x7c330723, -}; - -static stbir_uint8 stbir__linear_to_srgb_uchar(float in) -{ - static const stbir__FP32 almostone = { 0x3f7fffff }; // 1-eps - static const stbir__FP32 minval = { (127-13) << 23 }; - stbir_uint32 tab,bias,scale,t; - stbir__FP32 f; - - // Clamp to [2^(-13), 1-eps]; these two values map to 0 and 1, respectively. - // The tests are carefully written so that NaNs map to 0, same as in the reference - // implementation. - if (!(in > minval.f)) // written this way to catch NaNs - in = minval.f; - if (in > almostone.f) - in = almostone.f; - - // Do the table lookup and unpack bias, scale - f.f = in; - tab = fp32_to_srgb8_tab4[(f.u - minval.u) >> 20]; - bias = (tab >> 16) << 9; - scale = tab & 0xffff; - - // Grab next-highest mantissa bits and perform linear interpolation - t = (f.u >> 12) & 0xff; - return (unsigned char) ((bias + scale*t) >> 16); -} - -#else -// sRGB transition values, scaled by 1<<28 -static int stbir__srgb_offset_to_linear_scaled[256] = -{ - 0, 40738, 122216, 203693, 285170, 366648, 448125, 529603, - 611080, 692557, 774035, 855852, 942009, 1033024, 1128971, 1229926, - 1335959, 1447142, 1563542, 1685229, 1812268, 1944725, 2082664, 2226148, - 2375238, 2529996, 2690481, 2856753, 3028870, 3206888, 3390865, 3580856, - 3776916, 3979100, 4187460, 4402049, 4622919, 4850123, 5083710, 5323731, - 5570236, 5823273, 6082892, 6349140, 6622065, 6901714, 7188133, 7481369, - 7781466, 8088471, 8402427, 8723380, 9051372, 9386448, 9728650, 10078021, - 10434603, 10798439, 11169569, 11548036, 11933879, 12327139, 12727857, 13136073, - 13551826, 13975156, 14406100, 14844697, 15290987, 15745007, 16206795, 16676389, - 17153826, 17639142, 18132374, 18633560, 19142734, 19659934, 20185196, 20718552, - 21260042, 21809696, 22367554, 22933648, 23508010, 24090680, 24681686, 25281066, - 25888850, 26505076, 27129772, 27762974, 28404716, 29055026, 29713942, 30381490, - 31057708, 31742624, 32436272, 33138682, 33849884, 34569912, 35298800, 36036568, - 36783260, 37538896, 38303512, 39077136, 39859796, 40651528, 41452360, 42262316, - 43081432, 43909732, 44747252, 45594016, 46450052, 47315392, 48190064, 49074096, - 49967516, 50870356, 51782636, 52704392, 53635648, 54576432, 55526772, 56486700, - 57456236, 58435408, 59424248, 60422780, 61431036, 62449032, 63476804, 64514376, - 65561776, 66619028, 67686160, 68763192, 69850160, 70947088, 72053992, 73170912, - 74297864, 75434880, 76581976, 77739184, 78906536, 80084040, 81271736, 82469648, - 83677792, 84896192, 86124888, 87363888, 88613232, 89872928, 91143016, 92423512, - 93714432, 95015816, 96327688, 97650056, 98982952, 100326408, 101680440, 103045072, - 104420320, 105806224, 107202800, 108610064, 110028048, 111456776, 112896264, 114346544, - 115807632, 117279552, 118762328, 120255976, 121760536, 123276016, 124802440, 126339832, - 127888216, 129447616, 131018048, 132599544, 134192112, 135795792, 137410592, 139036528, - 140673648, 142321952, 143981456, 145652208, 147334208, 149027488, 150732064, 152447968, - 154175200, 155913792, 157663776, 159425168, 161197984, 162982240, 164777968, 166585184, - 168403904, 170234160, 172075968, 173929344, 175794320, 177670896, 179559120, 181458992, - 183370528, 185293776, 187228736, 189175424, 191133888, 193104112, 195086128, 197079968, - 199085648, 201103184, 203132592, 205173888, 207227120, 209292272, 211369392, 213458480, - 215559568, 217672656, 219797792, 221934976, 224084240, 226245600, 228419056, 230604656, - 232802400, 235012320, 237234432, 239468736, 241715280, 243974080, 246245120, 248528464, - 250824112, 253132064, 255452368, 257785040, 260130080, 262487520, 264857376, 267239664, -}; - -static stbir_uint8 stbir__linear_to_srgb_uchar(float f) -{ - int x = (int) (f * (1 << 28)); // has headroom so you don't need to clamp - int v = 0; - int i; - - // Refine the guess with a short binary search. - i = v + 128; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 64; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 32; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 16; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 8; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 4; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 2; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - i = v + 1; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i; - - return (stbir_uint8) v; -} -#endif - -static float stbir__filter_trapezoid(float x, float scale) -{ - float halfscale = scale / 2; - float t = 0.5f + halfscale; - STBIR_ASSERT(scale <= 1); - - x = (float)fabs(x); - - if (x >= t) - return 0; - else - { - float r = 0.5f - halfscale; - if (x <= r) - return 1; - else - return (t - x) / scale; - } -} - -static float stbir__support_trapezoid(float scale) -{ - STBIR_ASSERT(scale <= 1); - return 0.5f + scale / 2; -} - -static float stbir__filter_triangle(float x, float s) -{ - STBIR__UNUSED_PARAM(s); - - x = (float)fabs(x); - - if (x <= 1.0f) - return 1 - x; - else - return 0; -} - -static float stbir__filter_cubic(float x, float s) -{ - STBIR__UNUSED_PARAM(s); - - x = (float)fabs(x); - - if (x < 1.0f) - return (4 + x*x*(3*x - 6))/6; - else if (x < 2.0f) - return (8 + x*(-12 + x*(6 - x)))/6; - - return (0.0f); -} - -static float stbir__filter_catmullrom(float x, float s) -{ - STBIR__UNUSED_PARAM(s); - - x = (float)fabs(x); - - if (x < 1.0f) - return 1 - x*x*(2.5f - 1.5f*x); - else if (x < 2.0f) - return 2 - x*(4 + x*(0.5f*x - 2.5f)); - - return (0.0f); -} - -static float stbir__filter_mitchell(float x, float s) -{ - STBIR__UNUSED_PARAM(s); - - x = (float)fabs(x); - - if (x < 1.0f) - return (16 + x*x*(21 * x - 36))/18; - else if (x < 2.0f) - return (32 + x*(-60 + x*(36 - 7*x)))/18; - - return (0.0f); -} - -static float stbir__support_zero(float s) -{ - STBIR__UNUSED_PARAM(s); - return 0; -} - -static float stbir__support_one(float s) -{ - STBIR__UNUSED_PARAM(s); - return 1; -} - -static float stbir__support_two(float s) -{ - STBIR__UNUSED_PARAM(s); - return 2; -} - -static stbir__filter_info stbir__filter_info_table[] = { - { NULL, stbir__support_zero }, - { stbir__filter_trapezoid, stbir__support_trapezoid }, - { stbir__filter_triangle, stbir__support_one }, - { stbir__filter_cubic, stbir__support_two }, - { stbir__filter_catmullrom, stbir__support_two }, - { stbir__filter_mitchell, stbir__support_two }, -}; - -stbir__inline static int stbir__use_upsampling(float ratio) -{ - return ratio > 1; -} - -stbir__inline static int stbir__use_width_upsampling(stbir__info* stbir_info) -{ - return stbir__use_upsampling(stbir_info->horizontal_scale); -} - -stbir__inline static int stbir__use_height_upsampling(stbir__info* stbir_info) -{ - return stbir__use_upsampling(stbir_info->vertical_scale); -} - -// This is the maximum number of input samples that can affect an output sample -// with the given filter -static int stbir__get_filter_pixel_width(stbir_filter filter, float scale) -{ - STBIR_ASSERT(filter != 0); - STBIR_ASSERT(filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); - - if (stbir__use_upsampling(scale)) - return (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2); - else - return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2 / scale); -} - -// This is how much to expand buffers to account for filters seeking outside -// the image boundaries. -static int stbir__get_filter_pixel_margin(stbir_filter filter, float scale) -{ - return stbir__get_filter_pixel_width(filter, scale) / 2; -} - -static int stbir__get_coefficient_width(stbir_filter filter, float scale) -{ - if (stbir__use_upsampling(scale)) - return (int)ceil(stbir__filter_info_table[filter].support(1 / scale) * 2); - else - return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2); -} - -static int stbir__get_contributors(float scale, stbir_filter filter, int input_size, int output_size) -{ - if (stbir__use_upsampling(scale)) - return output_size; - else - return (input_size + stbir__get_filter_pixel_margin(filter, scale) * 2); -} - -static int stbir__get_total_horizontal_coefficients(stbir__info* info) -{ - return info->horizontal_num_contributors - * stbir__get_coefficient_width (info->horizontal_filter, info->horizontal_scale); -} - -static int stbir__get_total_vertical_coefficients(stbir__info* info) -{ - return info->vertical_num_contributors - * stbir__get_coefficient_width (info->vertical_filter, info->vertical_scale); -} - -static stbir__contributors* stbir__get_contributor(stbir__contributors* contributors, int n) -{ - return &contributors[n]; -} - -// For perf reasons this code is duplicated in stbir__resample_horizontal_upsample/downsample, -// if you change it here change it there too. -static float* stbir__get_coefficient(float* coefficients, stbir_filter filter, float scale, int n, int c) -{ - int width = stbir__get_coefficient_width(filter, scale); - return &coefficients[width*n + c]; -} - -static int stbir__edge_wrap_slow(stbir_edge edge, int n, int max) -{ - switch (edge) - { - case STBIR_EDGE_ZERO: - return 0; // we'll decode the wrong pixel here, and then overwrite with 0s later - - case STBIR_EDGE_CLAMP: - if (n < 0) - return 0; - - if (n >= max) - return max - 1; - - return n; // NOTREACHED - - case STBIR_EDGE_REFLECT: - { - if (n < 0) - { - if (n < max) - return -n; - else - return max - 1; - } - - if (n >= max) - { - int max2 = max * 2; - if (n >= max2) - return 0; - else - return max2 - n - 1; - } - - return n; // NOTREACHED - } - - case STBIR_EDGE_WRAP: - if (n >= 0) - return (n % max); - else - { - int m = (-n) % max; - - if (m != 0) - m = max - m; - - return (m); - } - // NOTREACHED - - default: - STBIR_ASSERT(!"Unimplemented edge type"); - return 0; - } -} - -stbir__inline static int stbir__edge_wrap(stbir_edge edge, int n, int max) -{ - // avoid per-pixel switch - if (n >= 0 && n < max) - return n; - return stbir__edge_wrap_slow(edge, n, max); -} - -// What input pixels contribute to this output pixel? -static void stbir__calculate_sample_range_upsample(int n, float out_filter_radius, float scale_ratio, float out_shift, int* in_first_pixel, int* in_last_pixel, float* in_center_of_out) -{ - float out_pixel_center = (float)n + 0.5f; - float out_pixel_influence_lowerbound = out_pixel_center - out_filter_radius; - float out_pixel_influence_upperbound = out_pixel_center + out_filter_radius; - - float in_pixel_influence_lowerbound = (out_pixel_influence_lowerbound + out_shift) / scale_ratio; - float in_pixel_influence_upperbound = (out_pixel_influence_upperbound + out_shift) / scale_ratio; - - *in_center_of_out = (out_pixel_center + out_shift) / scale_ratio; - *in_first_pixel = (int)(floor(in_pixel_influence_lowerbound + 0.5)); - *in_last_pixel = (int)(floor(in_pixel_influence_upperbound - 0.5)); -} - -// What output pixels does this input pixel contribute to? -static void stbir__calculate_sample_range_downsample(int n, float in_pixels_radius, float scale_ratio, float out_shift, int* out_first_pixel, int* out_last_pixel, float* out_center_of_in) -{ - float in_pixel_center = (float)n + 0.5f; - float in_pixel_influence_lowerbound = in_pixel_center - in_pixels_radius; - float in_pixel_influence_upperbound = in_pixel_center + in_pixels_radius; - - float out_pixel_influence_lowerbound = in_pixel_influence_lowerbound * scale_ratio - out_shift; - float out_pixel_influence_upperbound = in_pixel_influence_upperbound * scale_ratio - out_shift; - - *out_center_of_in = in_pixel_center * scale_ratio - out_shift; - *out_first_pixel = (int)(floor(out_pixel_influence_lowerbound + 0.5)); - *out_last_pixel = (int)(floor(out_pixel_influence_upperbound - 0.5)); -} - -static void stbir__calculate_coefficients_upsample(stbir_filter filter, float scale, int in_first_pixel, int in_last_pixel, float in_center_of_out, stbir__contributors* contributor, float* coefficient_group) -{ - int i; - float total_filter = 0; - float filter_scale; - - STBIR_ASSERT(in_last_pixel - in_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. - - contributor->n0 = in_first_pixel; - contributor->n1 = in_last_pixel; - - STBIR_ASSERT(contributor->n1 >= contributor->n0); - - for (i = 0; i <= in_last_pixel - in_first_pixel; i++) - { - float in_pixel_center = (float)(i + in_first_pixel) + 0.5f; - coefficient_group[i] = stbir__filter_info_table[filter].kernel(in_center_of_out - in_pixel_center, 1 / scale); - - // If the coefficient is zero, skip it. (Don't do the <0 check here, we want the influence of those outside pixels.) - if (i == 0 && !coefficient_group[i]) - { - contributor->n0 = ++in_first_pixel; - i--; - continue; - } - - total_filter += coefficient_group[i]; - } - - // NOTE(fg): Not actually true in general, nor is there any reason to expect it should be. - // It would be true in exact math but is at best approximately true in floating-point math, - // and it would not make sense to try and put actual bounds on this here because it depends - // on the image aspect ratio which can get pretty extreme. - //STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); - - STBIR_ASSERT(total_filter > 0.9); - STBIR_ASSERT(total_filter < 1.1f); // Make sure it's not way off. - - // Make sure the sum of all coefficients is 1. - filter_scale = 1 / total_filter; - - for (i = 0; i <= in_last_pixel - in_first_pixel; i++) - coefficient_group[i] *= filter_scale; - - for (i = in_last_pixel - in_first_pixel; i >= 0; i--) - { - if (coefficient_group[i]) - break; - - // This line has no weight. We can skip it. - contributor->n1 = contributor->n0 + i - 1; - } -} - -static void stbir__calculate_coefficients_downsample(stbir_filter filter, float scale_ratio, int out_first_pixel, int out_last_pixel, float out_center_of_in, stbir__contributors* contributor, float* coefficient_group) -{ - int i; - - STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. - - contributor->n0 = out_first_pixel; - contributor->n1 = out_last_pixel; - - STBIR_ASSERT(contributor->n1 >= contributor->n0); - - for (i = 0; i <= out_last_pixel - out_first_pixel; i++) - { - float out_pixel_center = (float)(i + out_first_pixel) + 0.5f; - float x = out_pixel_center - out_center_of_in; - coefficient_group[i] = stbir__filter_info_table[filter].kernel(x, scale_ratio) * scale_ratio; - } - - // NOTE(fg): Not actually true in general, nor is there any reason to expect it should be. - // It would be true in exact math but is at best approximately true in floating-point math, - // and it would not make sense to try and put actual bounds on this here because it depends - // on the image aspect ratio which can get pretty extreme. - //STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); - - for (i = out_last_pixel - out_first_pixel; i >= 0; i--) - { - if (coefficient_group[i]) - break; - - // This line has no weight. We can skip it. - contributor->n1 = contributor->n0 + i - 1; - } -} - -static void stbir__normalize_downsample_coefficients(stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, int input_size, int output_size) -{ - int num_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size); - int num_coefficients = stbir__get_coefficient_width(filter, scale_ratio); - int i, j; - int skip; - - for (i = 0; i < output_size; i++) - { - float scale; - float total = 0; - - for (j = 0; j < num_contributors; j++) - { - if (i >= contributors[j].n0 && i <= contributors[j].n1) - { - float coefficient = *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i - contributors[j].n0); - total += coefficient; - } - else if (i < contributors[j].n0) - break; - } - - STBIR_ASSERT(total > 0.9f); - STBIR_ASSERT(total < 1.1f); - - scale = 1 / total; - - for (j = 0; j < num_contributors; j++) - { - if (i >= contributors[j].n0 && i <= contributors[j].n1) - *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i - contributors[j].n0) *= scale; - else if (i < contributors[j].n0) - break; - } - } - - // Optimize: Skip zero coefficients and contributions outside of image bounds. - // Do this after normalizing because normalization depends on the n0/n1 values. - for (j = 0; j < num_contributors; j++) - { - int range, max, width; - - skip = 0; - while (*stbir__get_coefficient(coefficients, filter, scale_ratio, j, skip) == 0) - skip++; - - contributors[j].n0 += skip; - - while (contributors[j].n0 < 0) - { - contributors[j].n0++; - skip++; - } - - range = contributors[j].n1 - contributors[j].n0 + 1; - max = stbir__min(num_coefficients, range); - - width = stbir__get_coefficient_width(filter, scale_ratio); - for (i = 0; i < max; i++) - { - if (i + skip >= width) - break; - - *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i) = *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i + skip); - } - - continue; - } - - // Using min to avoid writing into invalid pixels. - for (i = 0; i < num_contributors; i++) - contributors[i].n1 = stbir__min(contributors[i].n1, output_size - 1); -} - -// Each scan line uses the same kernel values so we should calculate the kernel -// values once and then we can use them for every scan line. -static void stbir__calculate_filters(stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, float shift, int input_size, int output_size) -{ - int n; - int total_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size); - - if (stbir__use_upsampling(scale_ratio)) - { - float out_pixels_radius = stbir__filter_info_table[filter].support(1 / scale_ratio) * scale_ratio; - - // Looping through out pixels - for (n = 0; n < total_contributors; n++) - { - float in_center_of_out; // Center of the current out pixel in the in pixel space - int in_first_pixel, in_last_pixel; - - stbir__calculate_sample_range_upsample(n, out_pixels_radius, scale_ratio, shift, &in_first_pixel, &in_last_pixel, &in_center_of_out); - - stbir__calculate_coefficients_upsample(filter, scale_ratio, in_first_pixel, in_last_pixel, in_center_of_out, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0)); - } - } - else - { - float in_pixels_radius = stbir__filter_info_table[filter].support(scale_ratio) / scale_ratio; - - // Looping through in pixels - for (n = 0; n < total_contributors; n++) - { - float out_center_of_in; // Center of the current out pixel in the in pixel space - int out_first_pixel, out_last_pixel; - int n_adjusted = n - stbir__get_filter_pixel_margin(filter, scale_ratio); - - stbir__calculate_sample_range_downsample(n_adjusted, in_pixels_radius, scale_ratio, shift, &out_first_pixel, &out_last_pixel, &out_center_of_in); - - stbir__calculate_coefficients_downsample(filter, scale_ratio, out_first_pixel, out_last_pixel, out_center_of_in, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0)); - } - - stbir__normalize_downsample_coefficients(contributors, coefficients, filter, scale_ratio, input_size, output_size); - } -} - -static float* stbir__get_decode_buffer(stbir__info* stbir_info) -{ - // The 0 index of the decode buffer starts after the margin. This makes - // it okay to use negative indexes on the decode buffer. - return &stbir_info->decode_buffer[stbir_info->horizontal_filter_pixel_margin * stbir_info->channels]; -} - -#define STBIR__DECODE(type, colorspace) ((int)(type) * (STBIR_MAX_COLORSPACES) + (int)(colorspace)) - -static void stbir__decode_scanline(stbir__info* stbir_info, int n) -{ - int c; - int channels = stbir_info->channels; - int alpha_channel = stbir_info->alpha_channel; - int type = stbir_info->type; - int colorspace = stbir_info->colorspace; - int input_w = stbir_info->input_w; - size_t input_stride_bytes = stbir_info->input_stride_bytes; - float* decode_buffer = stbir__get_decode_buffer(stbir_info); - stbir_edge edge_horizontal = stbir_info->edge_horizontal; - stbir_edge edge_vertical = stbir_info->edge_vertical; - size_t in_buffer_row_offset = stbir__edge_wrap(edge_vertical, n, stbir_info->input_h) * input_stride_bytes; - const void* input_data = (char *) stbir_info->input_data + in_buffer_row_offset; - int max_x = input_w + stbir_info->horizontal_filter_pixel_margin; - int decode = STBIR__DECODE(type, colorspace); - - int x = -stbir_info->horizontal_filter_pixel_margin; - - // special handling for STBIR_EDGE_ZERO because it needs to return an item that doesn't appear in the input, - // and we want to avoid paying overhead on every pixel if not STBIR_EDGE_ZERO - if (edge_vertical == STBIR_EDGE_ZERO && (n < 0 || n >= stbir_info->input_h)) - { - for (; x < max_x; x++) - for (c = 0; c < channels; c++) - decode_buffer[x*channels + c] = 0; - return; - } - - switch (decode) - { - case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_LINEAR): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = ((float)((const unsigned char*)input_data)[input_pixel_index + c]) / stbir__max_uint8_as_float; - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_SRGB): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = stbir__srgb_uchar_to_linear_float[((const unsigned char*)input_data)[input_pixel_index + c]]; - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - decode_buffer[decode_pixel_index + alpha_channel] = ((float)((const unsigned char*)input_data)[input_pixel_index + alpha_channel]) / stbir__max_uint8_as_float; - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_LINEAR): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = ((float)((const unsigned short*)input_data)[input_pixel_index + c]) / stbir__max_uint16_as_float; - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear(((float)((const unsigned short*)input_data)[input_pixel_index + c]) / stbir__max_uint16_as_float); - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - decode_buffer[decode_pixel_index + alpha_channel] = ((float)((const unsigned short*)input_data)[input_pixel_index + alpha_channel]) / stbir__max_uint16_as_float; - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_LINEAR): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = (float)(((double)((const unsigned int*)input_data)[input_pixel_index + c]) / stbir__max_uint32_as_float); - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_SRGB): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear((float)(((double)((const unsigned int*)input_data)[input_pixel_index + c]) / stbir__max_uint32_as_float)); - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - decode_buffer[decode_pixel_index + alpha_channel] = (float)(((double)((const unsigned int*)input_data)[input_pixel_index + alpha_channel]) / stbir__max_uint32_as_float); - } - break; - - case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_LINEAR): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = ((const float*)input_data)[input_pixel_index + c]; - } - break; - - case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_SRGB): - for (; x < max_x; x++) - { - int decode_pixel_index = x * channels; - int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels; - for (c = 0; c < channels; c++) - decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear(((const float*)input_data)[input_pixel_index + c]); - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - decode_buffer[decode_pixel_index + alpha_channel] = ((const float*)input_data)[input_pixel_index + alpha_channel]; - } - - break; - - default: - STBIR_ASSERT(!"Unknown type/colorspace/channels combination."); - break; - } - - if (!(stbir_info->flags & STBIR_FLAG_ALPHA_PREMULTIPLIED)) - { - for (x = -stbir_info->horizontal_filter_pixel_margin; x < max_x; x++) - { - int decode_pixel_index = x * channels; - - // If the alpha value is 0 it will clobber the color values. Make sure it's not. - float alpha = decode_buffer[decode_pixel_index + alpha_channel]; -#ifndef STBIR_NO_ALPHA_EPSILON - if (stbir_info->type != STBIR_TYPE_FLOAT) { - alpha += STBIR_ALPHA_EPSILON; - decode_buffer[decode_pixel_index + alpha_channel] = alpha; - } -#endif - for (c = 0; c < channels; c++) - { - if (c == alpha_channel) - continue; - - decode_buffer[decode_pixel_index + c] *= alpha; - } - } - } - - if (edge_horizontal == STBIR_EDGE_ZERO) - { - for (x = -stbir_info->horizontal_filter_pixel_margin; x < 0; x++) - { - for (c = 0; c < channels; c++) - decode_buffer[x*channels + c] = 0; - } - for (x = input_w; x < max_x; x++) - { - for (c = 0; c < channels; c++) - decode_buffer[x*channels + c] = 0; - } - } -} - -static float* stbir__get_ring_buffer_entry(float* ring_buffer, int index, int ring_buffer_length) -{ - return &ring_buffer[index * ring_buffer_length]; -} - -static float* stbir__add_empty_ring_buffer_entry(stbir__info* stbir_info, int n) -{ - int ring_buffer_index; - float* ring_buffer; - - stbir_info->ring_buffer_last_scanline = n; - - if (stbir_info->ring_buffer_begin_index < 0) - { - ring_buffer_index = stbir_info->ring_buffer_begin_index = 0; - stbir_info->ring_buffer_first_scanline = n; - } - else - { - ring_buffer_index = (stbir_info->ring_buffer_begin_index + (stbir_info->ring_buffer_last_scanline - stbir_info->ring_buffer_first_scanline)) % stbir_info->ring_buffer_num_entries; - STBIR_ASSERT(ring_buffer_index != stbir_info->ring_buffer_begin_index); - } - - ring_buffer = stbir__get_ring_buffer_entry(stbir_info->ring_buffer, ring_buffer_index, stbir_info->ring_buffer_length_bytes / sizeof(float)); - memset(ring_buffer, 0, stbir_info->ring_buffer_length_bytes); - - return ring_buffer; -} - - -static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, float* output_buffer) -{ - int x, k; - int output_w = stbir_info->output_w; - int channels = stbir_info->channels; - float* decode_buffer = stbir__get_decode_buffer(stbir_info); - stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors; - float* horizontal_coefficients = stbir_info->horizontal_coefficients; - int coefficient_width = stbir_info->horizontal_coefficient_width; - - for (x = 0; x < output_w; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int out_pixel_index = x * channels; - int coefficient_group = coefficient_width * x; - int coefficient_counter = 0; - - STBIR_ASSERT(n1 >= n0); - STBIR_ASSERT(n0 >= -stbir_info->horizontal_filter_pixel_margin); - STBIR_ASSERT(n1 >= -stbir_info->horizontal_filter_pixel_margin); - STBIR_ASSERT(n0 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); - STBIR_ASSERT(n1 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin); - - switch (channels) { - case 1: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * 1; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - } - break; - case 2: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * 2; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - } - break; - case 3: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * 3; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; - } - break; - case 4: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * 4; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; - output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient; - } - break; - default: - for (k = n0; k <= n1; k++) - { - int in_pixel_index = k * channels; - float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++]; - int c; - STBIR_ASSERT(coefficient != 0); - for (c = 0; c < channels; c++) - output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; - } - break; - } - } -} - -static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float* output_buffer) -{ - int x, k; - int input_w = stbir_info->input_w; - int channels = stbir_info->channels; - float* decode_buffer = stbir__get_decode_buffer(stbir_info); - stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors; - float* horizontal_coefficients = stbir_info->horizontal_coefficients; - int coefficient_width = stbir_info->horizontal_coefficient_width; - int filter_pixel_margin = stbir_info->horizontal_filter_pixel_margin; - int max_x = input_w + filter_pixel_margin * 2; - - STBIR_ASSERT(!stbir__use_width_upsampling(stbir_info)); - - switch (channels) { - case 1: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * 1; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int out_pixel_index = k * 1; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - } - } - break; - - case 2: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * 2; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int out_pixel_index = k * 2; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - } - } - break; - - case 3: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * 3; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int out_pixel_index = k * 3; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; - } - } - break; - - case 4: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * 4; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int out_pixel_index = k * 4; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; - output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient; - } - } - break; - - default: - for (x = 0; x < max_x; x++) - { - int n0 = horizontal_contributors[x].n0; - int n1 = horizontal_contributors[x].n1; - - int in_x = x - filter_pixel_margin; - int in_pixel_index = in_x * channels; - int max_n = n1; - int coefficient_group = coefficient_width * x; - - for (k = n0; k <= max_n; k++) - { - int c; - int out_pixel_index = k * channels; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; - for (c = 0; c < channels; c++) - output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; - } - } - break; - } -} - -static void stbir__decode_and_resample_upsample(stbir__info* stbir_info, int n) -{ - // Decode the nth scanline from the source image into the decode buffer. - stbir__decode_scanline(stbir_info, n); - - // Now resample it into the ring buffer. - if (stbir__use_width_upsampling(stbir_info)) - stbir__resample_horizontal_upsample(stbir_info, stbir__add_empty_ring_buffer_entry(stbir_info, n)); - else - stbir__resample_horizontal_downsample(stbir_info, stbir__add_empty_ring_buffer_entry(stbir_info, n)); - - // Now it's sitting in the ring buffer ready to be used as source for the vertical sampling. -} - -static void stbir__decode_and_resample_downsample(stbir__info* stbir_info, int n) -{ - // Decode the nth scanline from the source image into the decode buffer. - stbir__decode_scanline(stbir_info, n); - - memset(stbir_info->horizontal_buffer, 0, stbir_info->output_w * stbir_info->channels * sizeof(float)); - - // Now resample it into the horizontal buffer. - if (stbir__use_width_upsampling(stbir_info)) - stbir__resample_horizontal_upsample(stbir_info, stbir_info->horizontal_buffer); - else - stbir__resample_horizontal_downsample(stbir_info, stbir_info->horizontal_buffer); - - // Now it's sitting in the horizontal buffer ready to be distributed into the ring buffers. -} - -// Get the specified scan line from the ring buffer. -static float* stbir__get_ring_buffer_scanline(int get_scanline, float* ring_buffer, int begin_index, int first_scanline, int ring_buffer_num_entries, int ring_buffer_length) -{ - int ring_buffer_index = (begin_index + (get_scanline - first_scanline)) % ring_buffer_num_entries; - return stbir__get_ring_buffer_entry(ring_buffer, ring_buffer_index, ring_buffer_length); -} - - -static void stbir__encode_scanline(stbir__info* stbir_info, int num_pixels, void *output_buffer, float *encode_buffer, int channels, int alpha_channel, int decode) -{ - int x; - int n; - int num_nonalpha; - stbir_uint16 nonalpha[STBIR_MAX_CHANNELS]; - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)) - { - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - float alpha = encode_buffer[pixel_index + alpha_channel]; - float reciprocal_alpha = alpha ? 1.0f / alpha : 0; - - // unrolling this produced a 1% slowdown upscaling a large RGBA linear-space image on my machine - stb - for (n = 0; n < channels; n++) - if (n != alpha_channel) - encode_buffer[pixel_index + n] *= reciprocal_alpha; - - // We added in a small epsilon to prevent the color channel from being deleted with zero alpha. - // Because we only add it for integer types, it will automatically be discarded on integer - // conversion, so we don't need to subtract it back out (which would be problematic for - // numeric precision reasons). - } - } - - // build a table of all channels that need colorspace correction, so - // we don't perform colorspace correction on channels that don't need it. - for (x = 0, num_nonalpha = 0; x < channels; ++x) - { - if (x != alpha_channel || (stbir_info->flags & STBIR_FLAG_ALPHA_USES_COLORSPACE)) - { - nonalpha[num_nonalpha++] = (stbir_uint16)x; - } - } - - #define STBIR__ROUND_INT(f) ((int) ((f)+0.5)) - #define STBIR__ROUND_UINT(f) ((stbir_uint32) ((f)+0.5)) - - #ifdef STBIR__SATURATE_INT - #define STBIR__ENCODE_LINEAR8(f) stbir__saturate8 (STBIR__ROUND_INT((f) * stbir__max_uint8_as_float )) - #define STBIR__ENCODE_LINEAR16(f) stbir__saturate16(STBIR__ROUND_INT((f) * stbir__max_uint16_as_float)) - #else - #define STBIR__ENCODE_LINEAR8(f) (unsigned char ) STBIR__ROUND_INT(stbir__saturate(f) * stbir__max_uint8_as_float ) - #define STBIR__ENCODE_LINEAR16(f) (unsigned short) STBIR__ROUND_INT(stbir__saturate(f) * stbir__max_uint16_as_float) - #endif - - switch (decode) - { - case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_LINEAR): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < channels; n++) - { - int index = pixel_index + n; - ((unsigned char*)output_buffer)[index] = STBIR__ENCODE_LINEAR8(encode_buffer[index]); - } - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_SRGB): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < num_nonalpha; n++) - { - int index = pixel_index + nonalpha[n]; - ((unsigned char*)output_buffer)[index] = stbir__linear_to_srgb_uchar(encode_buffer[index]); - } - - if (!(stbir_info->flags & STBIR_FLAG_ALPHA_USES_COLORSPACE)) - ((unsigned char *)output_buffer)[pixel_index + alpha_channel] = STBIR__ENCODE_LINEAR8(encode_buffer[pixel_index+alpha_channel]); - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_LINEAR): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < channels; n++) - { - int index = pixel_index + n; - ((unsigned short*)output_buffer)[index] = STBIR__ENCODE_LINEAR16(encode_buffer[index]); - } - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < num_nonalpha; n++) - { - int index = pixel_index + nonalpha[n]; - ((unsigned short*)output_buffer)[index] = (unsigned short)STBIR__ROUND_INT(stbir__linear_to_srgb(stbir__saturate(encode_buffer[index])) * stbir__max_uint16_as_float); - } - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - ((unsigned short*)output_buffer)[pixel_index + alpha_channel] = STBIR__ENCODE_LINEAR16(encode_buffer[pixel_index + alpha_channel]); - } - - break; - - case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_LINEAR): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < channels; n++) - { - int index = pixel_index + n; - ((unsigned int*)output_buffer)[index] = (unsigned int)STBIR__ROUND_UINT(((double)stbir__saturate(encode_buffer[index])) * stbir__max_uint32_as_float); - } - } - break; - - case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_SRGB): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < num_nonalpha; n++) - { - int index = pixel_index + nonalpha[n]; - ((unsigned int*)output_buffer)[index] = (unsigned int)STBIR__ROUND_UINT(((double)stbir__linear_to_srgb(stbir__saturate(encode_buffer[index]))) * stbir__max_uint32_as_float); - } - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - ((unsigned int*)output_buffer)[pixel_index + alpha_channel] = (unsigned int)STBIR__ROUND_INT(((double)stbir__saturate(encode_buffer[pixel_index + alpha_channel])) * stbir__max_uint32_as_float); - } - break; - - case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_LINEAR): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < channels; n++) - { - int index = pixel_index + n; - ((float*)output_buffer)[index] = encode_buffer[index]; - } - } - break; - - case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_SRGB): - for (x=0; x < num_pixels; ++x) - { - int pixel_index = x*channels; - - for (n = 0; n < num_nonalpha; n++) - { - int index = pixel_index + nonalpha[n]; - ((float*)output_buffer)[index] = stbir__linear_to_srgb(encode_buffer[index]); - } - - if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)) - ((float*)output_buffer)[pixel_index + alpha_channel] = encode_buffer[pixel_index + alpha_channel]; - } - break; - - default: - STBIR_ASSERT(!"Unknown type/colorspace/channels combination."); - break; - } -} - -static void stbir__resample_vertical_upsample(stbir__info* stbir_info, int n) -{ - int x, k; - int output_w = stbir_info->output_w; - stbir__contributors* vertical_contributors = stbir_info->vertical_contributors; - float* vertical_coefficients = stbir_info->vertical_coefficients; - int channels = stbir_info->channels; - int alpha_channel = stbir_info->alpha_channel; - int type = stbir_info->type; - int colorspace = stbir_info->colorspace; - int ring_buffer_entries = stbir_info->ring_buffer_num_entries; - void* output_data = stbir_info->output_data; - float* encode_buffer = stbir_info->encode_buffer; - int decode = STBIR__DECODE(type, colorspace); - int coefficient_width = stbir_info->vertical_coefficient_width; - int coefficient_counter; - int contributor = n; - - float* ring_buffer = stbir_info->ring_buffer; - int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index; - int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline; - int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); - - int n0,n1, output_row_start; - int coefficient_group = coefficient_width * contributor; - - n0 = vertical_contributors[contributor].n0; - n1 = vertical_contributors[contributor].n1; - - output_row_start = n * stbir_info->output_stride_bytes; - - STBIR_ASSERT(stbir__use_height_upsampling(stbir_info)); - - memset(encode_buffer, 0, output_w * sizeof(float) * channels); - - // I tried reblocking this for better cache usage of encode_buffer - // (using x_outer, k, x_inner), but it lost speed. -- stb - - coefficient_counter = 0; - switch (channels) { - case 1: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, ring_buffer_entries, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * 1; - encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; - } - } - break; - case 2: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, ring_buffer_entries, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * 2; - encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; - encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; - } - } - break; - case 3: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, ring_buffer_entries, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * 3; - encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; - encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; - encode_buffer[in_pixel_index + 2] += ring_buffer_entry[in_pixel_index + 2] * coefficient; - } - } - break; - case 4: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, ring_buffer_entries, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * 4; - encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient; - encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient; - encode_buffer[in_pixel_index + 2] += ring_buffer_entry[in_pixel_index + 2] * coefficient; - encode_buffer[in_pixel_index + 3] += ring_buffer_entry[in_pixel_index + 3] * coefficient; - } - } - break; - default: - for (k = n0; k <= n1; k++) - { - int coefficient_index = coefficient_counter++; - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, ring_buffer_entries, ring_buffer_length); - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - for (x = 0; x < output_w; ++x) - { - int in_pixel_index = x * channels; - int c; - for (c = 0; c < channels; c++) - encode_buffer[in_pixel_index + c] += ring_buffer_entry[in_pixel_index + c] * coefficient; - } - } - break; - } - stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, encode_buffer, channels, alpha_channel, decode); -} - -static void stbir__resample_vertical_downsample(stbir__info* stbir_info, int n) -{ - int x, k; - int output_w = stbir_info->output_w; - stbir__contributors* vertical_contributors = stbir_info->vertical_contributors; - float* vertical_coefficients = stbir_info->vertical_coefficients; - int channels = stbir_info->channels; - int ring_buffer_entries = stbir_info->ring_buffer_num_entries; - float* horizontal_buffer = stbir_info->horizontal_buffer; - int coefficient_width = stbir_info->vertical_coefficient_width; - int contributor = n + stbir_info->vertical_filter_pixel_margin; - - float* ring_buffer = stbir_info->ring_buffer; - int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index; - int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline; - int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); - int n0,n1; - - n0 = vertical_contributors[contributor].n0; - n1 = vertical_contributors[contributor].n1; - - STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info)); - - for (k = n0; k <= n1; k++) - { - int coefficient_index = k - n0; - int coefficient_group = coefficient_width * contributor; - float coefficient = vertical_coefficients[coefficient_group + coefficient_index]; - - float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, ring_buffer_entries, ring_buffer_length); - - switch (channels) { - case 1: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * 1; - ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; - } - break; - case 2: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * 2; - ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; - ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; - } - break; - case 3: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * 3; - ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; - ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; - ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient; - } - break; - case 4: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * 4; - ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient; - ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient; - ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient; - ring_buffer_entry[in_pixel_index + 3] += horizontal_buffer[in_pixel_index + 3] * coefficient; - } - break; - default: - for (x = 0; x < output_w; x++) - { - int in_pixel_index = x * channels; - - int c; - for (c = 0; c < channels; c++) - ring_buffer_entry[in_pixel_index + c] += horizontal_buffer[in_pixel_index + c] * coefficient; - } - break; - } - } -} - -static void stbir__buffer_loop_upsample(stbir__info* stbir_info) -{ - int y; - float scale_ratio = stbir_info->vertical_scale; - float out_scanlines_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(1/scale_ratio) * scale_ratio; - - STBIR_ASSERT(stbir__use_height_upsampling(stbir_info)); - - for (y = 0; y < stbir_info->output_h; y++) - { - float in_center_of_out = 0; // Center of the current out scanline in the in scanline space - int in_first_scanline = 0, in_last_scanline = 0; - - stbir__calculate_sample_range_upsample(y, out_scanlines_radius, scale_ratio, stbir_info->vertical_shift, &in_first_scanline, &in_last_scanline, &in_center_of_out); - - STBIR_ASSERT(in_last_scanline - in_first_scanline + 1 <= stbir_info->ring_buffer_num_entries); - - if (stbir_info->ring_buffer_begin_index >= 0) - { - // Get rid of whatever we don't need anymore. - while (in_first_scanline > stbir_info->ring_buffer_first_scanline) - { - if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline) - { - // We just popped the last scanline off the ring buffer. - // Reset it to the empty state. - stbir_info->ring_buffer_begin_index = -1; - stbir_info->ring_buffer_first_scanline = 0; - stbir_info->ring_buffer_last_scanline = 0; - break; - } - else - { - stbir_info->ring_buffer_first_scanline++; - stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->ring_buffer_num_entries; - } - } - } - - // Load in new ones. - if (stbir_info->ring_buffer_begin_index < 0) - stbir__decode_and_resample_upsample(stbir_info, in_first_scanline); - - while (in_last_scanline > stbir_info->ring_buffer_last_scanline) - stbir__decode_and_resample_upsample(stbir_info, stbir_info->ring_buffer_last_scanline + 1); - - // Now all buffers should be ready to write a row of vertical sampling. - stbir__resample_vertical_upsample(stbir_info, y); - - STBIR_PROGRESS_REPORT((float)y / stbir_info->output_h); - } -} - -static void stbir__empty_ring_buffer(stbir__info* stbir_info, int first_necessary_scanline) -{ - int output_stride_bytes = stbir_info->output_stride_bytes; - int channels = stbir_info->channels; - int alpha_channel = stbir_info->alpha_channel; - int type = stbir_info->type; - int colorspace = stbir_info->colorspace; - int output_w = stbir_info->output_w; - void* output_data = stbir_info->output_data; - int decode = STBIR__DECODE(type, colorspace); - - float* ring_buffer = stbir_info->ring_buffer; - int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float); - - if (stbir_info->ring_buffer_begin_index >= 0) - { - // Get rid of whatever we don't need anymore. - while (first_necessary_scanline > stbir_info->ring_buffer_first_scanline) - { - if (stbir_info->ring_buffer_first_scanline >= 0 && stbir_info->ring_buffer_first_scanline < stbir_info->output_h) - { - int output_row_start = stbir_info->ring_buffer_first_scanline * output_stride_bytes; - float* ring_buffer_entry = stbir__get_ring_buffer_entry(ring_buffer, stbir_info->ring_buffer_begin_index, ring_buffer_length); - stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, ring_buffer_entry, channels, alpha_channel, decode); - STBIR_PROGRESS_REPORT((float)stbir_info->ring_buffer_first_scanline / stbir_info->output_h); - } - - if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline) - { - // We just popped the last scanline off the ring buffer. - // Reset it to the empty state. - stbir_info->ring_buffer_begin_index = -1; - stbir_info->ring_buffer_first_scanline = 0; - stbir_info->ring_buffer_last_scanline = 0; - break; - } - else - { - stbir_info->ring_buffer_first_scanline++; - stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->ring_buffer_num_entries; - } - } - } -} - -static void stbir__buffer_loop_downsample(stbir__info* stbir_info) -{ - int y; - float scale_ratio = stbir_info->vertical_scale; - int output_h = stbir_info->output_h; - float in_pixels_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(scale_ratio) / scale_ratio; - int pixel_margin = stbir_info->vertical_filter_pixel_margin; - int max_y = stbir_info->input_h + pixel_margin; - - STBIR_ASSERT(!stbir__use_height_upsampling(stbir_info)); - - for (y = -pixel_margin; y < max_y; y++) - { - float out_center_of_in; // Center of the current out scanline in the in scanline space - int out_first_scanline, out_last_scanline; - - stbir__calculate_sample_range_downsample(y, in_pixels_radius, scale_ratio, stbir_info->vertical_shift, &out_first_scanline, &out_last_scanline, &out_center_of_in); - - STBIR_ASSERT(out_last_scanline - out_first_scanline + 1 <= stbir_info->ring_buffer_num_entries); - - if (out_last_scanline < 0 || out_first_scanline >= output_h) - continue; - - stbir__empty_ring_buffer(stbir_info, out_first_scanline); - - stbir__decode_and_resample_downsample(stbir_info, y); - - // Load in new ones. - if (stbir_info->ring_buffer_begin_index < 0) - stbir__add_empty_ring_buffer_entry(stbir_info, out_first_scanline); - - while (out_last_scanline > stbir_info->ring_buffer_last_scanline) - stbir__add_empty_ring_buffer_entry(stbir_info, stbir_info->ring_buffer_last_scanline + 1); - - // Now the horizontal buffer is ready to write to all ring buffer rows. - stbir__resample_vertical_downsample(stbir_info, y); - } - - stbir__empty_ring_buffer(stbir_info, stbir_info->output_h); -} - -static void stbir__setup(stbir__info *info, int input_w, int input_h, int output_w, int output_h, int channels) -{ - info->input_w = input_w; - info->input_h = input_h; - info->output_w = output_w; - info->output_h = output_h; - info->channels = channels; -} - -static void stbir__calculate_transform(stbir__info *info, float s0, float t0, float s1, float t1, float *transform) -{ - info->s0 = s0; - info->t0 = t0; - info->s1 = s1; - info->t1 = t1; - - if (transform) - { - info->horizontal_scale = transform[0]; - info->vertical_scale = transform[1]; - info->horizontal_shift = transform[2]; - info->vertical_shift = transform[3]; - } - else - { - info->horizontal_scale = ((float)info->output_w / info->input_w) / (s1 - s0); - info->vertical_scale = ((float)info->output_h / info->input_h) / (t1 - t0); - - info->horizontal_shift = s0 * info->output_w / (s1 - s0); - info->vertical_shift = t0 * info->output_h / (t1 - t0); - } -} - -static void stbir__choose_filter(stbir__info *info, stbir_filter h_filter, stbir_filter v_filter) -{ - if (h_filter == 0) - h_filter = stbir__use_upsampling(info->horizontal_scale) ? STBIR_DEFAULT_FILTER_UPSAMPLE : STBIR_DEFAULT_FILTER_DOWNSAMPLE; - if (v_filter == 0) - v_filter = stbir__use_upsampling(info->vertical_scale) ? STBIR_DEFAULT_FILTER_UPSAMPLE : STBIR_DEFAULT_FILTER_DOWNSAMPLE; - info->horizontal_filter = h_filter; - info->vertical_filter = v_filter; -} - -static stbir_uint32 stbir__calculate_memory(stbir__info *info) -{ - int pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale); - int filter_height = stbir__get_filter_pixel_width(info->vertical_filter, info->vertical_scale); - - info->horizontal_num_contributors = stbir__get_contributors(info->horizontal_scale, info->horizontal_filter, info->input_w, info->output_w); - info->vertical_num_contributors = stbir__get_contributors(info->vertical_scale , info->vertical_filter , info->input_h, info->output_h); - - // One extra entry because floating point precision problems sometimes cause an extra to be necessary. - info->ring_buffer_num_entries = filter_height + 1; - - info->horizontal_contributors_size = info->horizontal_num_contributors * sizeof(stbir__contributors); - info->horizontal_coefficients_size = stbir__get_total_horizontal_coefficients(info) * sizeof(float); - info->vertical_contributors_size = info->vertical_num_contributors * sizeof(stbir__contributors); - info->vertical_coefficients_size = stbir__get_total_vertical_coefficients(info) * sizeof(float); - info->decode_buffer_size = (info->input_w + pixel_margin * 2) * info->channels * sizeof(float); - info->horizontal_buffer_size = info->output_w * info->channels * sizeof(float); - info->ring_buffer_size = info->output_w * info->channels * info->ring_buffer_num_entries * sizeof(float); - info->encode_buffer_size = info->output_w * info->channels * sizeof(float); - - STBIR_ASSERT(info->horizontal_filter != 0); - STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late - STBIR_ASSERT(info->vertical_filter != 0); - STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late - - if (stbir__use_height_upsampling(info)) - // The horizontal buffer is for when we're downsampling the height and we - // can't output the result of sampling the decode buffer directly into the - // ring buffers. - info->horizontal_buffer_size = 0; - else - // The encode buffer is to retain precision in the height upsampling method - // and isn't used when height downsampling. - info->encode_buffer_size = 0; - - return info->horizontal_contributors_size + info->horizontal_coefficients_size - + info->vertical_contributors_size + info->vertical_coefficients_size - + info->decode_buffer_size + info->horizontal_buffer_size - + info->ring_buffer_size + info->encode_buffer_size; -} - -static int stbir__resize_allocated(stbir__info *info, - const void* input_data, int input_stride_in_bytes, - void* output_data, int output_stride_in_bytes, - int alpha_channel, stbir_uint32 flags, stbir_datatype type, - stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace, - void* tempmem, size_t tempmem_size_in_bytes) -{ - size_t memory_required = stbir__calculate_memory(info); - - int width_stride_input = input_stride_in_bytes ? input_stride_in_bytes : info->channels * info->input_w * stbir__type_size[type]; - int width_stride_output = output_stride_in_bytes ? output_stride_in_bytes : info->channels * info->output_w * stbir__type_size[type]; - -#ifdef STBIR_DEBUG_OVERWRITE_TEST -#define OVERWRITE_ARRAY_SIZE 8 - unsigned char overwrite_output_before_pre[OVERWRITE_ARRAY_SIZE]; - unsigned char overwrite_tempmem_before_pre[OVERWRITE_ARRAY_SIZE]; - unsigned char overwrite_output_after_pre[OVERWRITE_ARRAY_SIZE]; - unsigned char overwrite_tempmem_after_pre[OVERWRITE_ARRAY_SIZE]; - - size_t begin_forbidden = width_stride_output * (info->output_h - 1) + info->output_w * info->channels * stbir__type_size[type]; - memcpy(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE); - memcpy(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE); - memcpy(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE); - memcpy(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE); -#endif - - STBIR_ASSERT(info->channels >= 0); - STBIR_ASSERT(info->channels <= STBIR_MAX_CHANNELS); - - if (info->channels < 0 || info->channels > STBIR_MAX_CHANNELS) - return 0; - - STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); - STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); - - if (info->horizontal_filter >= STBIR__ARRAY_SIZE(stbir__filter_info_table)) - return 0; - if (info->vertical_filter >= STBIR__ARRAY_SIZE(stbir__filter_info_table)) - return 0; - - if (alpha_channel < 0) - flags |= STBIR_FLAG_ALPHA_USES_COLORSPACE | STBIR_FLAG_ALPHA_PREMULTIPLIED; - - if (!(flags&STBIR_FLAG_ALPHA_USES_COLORSPACE) || !(flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)) { - STBIR_ASSERT(alpha_channel >= 0 && alpha_channel < info->channels); - } - - if (alpha_channel >= info->channels) - return 0; - - STBIR_ASSERT(tempmem); - - if (!tempmem) - return 0; - - STBIR_ASSERT(tempmem_size_in_bytes >= memory_required); - - if (tempmem_size_in_bytes < memory_required) - return 0; - - memset(tempmem, 0, tempmem_size_in_bytes); - - info->input_data = input_data; - info->input_stride_bytes = width_stride_input; - - info->output_data = output_data; - info->output_stride_bytes = width_stride_output; - - info->alpha_channel = alpha_channel; - info->flags = flags; - info->type = type; - info->edge_horizontal = edge_horizontal; - info->edge_vertical = edge_vertical; - info->colorspace = colorspace; - - info->horizontal_coefficient_width = stbir__get_coefficient_width (info->horizontal_filter, info->horizontal_scale); - info->vertical_coefficient_width = stbir__get_coefficient_width (info->vertical_filter , info->vertical_scale ); - info->horizontal_filter_pixel_width = stbir__get_filter_pixel_width (info->horizontal_filter, info->horizontal_scale); - info->vertical_filter_pixel_width = stbir__get_filter_pixel_width (info->vertical_filter , info->vertical_scale ); - info->horizontal_filter_pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale); - info->vertical_filter_pixel_margin = stbir__get_filter_pixel_margin(info->vertical_filter , info->vertical_scale ); - - info->ring_buffer_length_bytes = info->output_w * info->channels * sizeof(float); - info->decode_buffer_pixels = info->input_w + info->horizontal_filter_pixel_margin * 2; - -#define STBIR__NEXT_MEMPTR(current, newtype) (newtype*)(((unsigned char*)current) + current##_size) - - info->horizontal_contributors = (stbir__contributors *) tempmem; - info->horizontal_coefficients = STBIR__NEXT_MEMPTR(info->horizontal_contributors, float); - info->vertical_contributors = STBIR__NEXT_MEMPTR(info->horizontal_coefficients, stbir__contributors); - info->vertical_coefficients = STBIR__NEXT_MEMPTR(info->vertical_contributors, float); - info->decode_buffer = STBIR__NEXT_MEMPTR(info->vertical_coefficients, float); - - if (stbir__use_height_upsampling(info)) - { - info->horizontal_buffer = NULL; - info->ring_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float); - info->encode_buffer = STBIR__NEXT_MEMPTR(info->ring_buffer, float); - - STBIR_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->encode_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); - } - else - { - info->horizontal_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float); - info->ring_buffer = STBIR__NEXT_MEMPTR(info->horizontal_buffer, float); - info->encode_buffer = NULL; - - STBIR_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->ring_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes); - } - -#undef STBIR__NEXT_MEMPTR - - // This signals that the ring buffer is empty - info->ring_buffer_begin_index = -1; - - stbir__calculate_filters(info->horizontal_contributors, info->horizontal_coefficients, info->horizontal_filter, info->horizontal_scale, info->horizontal_shift, info->input_w, info->output_w); - stbir__calculate_filters(info->vertical_contributors, info->vertical_coefficients, info->vertical_filter, info->vertical_scale, info->vertical_shift, info->input_h, info->output_h); - - STBIR_PROGRESS_REPORT(0); - - if (stbir__use_height_upsampling(info)) - stbir__buffer_loop_upsample(info); - else - stbir__buffer_loop_downsample(info); - - STBIR_PROGRESS_REPORT(1); - -#ifdef STBIR_DEBUG_OVERWRITE_TEST - STBIR_ASSERT(memcmp(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); - STBIR_ASSERT(memcmp(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE) == 0); - STBIR_ASSERT(memcmp(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0); - STBIR_ASSERT(memcmp(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE) == 0); -#endif - - return 1; -} - - -static int stbir__resize_arbitrary( - void *alloc_context, - const void* input_data, int input_w, int input_h, int input_stride_in_bytes, - void* output_data, int output_w, int output_h, int output_stride_in_bytes, - float s0, float t0, float s1, float t1, float *transform, - int channels, int alpha_channel, stbir_uint32 flags, stbir_datatype type, - stbir_filter h_filter, stbir_filter v_filter, - stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace) -{ - stbir__info info; - int result; - size_t memory_required; - void* extra_memory; - - stbir__setup(&info, input_w, input_h, output_w, output_h, channels); - stbir__calculate_transform(&info, s0,t0,s1,t1,transform); - stbir__choose_filter(&info, h_filter, v_filter); - memory_required = stbir__calculate_memory(&info); - extra_memory = STBIR_MALLOC(memory_required, alloc_context); - - if (!extra_memory) - return 0; - - result = stbir__resize_allocated(&info, input_data, input_stride_in_bytes, - output_data, output_stride_in_bytes, - alpha_channel, flags, type, - edge_horizontal, edge_vertical, - colorspace, extra_memory, memory_required); - - STBIR_FREE(extra_memory, alloc_context); - - return result; -} - -STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels) -{ - return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,-1,0, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, - STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_LINEAR); -} - -STBIRDEF int stbir_resize_float( const 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) -{ - return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,-1,0, STBIR_TYPE_FLOAT, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, - STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_LINEAR); -} - -STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags) -{ - return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, - STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_SRGB); -} - -STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode) -{ - return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT, - edge_wrap_mode, edge_wrap_mode, STBIR_COLORSPACE_SRGB); -} - -STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, filter, filter, - edge_wrap_mode, edge_wrap_mode, space); -} - -STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT16, filter, filter, - edge_wrap_mode, edge_wrap_mode, space); -} - - -STBIRDEF int stbir_resize_float_generic( const 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, - stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_FLOAT, filter, filter, - edge_wrap_mode, edge_wrap_mode, space); -} - - -STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,NULL,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, - edge_mode_horizontal, edge_mode_vertical, space); -} - - -STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float x_scale, float y_scale, - float x_offset, float y_offset) -{ - float transform[4]; - transform[0] = x_scale; - transform[1] = y_scale; - transform[2] = x_offset; - transform[3] = y_offset; - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - 0,0,1,1,transform,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, - edge_mode_horizontal, edge_mode_vertical, space); -} - -STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, - stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float s0, float t0, float s1, float t1) -{ - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, - output_pixels, output_w, output_h, output_stride_in_bytes, - s0,t0,s1,t1,NULL,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical, - edge_mode_horizontal, edge_mode_vertical, space); -} - -#endif // STB_IMAGE_RESIZE_IMPLEMENTATION - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_image_write.h b/FCLauncher/src/main/jni/lwjgl/stb/stb_image_write.h deleted file mode 100644 index e4b32ed1..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_image_write.h +++ /dev/null @@ -1,1724 +0,0 @@ -/* stb_image_write - v1.16 - public domain - http://nothings.org/stb - writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015 - no warranty implied; use at your own risk - - Before #including, - - #define STB_IMAGE_WRITE_IMPLEMENTATION - - in the file that you want to have the implementation. - - Will probably not work correctly with strict-aliasing optimizations. - -ABOUT: - - This header file is a library for writing images to C stdio or a callback. - - 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 STBIW_ZLIB_COMPRESS) can mitigate that. - This library is designed for source code compactness and simplicity, - not optimal image file size or run-time performance. - -BUILDING: - - You can #define STBIW_ASSERT(x) before the #include to avoid using assert.h. - You can #define STBIW_MALLOC(), STBIW_REALLOC(), and STBIW_FREE() to replace - malloc,realloc,free. - You can #define STBIW_MEMMOVE() to replace memmove() - You can #define STBIW_ZLIB_COMPRESS to use a custom zlib-style compress function - for PNG compression (instead of the builtin one), it must have the following signature: - unsigned char * my_compress(unsigned char *data, int data_len, int *out_len, int quality); - The returned data will be freed with STBIW_FREE() (free() by default), - so it must be heap allocated with STBIW_MALLOC() (malloc() by default), - -UNICODE: - - If compiling for Windows and you wish to use Unicode filenames, compile - with - #define STBIW_WINDOWS_UTF8 - and pass utf8-encoded filenames. Call stbiw_convert_wchar_to_utf8 to convert - Windows wchar_t filenames to utf8. - -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_jpg(char const *filename, int w, int h, int comp, const void *data, int quality); - int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); - - 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 - - - You can define STBI_WRITE_NO_STDIO to disable the file variant of these - functions, so the library will not use stdio.h at all. However, this will - also disable HDR writing, because it requires stdio for formatted output. - - Each function returns 0 on failure and non-0 on success. - - 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 '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 'w' pixels wide and 'h' pixels tall. - The *data pointer points to the first byte of the top-left-most pixel. - For PNG, "stride_in_bytes" is the distance in bytes from the first byte of - a row of pixels to the first byte of the next row of pixels. - - PNG creates output files with the same number of components as the input. - The BMP format expands Y to RGB in the file format and does not - output alpha. - - 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 'stbi_write_png_compression_level' (it defaults to 8). - - 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. - - TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed - data, set the global variable 'stbi_write_tga_with_rle' to 0. - - 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). - -CREDITS: - - - Sean Barrett - PNG/BMP/TGA - Baldur Karlsson - HDR - Jean-Sebastien Guay - TGA monochrome - Tim Kelsey - misc enhancements - Alan Hickman - TGA RLE - Emmanuel Julien - initial file IO callback implementation - Jon Olick - original jo_jpeg.cpp code - Daniel Gibson - integrate JPEG, allow external zlib - Aarni Koskela - allow choosing PNG filter - - bugfixes: - github:Chribba - Guillaume Chereau - github:jry2 - github:romigrou - Sergio Gonzalez - Jonas Karlsson - Filip Wasil - Thatcher Ulrich - github:poppolopoppo - Patrick Boettcher - github:xeekworx - Cap Petschulat - Simon Rodriguez - Ivan Tikhonov - github:ignotion - Adam Schackart - Andrew Kensler - -LICENSE - - See end of file for license information. - -*/ - -#ifndef INCLUDE_STB_IMAGE_WRITE_H -#define INCLUDE_STB_IMAGE_WRITE_H - -#include - -// if STB_IMAGE_WRITE_STATIC causes problems, try defining STBIWDEF to 'inline' or 'static inline' -#ifndef STBIWDEF -#ifdef STB_IMAGE_WRITE_STATIC -#define STBIWDEF static -#else -#ifdef __cplusplus -#define STBIWDEF extern "C" -#else -#define STBIWDEF extern -#endif -#endif -#endif - -#ifndef STB_IMAGE_WRITE_STATIC // C++ forbids static forward declarations -STBIWDEF int stbi_write_tga_with_rle; -STBIWDEF int stbi_write_png_compression_level; -STBIWDEF int stbi_write_force_png_filter; -#endif - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); -STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); -STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality); - -#ifdef STBIW_WINDOWS_UTF8 -STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input); -#endif -#endif - -typedef void stbi_write_func(void *context, void *data, int size); - -STBIWDEF 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); -STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); -STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality); - -STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean); - -#endif//INCLUDE_STB_IMAGE_WRITE_H - -#ifdef STB_IMAGE_WRITE_IMPLEMENTATION - -#ifdef _WIN32 - #ifndef _CRT_SECURE_NO_WARNINGS - #define _CRT_SECURE_NO_WARNINGS - #endif - #ifndef _CRT_NONSTDC_NO_DEPRECATE - #define _CRT_NONSTDC_NO_DEPRECATE - #endif -#endif - -#ifndef STBI_WRITE_NO_STDIO -#include -#endif // STBI_WRITE_NO_STDIO - -#include -#include -#include -#include - -#if defined(STBIW_MALLOC) && defined(STBIW_FREE) && (defined(STBIW_REALLOC) || defined(STBIW_REALLOC_SIZED)) -// ok -#elif !defined(STBIW_MALLOC) && !defined(STBIW_FREE) && !defined(STBIW_REALLOC) && !defined(STBIW_REALLOC_SIZED) -// ok -#else -#error "Must define all or none of STBIW_MALLOC, STBIW_FREE, and STBIW_REALLOC (or STBIW_REALLOC_SIZED)." -#endif - -#ifndef STBIW_MALLOC -#define STBIW_MALLOC(sz) malloc(sz) -#define STBIW_REALLOC(p,newsz) realloc(p,newsz) -#define STBIW_FREE(p) free(p) -#endif - -#ifndef STBIW_REALLOC_SIZED -#define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz) -#endif - - -#ifndef STBIW_MEMMOVE -#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz) -#endif - - -#ifndef STBIW_ASSERT -#include -#define STBIW_ASSERT(x) assert(x) -#endif - -#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff) - -#ifdef STB_IMAGE_WRITE_STATIC -static int stbi_write_png_compression_level = 8; -static int stbi_write_tga_with_rle = 1; -static int stbi_write_force_png_filter = -1; -#else -int stbi_write_png_compression_level = 8; -int stbi_write_tga_with_rle = 1; -int stbi_write_force_png_filter = -1; -#endif - -static int stbi__flip_vertically_on_write = 0; - -STBIWDEF void stbi_flip_vertically_on_write(int flag) -{ - stbi__flip_vertically_on_write = flag; -} - -typedef struct -{ - stbi_write_func *func; - void *context; - unsigned char buffer[64]; - int buf_used; -} stbi__write_context; - -// initialize a callback-based context -static void stbi__start_write_callbacks(stbi__write_context *s, stbi_write_func *c, void *context) -{ - s->func = c; - s->context = context; -} - -#ifndef STBI_WRITE_NO_STDIO - -static void stbi__stdio_write(void *context, void *data, int size) -{ - fwrite(data,1,size,(FILE*) context); -} - -#if defined(_WIN32) && defined(STBIW_WINDOWS_UTF8) -#ifdef __cplusplus -#define STBIW_EXTERN extern "C" -#else -#define STBIW_EXTERN extern -#endif -STBIW_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, int cchwide); -STBIW_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default); - -STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input) -{ - return WideCharToMultiByte(65001 /* UTF8 */, 0, input, -1, buffer, (int) bufferlen, NULL, NULL); -} -#endif - -static FILE *stbiw__fopen(char const *filename, char const *mode) -{ - FILE *f; -#if defined(_WIN32) && defined(STBIW_WINDOWS_UTF8) - wchar_t wMode[64]; - wchar_t wFilename[1024]; - if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)/sizeof(*wFilename))) - return 0; - - if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)/sizeof(*wMode))) - return 0; - -#if defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != _wfopen_s(&f, wFilename, wMode)) - f = 0; -#else - f = _wfopen(wFilename, wMode); -#endif - -#elif defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != fopen_s(&f, filename, mode)) - f=0; -#else - f = fopen(filename, mode); -#endif - return f; -} - -static int stbi__start_write_file(stbi__write_context *s, const char *filename) -{ - FILE *f = stbiw__fopen(filename, "wb"); - stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f); - return f != NULL; -} - -static void stbi__end_write_file(stbi__write_context *s) -{ - fclose((FILE *)s->context); -} - -#endif // !STBI_WRITE_NO_STDIO - -typedef unsigned int stbiw_uint32; -typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1]; - -static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v) -{ - while (*fmt) { - switch (*fmt++) { - case ' ': break; - case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int)); - s->func(s->context,&x,1); - break; } - case '2': { int x = va_arg(v,int); - unsigned char b[2]; - b[0] = STBIW_UCHAR(x); - b[1] = STBIW_UCHAR(x>>8); - s->func(s->context,b,2); - break; } - case '4': { stbiw_uint32 x = va_arg(v,int); - unsigned char b[4]; - b[0]=STBIW_UCHAR(x); - b[1]=STBIW_UCHAR(x>>8); - b[2]=STBIW_UCHAR(x>>16); - b[3]=STBIW_UCHAR(x>>24); - s->func(s->context,b,4); - break; } - default: - STBIW_ASSERT(0); - return; - } - } -} - -static void stbiw__writef(stbi__write_context *s, const char *fmt, ...) -{ - va_list v; - va_start(v, fmt); - stbiw__writefv(s, fmt, v); - va_end(v); -} - -static void stbiw__write_flush(stbi__write_context *s) -{ - if (s->buf_used) { - s->func(s->context, &s->buffer, s->buf_used); - s->buf_used = 0; - } -} - -static void stbiw__putc(stbi__write_context *s, unsigned char c) -{ - s->func(s->context, &c, 1); -} - -static void stbiw__write1(stbi__write_context *s, unsigned char a) -{ - if ((size_t)s->buf_used + 1 > sizeof(s->buffer)) - stbiw__write_flush(s); - s->buffer[s->buf_used++] = a; -} - -static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c) -{ - int n; - if ((size_t)s->buf_used + 3 > sizeof(s->buffer)) - stbiw__write_flush(s); - n = s->buf_used; - s->buf_used = n+3; - s->buffer[n+0] = a; - s->buffer[n+1] = b; - s->buffer[n+2] = c; -} - -static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d) -{ - unsigned char bg[3] = { 255, 0, 255}, px[3]; - int k; - - if (write_alpha < 0) - stbiw__write1(s, d[comp - 1]); - - switch (comp) { - case 2: // 2 pixels = mono + alpha, alpha is written separately, so same as 1-channel case - case 1: - if (expand_mono) - stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp - else - stbiw__write1(s, d[0]); // monochrome TGA - break; - case 4: - if (!write_alpha) { - // composite against pink background - for (k = 0; k < 3; ++k) - px[k] = bg[k] + ((d[k] - bg[k]) * d[3]) / 255; - stbiw__write3(s, px[1 - rgb_dir], px[1], px[1 + rgb_dir]); - break; - } - /* FALLTHROUGH */ - case 3: - stbiw__write3(s, d[1 - rgb_dir], d[1], d[1 + rgb_dir]); - break; - } - if (write_alpha > 0) - stbiw__write1(s, d[comp - 1]); -} - -static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono) -{ - stbiw_uint32 zero = 0; - int i,j, j_end; - - if (y <= 0) - return; - - if (stbi__flip_vertically_on_write) - vdir *= -1; - - if (vdir < 0) { - j_end = -1; j = y-1; - } else { - j_end = y; j = 0; - } - - for (; j != j_end; j += vdir) { - for (i=0; i < x; ++i) { - unsigned char *d = (unsigned char *) data + (j*x+i)*comp; - stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d); - } - stbiw__write_flush(s); - s->func(s->context, &zero, scanline_pad); - } -} - -static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, int expand_mono, void *data, int alpha, int pad, const char *fmt, ...) -{ - if (y < 0 || x < 0) { - return 0; - } else { - va_list v; - va_start(v, fmt); - stbiw__writefv(s, fmt, v); - va_end(v); - stbiw__write_pixels(s,rgb_dir,vdir,x,y,comp,data,alpha,pad, expand_mono); - return 1; - } -} - -static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data) -{ - if (comp != 4) { - // write RGB bitmap - int pad = (-x*3) & 3; - return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad, - "11 4 22 4" "4 44 22 444444", - 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header - 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header - } else { - // RGBA bitmaps need a v4 header - // use BI_BITFIELDS mode with 32bpp and alpha mask - // (straight BI_RGB with alpha mask doesn't work in most readers) - return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *)data,1,0, - "11 4 22 4" "4 44 22 444444 4444 4 444 444 444 444", - 'B', 'M', 14+108+x*y*4, 0, 0, 14+108, // file header - 108, x,y, 1,32, 3,0,0,0,0,0, 0xff0000,0xff00,0xff,0xff000000u, 0, 0,0,0, 0,0,0, 0,0,0, 0,0,0); // bitmap V4 header - } -} - -STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) -{ - stbi__write_context s = { 0 }; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_bmp_core(&s, x, y, comp, data); -} - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data) -{ - stbi__write_context s = { 0 }; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_bmp_core(&s, x, y, comp, data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif //!STBI_WRITE_NO_STDIO - -static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, void *data) -{ - int has_alpha = (comp == 2 || comp == 4); - int colorbytes = has_alpha ? comp-1 : comp; - int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3 - - if (y < 0 || x < 0) - return 0; - - if (!stbi_write_tga_with_rle) { - return stbiw__outfile(s, -1, -1, x, y, comp, 0, (void *) data, has_alpha, 0, - "111 221 2222 11", 0, 0, format, 0, 0, 0, 0, 0, x, y, (colorbytes + has_alpha) * 8, has_alpha * 8); - } else { - int i,j,k; - int jend, jdir; - - stbiw__writef(s, "111 221 2222 11", 0,0,format+8, 0,0,0, 0,0,x,y, (colorbytes + has_alpha) * 8, has_alpha * 8); - - if (stbi__flip_vertically_on_write) { - j = 0; - jend = y; - jdir = 1; - } else { - j = y-1; - jend = -1; - jdir = -1; - } - for (; j != jend; j += jdir) { - unsigned char *row = (unsigned char *) data + j * x * comp; - int len; - - for (i = 0; i < x; i += len) { - unsigned char *begin = row + i * comp; - int diff = 1; - len = 1; - - if (i < x - 1) { - ++len; - diff = memcmp(begin, row + (i + 1) * comp, comp); - if (diff) { - const unsigned char *prev = begin; - for (k = i + 2; k < x && len < 128; ++k) { - if (memcmp(prev, row + k * comp, comp)) { - prev += comp; - ++len; - } else { - --len; - break; - } - } - } else { - for (k = i + 2; k < x && len < 128; ++k) { - if (!memcmp(begin, row + k * comp, comp)) { - ++len; - } else { - break; - } - } - } - } - - if (diff) { - unsigned char header = STBIW_UCHAR(len - 1); - stbiw__write1(s, header); - for (k = 0; k < len; ++k) { - stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp); - } - } else { - unsigned char header = STBIW_UCHAR(len - 129); - stbiw__write1(s, header); - stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin); - } - } - } - stbiw__write_flush(s); - } - return 1; -} - -STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) -{ - stbi__write_context s = { 0 }; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_tga_core(&s, x, y, comp, (void *) data); -} - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data) -{ - stbi__write_context s = { 0 }; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_tga_core(&s, x, y, comp, (void *) data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif - -// ************************************************************************************************* -// Radiance RGBE HDR writer -// by Baldur Karlsson - -#define stbiw__max(a, b) ((a) > (b) ? (a) : (b)) - -#ifndef STBI_WRITE_NO_STDIO - -static void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) -{ - int exponent; - float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2])); - - if (maxcomp < 1e-32f) { - rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0; - } else { - float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp; - - rgbe[0] = (unsigned char)(linear[0] * normalize); - rgbe[1] = (unsigned char)(linear[1] * normalize); - rgbe[2] = (unsigned char)(linear[2] * normalize); - rgbe[3] = (unsigned char)(exponent + 128); - } -} - -static void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte) -{ - unsigned char lengthbyte = STBIW_UCHAR(length+128); - STBIW_ASSERT(length+128 <= 255); - s->func(s->context, &lengthbyte, 1); - s->func(s->context, &databyte, 1); -} - -static void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data) -{ - unsigned char lengthbyte = STBIW_UCHAR(length); - STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code - s->func(s->context, &lengthbyte, 1); - s->func(s->context, data, length); -} - -static void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline) -{ - unsigned char scanlineheader[4] = { 2, 2, 0, 0 }; - unsigned char rgbe[4]; - float linear[3]; - int x; - - scanlineheader[2] = (width&0xff00)>>8; - scanlineheader[3] = (width&0x00ff); - - /* skip RLE for images too small or large */ - if (width < 8 || width >= 32768) { - for (x=0; x < width; x++) { - switch (ncomp) { - case 4: /* fallthrough */ - case 3: linear[2] = scanline[x*ncomp + 2]; - linear[1] = scanline[x*ncomp + 1]; - linear[0] = scanline[x*ncomp + 0]; - break; - default: - linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; - break; - } - stbiw__linear_to_rgbe(rgbe, linear); - s->func(s->context, rgbe, 4); - } - } else { - int c,r; - /* encode into scratch buffer */ - for (x=0; x < width; x++) { - switch(ncomp) { - case 4: /* fallthrough */ - case 3: linear[2] = scanline[x*ncomp + 2]; - linear[1] = scanline[x*ncomp + 1]; - linear[0] = scanline[x*ncomp + 0]; - break; - default: - linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; - break; - } - stbiw__linear_to_rgbe(rgbe, linear); - scratch[x + width*0] = rgbe[0]; - scratch[x + width*1] = rgbe[1]; - scratch[x + width*2] = rgbe[2]; - scratch[x + width*3] = rgbe[3]; - } - - s->func(s->context, scanlineheader, 4); - - /* RLE each component separately */ - for (c=0; c < 4; c++) { - unsigned char *comp = &scratch[width*c]; - - x = 0; - while (x < width) { - // find first run - r = x; - while (r+2 < width) { - if (comp[r] == comp[r+1] && comp[r] == comp[r+2]) - break; - ++r; - } - if (r+2 >= width) - r = width; - // dump up to first run - while (x < r) { - int len = r-x; - if (len > 128) len = 128; - stbiw__write_dump_data(s, len, &comp[x]); - x += len; - } - // if there's a run, output it - if (r+2 < width) { // same test as what we break out of in search loop, so only true if we break'd - // find next byte after run - while (r < width && comp[r] == comp[x]) - ++r; - // output run up to r - while (x < r) { - int len = r-x; - if (len > 127) len = 127; - stbiw__write_run_data(s, len, comp[x]); - x += len; - } - } - } - } - } -} - -static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data) -{ - if (y <= 0 || x <= 0 || data == NULL) - return 0; - else { - // Each component is stored separately. Allocate scratch space for full output scanline. - unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4); - int i, len; - char buffer[128]; - char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n"; - s->func(s->context, header, sizeof(header)-1); - -#ifdef __STDC_LIB_EXT1__ - len = sprintf_s(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); -#else - len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); -#endif - s->func(s->context, buffer, len); - - for(i=0; i < y; i++) - stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i)); - STBIW_FREE(scratch); - return 1; - } -} - -STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data) -{ - stbi__write_context s = { 0 }; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_hdr_core(&s, x, y, comp, (float *) data); -} - -STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data) -{ - stbi__write_context s = { 0 }; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif // STBI_WRITE_NO_STDIO - - -////////////////////////////////////////////////////////////////////////////// -// -// PNG writer -// - -#ifndef STBIW_ZLIB_COMPRESS -// stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size() -#define stbiw__sbraw(a) ((int *) (void *) (a) - 2) -#define stbiw__sbm(a) stbiw__sbraw(a)[0] -#define stbiw__sbn(a) stbiw__sbraw(a)[1] - -#define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a)) -#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0) -#define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a))) - -#define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v)) -#define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0) -#define stbiw__sbfree(a) ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0) - -static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) -{ - int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; - void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); - STBIW_ASSERT(p); - if (p) { - if (!*arr) ((int *) p)[1] = 0; - *arr = (void *) ((int *) p + 2); - stbiw__sbm(*arr) = m; - } - return *arr; -} - -static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount) -{ - while (*bitcount >= 8) { - stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer)); - *bitbuffer >>= 8; - *bitcount -= 8; - } - return data; -} - -static int stbiw__zlib_bitrev(int code, int codebits) -{ - int res=0; - while (codebits--) { - res = (res << 1) | (code & 1); - code >>= 1; - } - return res; -} - -static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit) -{ - int i; - for (i=0; i < limit && i < 258; ++i) - if (a[i] != b[i]) break; - return i; -} - -static unsigned int stbiw__zhash(unsigned char *data) -{ - stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16); - hash ^= hash << 3; - hash += hash >> 5; - hash ^= hash << 4; - hash += hash >> 17; - hash ^= hash << 25; - hash += hash >> 6; - return hash; -} - -#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount)) -#define stbiw__zlib_add(code,codebits) \ - (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush()) -#define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c) -// default huffman tables -#define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8) -#define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9) -#define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7) -#define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8) -#define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n)) -#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n)) - -#define stbiw__ZHASH 16384 - -#endif // STBIW_ZLIB_COMPRESS - -STBIWDEF unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) -{ -#ifdef STBIW_ZLIB_COMPRESS - // user provided a zlib compress implementation, use that - return STBIW_ZLIB_COMPRESS(data, data_len, out_len, quality); -#else // use builtin - static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 }; - static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; - static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 }; - static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 }; - unsigned int bitbuf=0; - int i,j, bitcount=0; - unsigned char *out = NULL; - unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(unsigned char**)); - if (hash_table == NULL) - return NULL; - if (quality < 5) quality = 5; - - stbiw__sbpush(out, 0x78); // DEFLATE 32K window - stbiw__sbpush(out, 0x5e); // FLEVEL = 1 - stbiw__zlib_add(1,1); // BFINAL = 1 - stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman - - for (i=0; i < stbiw__ZHASH; ++i) - hash_table[i] = NULL; - - i=0; - while (i < data_len-3) { - // hash next 3 bytes of data to be compressed - int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3; - unsigned char *bestloc = 0; - unsigned char **hlist = hash_table[h]; - int n = stbiw__sbcount(hlist); - for (j=0; j < n; ++j) { - if (hlist[j]-data > i-32768) { // if entry lies within window - int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i); - if (d >= best) { best=d; bestloc=hlist[j]; } - } - } - // when hash table entry is too long, delete half the entries - if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) { - STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality); - stbiw__sbn(hash_table[h]) = quality; - } - stbiw__sbpush(hash_table[h],data+i); - - if (bestloc) { - // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal - h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1); - hlist = hash_table[h]; - n = stbiw__sbcount(hlist); - for (j=0; j < n; ++j) { - if (hlist[j]-data > i-32767) { - int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1); - if (e > best) { // if next match is better, bail on current match - bestloc = NULL; - break; - } - } - } - } - - if (bestloc) { - int d = (int) (data+i - bestloc); // distance back - STBIW_ASSERT(d <= 32767 && best <= 258); - for (j=0; best > lengthc[j+1]-1; ++j); - stbiw__zlib_huff(j+257); - if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]); - for (j=0; d > distc[j+1]-1; ++j); - stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5); - if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]); - i += best; - } else { - stbiw__zlib_huffb(data[i]); - ++i; - } - } - // write out final bytes - for (;i < data_len; ++i) - stbiw__zlib_huffb(data[i]); - stbiw__zlib_huff(256); // end of block - // pad with 0 bits to byte boundary - while (bitcount) - stbiw__zlib_add(0,1); - - for (i=0; i < stbiw__ZHASH; ++i) - (void) stbiw__sbfree(hash_table[i]); - STBIW_FREE(hash_table); - - // store uncompressed instead if compression was worse - if (stbiw__sbn(out) > data_len + 2 + ((data_len+32766)/32767)*5) { - stbiw__sbn(out) = 2; // truncate to DEFLATE 32K window and FLEVEL = 1 - for (j = 0; j < data_len;) { - int blocklen = data_len - j; - if (blocklen > 32767) blocklen = 32767; - stbiw__sbpush(out, data_len - j == blocklen); // BFINAL = ?, BTYPE = 0 -- no compression - stbiw__sbpush(out, STBIW_UCHAR(blocklen)); // LEN - stbiw__sbpush(out, STBIW_UCHAR(blocklen >> 8)); - stbiw__sbpush(out, STBIW_UCHAR(~blocklen)); // NLEN - stbiw__sbpush(out, STBIW_UCHAR(~blocklen >> 8)); - memcpy(out+stbiw__sbn(out), data+j, blocklen); - stbiw__sbn(out) += blocklen; - j += blocklen; - } - } - - { - // compute adler32 on input - unsigned int s1=1, s2=0; - int blocklen = (int) (data_len % 5552); - j=0; - while (j < data_len) { - for (i=0; i < blocklen; ++i) { s1 += data[j+i]; s2 += s1; } - s1 %= 65521; s2 %= 65521; - j += blocklen; - blocklen = 5552; - } - stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8)); - stbiw__sbpush(out, STBIW_UCHAR(s2)); - stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8)); - stbiw__sbpush(out, STBIW_UCHAR(s1)); - } - *out_len = stbiw__sbn(out); - // make returned pointer freeable - STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len); - return (unsigned char *) stbiw__sbraw(out); -#endif // STBIW_ZLIB_COMPRESS -} - -static unsigned int stbiw__crc32(unsigned char *buffer, int len) -{ -#ifdef STBIW_CRC32 - return STBIW_CRC32(buffer, len); -#else - static unsigned int crc_table[256] = - { - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, - 0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, - 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, - 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, - 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, - 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, - 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, - 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, - 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, - 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, - 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, - 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, - 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, - 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, - 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, - 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, - 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, - 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D - }; - - unsigned int crc = ~0u; - int i; - for (i=0; i < len; ++i) - crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)]; - return ~crc; -#endif -} - -#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4) -#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v)); -#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3]) - -static void stbiw__wpcrc(unsigned char **data, int len) -{ - unsigned int crc = stbiw__crc32(*data - len - 4, len+4); - stbiw__wp32(*data, crc); -} - -static unsigned char stbiw__paeth(int a, int b, int c) -{ - int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c); - if (pa <= pb && pa <= pc) return STBIW_UCHAR(a); - if (pb <= pc) return STBIW_UCHAR(b); - return STBIW_UCHAR(c); -} - -// @OPTIMIZE: provide an option that always forces left-predict or paeth predict -static void stbiw__encode_png_line(unsigned char *pixels, int stride_bytes, int width, int height, int y, int n, int filter_type, signed char *line_buffer) -{ - static int mapping[] = { 0,1,2,3,4 }; - static int firstmap[] = { 0,1,0,5,6 }; - int *mymap = (y != 0) ? mapping : firstmap; - int i; - int type = mymap[filter_type]; - unsigned char *z = pixels + stride_bytes * (stbi__flip_vertically_on_write ? height-1-y : y); - int signed_stride = stbi__flip_vertically_on_write ? -stride_bytes : stride_bytes; - - if (type==0) { - memcpy(line_buffer, z, width*n); - return; - } - - // first loop isn't optimized since it's just one pixel - for (i = 0; i < n; ++i) { - switch (type) { - case 1: line_buffer[i] = z[i]; break; - case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break; - case 3: line_buffer[i] = z[i] - (z[i-signed_stride]>>1); break; - case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-signed_stride],0)); break; - case 5: line_buffer[i] = z[i]; break; - case 6: line_buffer[i] = z[i]; break; - } - } - switch (type) { - case 1: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-n]; break; - case 2: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-signed_stride]; break; - case 3: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - ((z[i-n] + z[i-signed_stride])>>1); break; - case 4: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-signed_stride], z[i-signed_stride-n]); break; - case 5: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - (z[i-n]>>1); break; - case 6: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break; - } -} - -STBIWDEF unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) -{ - int force_filter = stbi_write_force_png_filter; - int ctype[5] = { -1, 0, 4, 2, 6 }; - unsigned char sig[8] = { 137,80,78,71,13,10,26,10 }; - unsigned char *out,*o, *filt, *zlib; - signed char *line_buffer; - int j,zlen; - - if (stride_bytes == 0) - stride_bytes = x * n; - - if (force_filter >= 5) { - force_filter = -1; - } - - filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0; - line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; } - for (j=0; j < y; ++j) { - int filter_type; - if (force_filter > -1) { - filter_type = force_filter; - stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, force_filter, line_buffer); - } else { // Estimate the best filter by running through all of them: - int best_filter = 0, best_filter_val = 0x7fffffff, est, i; - for (filter_type = 0; filter_type < 5; filter_type++) { - stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, filter_type, line_buffer); - - // Estimate the entropy of the line using this filter; the less, the better. - est = 0; - for (i = 0; i < x*n; ++i) { - est += abs((signed char) line_buffer[i]); - } - if (est < best_filter_val) { - best_filter_val = est; - best_filter = filter_type; - } - } - if (filter_type != best_filter) { // If the last iteration already got us the best filter, don't redo it - stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, best_filter, line_buffer); - filter_type = best_filter; - } - } - // when we get here, filter_type contains the filter type, and line_buffer contains the data - filt[j*(x*n+1)] = (unsigned char) filter_type; - STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n); - } - STBIW_FREE(line_buffer); - zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, stbi_write_png_compression_level); - STBIW_FREE(filt); - if (!zlib) return 0; - - // each tag requires 12 bytes of overhead - out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12); - if (!out) return 0; - *out_len = 8 + 12+13 + 12+zlen + 12; - - o=out; - STBIW_MEMMOVE(o,sig,8); o+= 8; - stbiw__wp32(o, 13); // header length - stbiw__wptag(o, "IHDR"); - stbiw__wp32(o, x); - stbiw__wp32(o, y); - *o++ = 8; - *o++ = STBIW_UCHAR(ctype[n]); - *o++ = 0; - *o++ = 0; - *o++ = 0; - stbiw__wpcrc(&o,13); - - stbiw__wp32(o, zlen); - stbiw__wptag(o, "IDAT"); - STBIW_MEMMOVE(o, zlib, zlen); - o += zlen; - STBIW_FREE(zlib); - stbiw__wpcrc(&o, zlen); - - stbiw__wp32(o,0); - stbiw__wptag(o, "IEND"); - stbiw__wpcrc(&o,0); - - STBIW_ASSERT(o == out + *out_len); - - return out; -} - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes) -{ - FILE *f; - int len; - unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len); - if (png == NULL) return 0; - - f = stbiw__fopen(filename, "wb"); - if (!f) { STBIW_FREE(png); return 0; } - fwrite(png, 1, len, f); - fclose(f); - STBIW_FREE(png); - return 1; -} -#endif - -STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes) -{ - int len; - unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len); - if (png == NULL) return 0; - func(context, png, len); - STBIW_FREE(png); - return 1; -} - - -/* *************************************************************************** - * - * JPEG writer - * - * This is based on Jon Olick's jo_jpeg.cpp: - * public domain Simple, Minimalistic JPEG writer - http://www.jonolick.com/code.html - */ - -static const unsigned char stbiw__jpg_ZigZag[] = { 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18, - 24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63 }; - -static void stbiw__jpg_writeBits(stbi__write_context *s, int *bitBufP, int *bitCntP, const unsigned short *bs) { - int bitBuf = *bitBufP, bitCnt = *bitCntP; - bitCnt += bs[1]; - bitBuf |= bs[0] << (24 - bitCnt); - while(bitCnt >= 8) { - unsigned char c = (bitBuf >> 16) & 255; - stbiw__putc(s, c); - if(c == 255) { - stbiw__putc(s, 0); - } - bitBuf <<= 8; - bitCnt -= 8; - } - *bitBufP = bitBuf; - *bitCntP = bitCnt; -} - -static void stbiw__jpg_DCT(float *d0p, float *d1p, float *d2p, float *d3p, float *d4p, float *d5p, float *d6p, float *d7p) { - float d0 = *d0p, d1 = *d1p, d2 = *d2p, d3 = *d3p, d4 = *d4p, d5 = *d5p, d6 = *d6p, d7 = *d7p; - float z1, z2, z3, z4, z5, z11, z13; - - float tmp0 = d0 + d7; - float tmp7 = d0 - d7; - float tmp1 = d1 + d6; - float tmp6 = d1 - d6; - float tmp2 = d2 + d5; - float tmp5 = d2 - d5; - float tmp3 = d3 + d4; - float tmp4 = d3 - d4; - - // Even part - float tmp10 = tmp0 + tmp3; // phase 2 - float tmp13 = tmp0 - tmp3; - float tmp11 = tmp1 + tmp2; - float tmp12 = tmp1 - tmp2; - - d0 = tmp10 + tmp11; // phase 3 - d4 = tmp10 - tmp11; - - z1 = (tmp12 + tmp13) * 0.707106781f; // c4 - d2 = tmp13 + z1; // phase 5 - d6 = tmp13 - z1; - - // Odd part - tmp10 = tmp4 + tmp5; // phase 2 - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - - // The rotator is modified from fig 4-8 to avoid extra negations. - z5 = (tmp10 - tmp12) * 0.382683433f; // c6 - z2 = tmp10 * 0.541196100f + z5; // c2-c6 - z4 = tmp12 * 1.306562965f + z5; // c2+c6 - z3 = tmp11 * 0.707106781f; // c4 - - z11 = tmp7 + z3; // phase 5 - z13 = tmp7 - z3; - - *d5p = z13 + z2; // phase 6 - *d3p = z13 - z2; - *d1p = z11 + z4; - *d7p = z11 - z4; - - *d0p = d0; *d2p = d2; *d4p = d4; *d6p = d6; -} - -static void stbiw__jpg_calcBits(int val, unsigned short bits[2]) { - int tmp1 = val < 0 ? -val : val; - val = val < 0 ? val-1 : val; - bits[1] = 1; - while(tmp1 >>= 1) { - ++bits[1]; - } - bits[0] = val & ((1<0)&&(DU[end0pos]==0); --end0pos) { - } - // end0pos = first element in reverse order !=0 - if(end0pos == 0) { - stbiw__jpg_writeBits(s, bitBuf, bitCnt, EOB); - return DU[0]; - } - for(i = 1; i <= end0pos; ++i) { - int startpos = i; - int nrzeroes; - unsigned short bits[2]; - for (; DU[i]==0 && i<=end0pos; ++i) { - } - nrzeroes = i-startpos; - if ( nrzeroes >= 16 ) { - int lng = nrzeroes>>4; - int nrmarker; - for (nrmarker=1; nrmarker <= lng; ++nrmarker) - stbiw__jpg_writeBits(s, bitBuf, bitCnt, M16zeroes); - nrzeroes &= 15; - } - stbiw__jpg_calcBits(DU[i], bits); - stbiw__jpg_writeBits(s, bitBuf, bitCnt, HTAC[(nrzeroes<<4)+bits[1]]); - stbiw__jpg_writeBits(s, bitBuf, bitCnt, bits); - } - if(end0pos != 63) { - stbiw__jpg_writeBits(s, bitBuf, bitCnt, EOB); - } - return DU[0]; -} - -static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, int comp, const void* data, int quality) { - // Constants that don't pollute global namespace - static const unsigned char std_dc_luminance_nrcodes[] = {0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0}; - static const unsigned char std_dc_luminance_values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; - static const unsigned char std_ac_luminance_nrcodes[] = {0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,0x7d}; - static const unsigned char std_ac_luminance_values[] = { - 0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,0x21,0x31,0x41,0x06,0x13,0x51,0x61,0x07,0x22,0x71,0x14,0x32,0x81,0x91,0xa1,0x08, - 0x23,0x42,0xb1,0xc1,0x15,0x52,0xd1,0xf0,0x24,0x33,0x62,0x72,0x82,0x09,0x0a,0x16,0x17,0x18,0x19,0x1a,0x25,0x26,0x27,0x28, - 0x29,0x2a,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59, - 0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x83,0x84,0x85,0x86,0x87,0x88,0x89, - 0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6, - 0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe1,0xe2, - 0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa - }; - static const unsigned char std_dc_chrominance_nrcodes[] = {0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0}; - static const unsigned char std_dc_chrominance_values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; - static const unsigned char std_ac_chrominance_nrcodes[] = {0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,0x77}; - static const unsigned char std_ac_chrominance_values[] = { - 0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71,0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91, - 0xa1,0xb1,0xc1,0x09,0x23,0x33,0x52,0xf0,0x15,0x62,0x72,0xd1,0x0a,0x16,0x24,0x34,0xe1,0x25,0xf1,0x17,0x18,0x19,0x1a,0x26, - 0x27,0x28,0x29,0x2a,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58, - 0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x82,0x83,0x84,0x85,0x86,0x87, - 0x88,0x89,0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4, - 0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda, - 0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa - }; - // Huffman tables - static const unsigned short YDC_HT[256][2] = { {0,2},{2,3},{3,3},{4,3},{5,3},{6,3},{14,4},{30,5},{62,6},{126,7},{254,8},{510,9}}; - static const unsigned short UVDC_HT[256][2] = { {0,2},{1,2},{2,2},{6,3},{14,4},{30,5},{62,6},{126,7},{254,8},{510,9},{1022,10},{2046,11}}; - static const unsigned short YAC_HT[256][2] = { - {10,4},{0,2},{1,2},{4,3},{11,4},{26,5},{120,7},{248,8},{1014,10},{65410,16},{65411,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {12,4},{27,5},{121,7},{502,9},{2038,11},{65412,16},{65413,16},{65414,16},{65415,16},{65416,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {28,5},{249,8},{1015,10},{4084,12},{65417,16},{65418,16},{65419,16},{65420,16},{65421,16},{65422,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {58,6},{503,9},{4085,12},{65423,16},{65424,16},{65425,16},{65426,16},{65427,16},{65428,16},{65429,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {59,6},{1016,10},{65430,16},{65431,16},{65432,16},{65433,16},{65434,16},{65435,16},{65436,16},{65437,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {122,7},{2039,11},{65438,16},{65439,16},{65440,16},{65441,16},{65442,16},{65443,16},{65444,16},{65445,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {123,7},{4086,12},{65446,16},{65447,16},{65448,16},{65449,16},{65450,16},{65451,16},{65452,16},{65453,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {250,8},{4087,12},{65454,16},{65455,16},{65456,16},{65457,16},{65458,16},{65459,16},{65460,16},{65461,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {504,9},{32704,15},{65462,16},{65463,16},{65464,16},{65465,16},{65466,16},{65467,16},{65468,16},{65469,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {505,9},{65470,16},{65471,16},{65472,16},{65473,16},{65474,16},{65475,16},{65476,16},{65477,16},{65478,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {506,9},{65479,16},{65480,16},{65481,16},{65482,16},{65483,16},{65484,16},{65485,16},{65486,16},{65487,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {1017,10},{65488,16},{65489,16},{65490,16},{65491,16},{65492,16},{65493,16},{65494,16},{65495,16},{65496,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {1018,10},{65497,16},{65498,16},{65499,16},{65500,16},{65501,16},{65502,16},{65503,16},{65504,16},{65505,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {2040,11},{65506,16},{65507,16},{65508,16},{65509,16},{65510,16},{65511,16},{65512,16},{65513,16},{65514,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {65515,16},{65516,16},{65517,16},{65518,16},{65519,16},{65520,16},{65521,16},{65522,16},{65523,16},{65524,16},{0,0},{0,0},{0,0},{0,0},{0,0}, - {2041,11},{65525,16},{65526,16},{65527,16},{65528,16},{65529,16},{65530,16},{65531,16},{65532,16},{65533,16},{65534,16},{0,0},{0,0},{0,0},{0,0},{0,0} - }; - static const unsigned short UVAC_HT[256][2] = { - {0,2},{1,2},{4,3},{10,4},{24,5},{25,5},{56,6},{120,7},{500,9},{1014,10},{4084,12},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {11,4},{57,6},{246,8},{501,9},{2038,11},{4085,12},{65416,16},{65417,16},{65418,16},{65419,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {26,5},{247,8},{1015,10},{4086,12},{32706,15},{65420,16},{65421,16},{65422,16},{65423,16},{65424,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {27,5},{248,8},{1016,10},{4087,12},{65425,16},{65426,16},{65427,16},{65428,16},{65429,16},{65430,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {58,6},{502,9},{65431,16},{65432,16},{65433,16},{65434,16},{65435,16},{65436,16},{65437,16},{65438,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {59,6},{1017,10},{65439,16},{65440,16},{65441,16},{65442,16},{65443,16},{65444,16},{65445,16},{65446,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {121,7},{2039,11},{65447,16},{65448,16},{65449,16},{65450,16},{65451,16},{65452,16},{65453,16},{65454,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {122,7},{2040,11},{65455,16},{65456,16},{65457,16},{65458,16},{65459,16},{65460,16},{65461,16},{65462,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {249,8},{65463,16},{65464,16},{65465,16},{65466,16},{65467,16},{65468,16},{65469,16},{65470,16},{65471,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {503,9},{65472,16},{65473,16},{65474,16},{65475,16},{65476,16},{65477,16},{65478,16},{65479,16},{65480,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {504,9},{65481,16},{65482,16},{65483,16},{65484,16},{65485,16},{65486,16},{65487,16},{65488,16},{65489,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {505,9},{65490,16},{65491,16},{65492,16},{65493,16},{65494,16},{65495,16},{65496,16},{65497,16},{65498,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {506,9},{65499,16},{65500,16},{65501,16},{65502,16},{65503,16},{65504,16},{65505,16},{65506,16},{65507,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {2041,11},{65508,16},{65509,16},{65510,16},{65511,16},{65512,16},{65513,16},{65514,16},{65515,16},{65516,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, - {16352,14},{65517,16},{65518,16},{65519,16},{65520,16},{65521,16},{65522,16},{65523,16},{65524,16},{65525,16},{0,0},{0,0},{0,0},{0,0},{0,0}, - {1018,10},{32707,15},{65526,16},{65527,16},{65528,16},{65529,16},{65530,16},{65531,16},{65532,16},{65533,16},{65534,16},{0,0},{0,0},{0,0},{0,0},{0,0} - }; - static const int YQT[] = {16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22, - 37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99}; - static const int UVQT[] = {17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99, - 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99}; - static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f, - 1.0f * 2.828427125f, 0.785694958f * 2.828427125f, 0.541196100f * 2.828427125f, 0.275899379f * 2.828427125f }; - - int row, col, i, k, subsample; - float fdtbl_Y[64], fdtbl_UV[64]; - unsigned char YTable[64], UVTable[64]; - - if(!data || !width || !height || comp > 4 || comp < 1) { - return 0; - } - - quality = quality ? quality : 90; - subsample = quality <= 90 ? 1 : 0; - quality = quality < 1 ? 1 : quality > 100 ? 100 : quality; - quality = quality < 50 ? 5000 / quality : 200 - quality * 2; - - for(i = 0; i < 64; ++i) { - int uvti, yti = (YQT[i]*quality+50)/100; - YTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (yti < 1 ? 1 : yti > 255 ? 255 : yti); - uvti = (UVQT[i]*quality+50)/100; - UVTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (uvti < 1 ? 1 : uvti > 255 ? 255 : uvti); - } - - for(row = 0, k = 0; row < 8; ++row) { - for(col = 0; col < 8; ++col, ++k) { - fdtbl_Y[k] = 1 / (YTable [stbiw__jpg_ZigZag[k]] * aasf[row] * aasf[col]); - fdtbl_UV[k] = 1 / (UVTable[stbiw__jpg_ZigZag[k]] * aasf[row] * aasf[col]); - } - } - - // Write Headers - { - static const unsigned char head0[] = { 0xFF,0xD8,0xFF,0xE0,0,0x10,'J','F','I','F',0,1,1,0,0,1,0,1,0,0,0xFF,0xDB,0,0x84,0 }; - static const unsigned char head2[] = { 0xFF,0xDA,0,0xC,3,1,0,2,0x11,3,0x11,0,0x3F,0 }; - const unsigned char head1[] = { 0xFF,0xC0,0,0x11,8,(unsigned char)(height>>8),STBIW_UCHAR(height),(unsigned char)(width>>8),STBIW_UCHAR(width), - 3,1,(unsigned char)(subsample?0x22:0x11),0,2,0x11,1,3,0x11,1,0xFF,0xC4,0x01,0xA2,0 }; - s->func(s->context, (void*)head0, sizeof(head0)); - s->func(s->context, (void*)YTable, sizeof(YTable)); - stbiw__putc(s, 1); - s->func(s->context, UVTable, sizeof(UVTable)); - s->func(s->context, (void*)head1, sizeof(head1)); - s->func(s->context, (void*)(std_dc_luminance_nrcodes+1), sizeof(std_dc_luminance_nrcodes)-1); - s->func(s->context, (void*)std_dc_luminance_values, sizeof(std_dc_luminance_values)); - stbiw__putc(s, 0x10); // HTYACinfo - s->func(s->context, (void*)(std_ac_luminance_nrcodes+1), sizeof(std_ac_luminance_nrcodes)-1); - s->func(s->context, (void*)std_ac_luminance_values, sizeof(std_ac_luminance_values)); - stbiw__putc(s, 1); // HTUDCinfo - s->func(s->context, (void*)(std_dc_chrominance_nrcodes+1), sizeof(std_dc_chrominance_nrcodes)-1); - s->func(s->context, (void*)std_dc_chrominance_values, sizeof(std_dc_chrominance_values)); - stbiw__putc(s, 0x11); // HTUACinfo - s->func(s->context, (void*)(std_ac_chrominance_nrcodes+1), sizeof(std_ac_chrominance_nrcodes)-1); - s->func(s->context, (void*)std_ac_chrominance_values, sizeof(std_ac_chrominance_values)); - s->func(s->context, (void*)head2, sizeof(head2)); - } - - // Encode 8x8 macroblocks - { - static const unsigned short fillBits[] = {0x7F, 7}; - int DCY=0, DCU=0, DCV=0; - int bitBuf=0, bitCnt=0; - // comp == 2 is grey+alpha (alpha is ignored) - int ofsG = comp > 2 ? 1 : 0, ofsB = comp > 2 ? 2 : 0; - const unsigned char *dataR = (const unsigned char *)data; - const unsigned char *dataG = dataR + ofsG; - const unsigned char *dataB = dataR + ofsB; - int x, y, pos; - if(subsample) { - for(y = 0; y < height; y += 16) { - for(x = 0; x < width; x += 16) { - float Y[256], U[256], V[256]; - for(row = y, pos = 0; row < y+16; ++row) { - // row >= height => use last input row - int clamped_row = (row < height) ? row : height - 1; - int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp; - for(col = x; col < x+16; ++col, ++pos) { - // if col >= width => use pixel from last input column - int p = base_p + ((col < width) ? col : (width-1))*comp; - float r = dataR[p], g = dataG[p], b = dataB[p]; - Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128; - U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b; - V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b; - } - } - DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+0, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); - DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+8, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); - DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+128, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); - DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+136, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); - - // subsample U,V - { - float subU[64], subV[64]; - int yy, xx; - for(yy = 0, pos = 0; yy < 8; ++yy) { - for(xx = 0; xx < 8; ++xx, ++pos) { - int j = yy*32+xx*2; - subU[pos] = (U[j+0] + U[j+1] + U[j+16] + U[j+17]) * 0.25f; - subV[pos] = (V[j+0] + V[j+1] + V[j+16] + V[j+17]) * 0.25f; - } - } - DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subU, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); - DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subV, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); - } - } - } - } else { - for(y = 0; y < height; y += 8) { - for(x = 0; x < width; x += 8) { - float Y[64], U[64], V[64]; - for(row = y, pos = 0; row < y+8; ++row) { - // row >= height => use last input row - int clamped_row = (row < height) ? row : height - 1; - int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp; - for(col = x; col < x+8; ++col, ++pos) { - // if col >= width => use pixel from last input column - int p = base_p + ((col < width) ? col : (width-1))*comp; - float r = dataR[p], g = dataG[p], b = dataB[p]; - Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128; - U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b; - V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b; - } - } - - DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y, 8, fdtbl_Y, DCY, YDC_HT, YAC_HT); - DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, U, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); - DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, V, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); - } - } - } - - // Do the bit alignment of the EOI marker - stbiw__jpg_writeBits(s, &bitBuf, &bitCnt, fillBits); - } - - // EOI - stbiw__putc(s, 0xFF); - stbiw__putc(s, 0xD9); - - return 1; -} - -STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality) -{ - stbi__write_context s = { 0 }; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_jpg_core(&s, x, y, comp, (void *) data, quality); -} - - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality) -{ - stbi__write_context s = { 0 }; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_jpg_core(&s, x, y, comp, data, quality); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif - -#endif // STB_IMAGE_WRITE_IMPLEMENTATION - -/* Revision history - 1.16 (2021-07-11) - make Deflate code emit uncompressed blocks when it would otherwise expand - support writing BMPs with alpha channel - 1.15 (2020-07-13) unknown - 1.14 (2020-02-02) updated JPEG writer to downsample chroma channels - 1.13 - 1.12 - 1.11 (2019-08-11) - - 1.10 (2019-02-07) - support utf8 filenames in Windows; fix warnings and platform ifdefs - 1.09 (2018-02-11) - fix typo in zlib quality API, improve STB_I_W_STATIC in C++ - 1.08 (2018-01-29) - add stbi__flip_vertically_on_write, external zlib, zlib quality, choose PNG filter - 1.07 (2017-07-24) - doc fix - 1.06 (2017-07-23) - writing JPEG (using Jon Olick's code) - 1.05 ??? - 1.04 (2017-03-03) - monochrome BMP expansion - 1.03 ??? - 1.02 (2016-04-02) - avoid allocating large structures on the stack - 1.01 (2016-01-16) - STBIW_REALLOC_SIZED: support allocators with no realloc support - avoid race-condition in crc initialization - minor compile issues - 1.00 (2015-09-14) - installable file IO function - 0.99 (2015-09-13) - warning fixes; TGA rle support - 0.98 (2015-04-08) - added STBIW_MALLOC, STBIW_ASSERT etc - 0.97 (2015-01-18) - fixed HDR asserts, rewrote HDR rle logic - 0.96 (2015-01-17) - add HDR output - fix monochrome BMP - 0.95 (2014-08-17) - add monochrome TGA output - 0.94 (2014-05-31) - rename private functions to avoid conflicts with stb_image.h - 0.93 (2014-05-27) - warning fixes - 0.92 (2010-08-01) - casts to unsigned char to fix warnings - 0.91 (2010-07-17) - first public release - 0.90 first internal release -*/ - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_perlin.h b/FCLauncher/src/main/jni/lwjgl/stb/stb_perlin.h deleted file mode 100644 index 47cb9a43..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_perlin.h +++ /dev/null @@ -1,428 +0,0 @@ -// stb_perlin.h - v0.5 - perlin noise -// public domain single-file C implementation by Sean Barrett -// -// LICENSE -// -// See end of file. -// -// -// to create the implementation, -// #define STB_PERLIN_IMPLEMENTATION -// in *one* C/CPP file that includes this file. -// -// -// Documentation: -// -// float stb_perlin_noise3( float x, -// float y, -// float z, -// int x_wrap=0, -// int y_wrap=0, -// int z_wrap=0) -// -// This function 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.) -// -// float stb_perlin_noise3_seed( float x, -// float y, -// float z, -// int x_wrap=0, -// int y_wrap=0, -// int z_wrap=0, -// int seed) -// -// As above, but 'seed' selects from multiple different variations of the -// noise function. The current implementation only uses the bottom 8 bits -// of 'seed', but possibly in the future more bits will be used. -// -// -// Fractal Noise: -// -// Three common fractal noise functions are included, which produce -// a wide variety of nice effects depending on the parameters -// provided. Note that each function will call stb_perlin_noise3 -// 'octaves' times, so this parameter will affect runtime. -// -// float stb_perlin_ridge_noise3(float x, float y, float z, -// float lacunarity, float gain, float offset, int octaves) -// -// float stb_perlin_fbm_noise3(float x, float y, float z, -// float lacunarity, float gain, int octaves) -// -// float stb_perlin_turbulence_noise3(float x, float y, float z, -// float lacunarity, float gain, int octaves) -// -// Typical values to start playing with: -// octaves = 6 -- number of "octaves" of noise3() to sum -// lacunarity = ~ 2.0 -- spacing between successive octaves (use exactly 2.0 for wrapping output) -// gain = 0.5 -- relative weighting applied to each successive octave -// offset = 1.0? -- used to invert the ridges, may need to be larger, not sure -// -// -// Contributors: -// Jack Mott - additional noise functions -// Jordan Peck - seeded noise -// - - -#ifdef __cplusplus -extern "C" { -#endif -extern float stb_perlin_noise3(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap); -extern float stb_perlin_noise3_seed(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, int seed); -extern float stb_perlin_ridge_noise3(float x, float y, float z, float lacunarity, float gain, float offset, int octaves); -extern float stb_perlin_fbm_noise3(float x, float y, float z, float lacunarity, float gain, int octaves); -extern float stb_perlin_turbulence_noise3(float x, float y, float z, float lacunarity, float gain, int octaves); -extern float stb_perlin_noise3_wrap_nonpow2(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, unsigned char seed); -#ifdef __cplusplus -} -#endif - -#ifdef STB_PERLIN_IMPLEMENTATION - -#include // fabs() - -// not same permutation table as Perlin's reference to avoid copyright issues; -// Perlin's table can be found at http://mrl.nyu.edu/~perlin/noise/ -static unsigned char stb__perlin_randtab[512] = -{ - 23, 125, 161, 52, 103, 117, 70, 37, 247, 101, 203, 169, 124, 126, 44, 123, - 152, 238, 145, 45, 171, 114, 253, 10, 192, 136, 4, 157, 249, 30, 35, 72, - 175, 63, 77, 90, 181, 16, 96, 111, 133, 104, 75, 162, 93, 56, 66, 240, - 8, 50, 84, 229, 49, 210, 173, 239, 141, 1, 87, 18, 2, 198, 143, 57, - 225, 160, 58, 217, 168, 206, 245, 204, 199, 6, 73, 60, 20, 230, 211, 233, - 94, 200, 88, 9, 74, 155, 33, 15, 219, 130, 226, 202, 83, 236, 42, 172, - 165, 218, 55, 222, 46, 107, 98, 154, 109, 67, 196, 178, 127, 158, 13, 243, - 65, 79, 166, 248, 25, 224, 115, 80, 68, 51, 184, 128, 232, 208, 151, 122, - 26, 212, 105, 43, 179, 213, 235, 148, 146, 89, 14, 195, 28, 78, 112, 76, - 250, 47, 24, 251, 140, 108, 186, 190, 228, 170, 183, 139, 39, 188, 244, 246, - 132, 48, 119, 144, 180, 138, 134, 193, 82, 182, 120, 121, 86, 220, 209, 3, - 91, 241, 149, 85, 205, 150, 113, 216, 31, 100, 41, 164, 177, 214, 153, 231, - 38, 71, 185, 174, 97, 201, 29, 95, 7, 92, 54, 254, 191, 118, 34, 221, - 131, 11, 163, 99, 234, 81, 227, 147, 156, 176, 17, 142, 69, 12, 110, 62, - 27, 255, 0, 194, 59, 116, 242, 252, 19, 21, 187, 53, 207, 129, 64, 135, - 61, 40, 167, 237, 102, 223, 106, 159, 197, 189, 215, 137, 36, 32, 22, 5, - - // and a second copy so we don't need an extra mask or static initializer - 23, 125, 161, 52, 103, 117, 70, 37, 247, 101, 203, 169, 124, 126, 44, 123, - 152, 238, 145, 45, 171, 114, 253, 10, 192, 136, 4, 157, 249, 30, 35, 72, - 175, 63, 77, 90, 181, 16, 96, 111, 133, 104, 75, 162, 93, 56, 66, 240, - 8, 50, 84, 229, 49, 210, 173, 239, 141, 1, 87, 18, 2, 198, 143, 57, - 225, 160, 58, 217, 168, 206, 245, 204, 199, 6, 73, 60, 20, 230, 211, 233, - 94, 200, 88, 9, 74, 155, 33, 15, 219, 130, 226, 202, 83, 236, 42, 172, - 165, 218, 55, 222, 46, 107, 98, 154, 109, 67, 196, 178, 127, 158, 13, 243, - 65, 79, 166, 248, 25, 224, 115, 80, 68, 51, 184, 128, 232, 208, 151, 122, - 26, 212, 105, 43, 179, 213, 235, 148, 146, 89, 14, 195, 28, 78, 112, 76, - 250, 47, 24, 251, 140, 108, 186, 190, 228, 170, 183, 139, 39, 188, 244, 246, - 132, 48, 119, 144, 180, 138, 134, 193, 82, 182, 120, 121, 86, 220, 209, 3, - 91, 241, 149, 85, 205, 150, 113, 216, 31, 100, 41, 164, 177, 214, 153, 231, - 38, 71, 185, 174, 97, 201, 29, 95, 7, 92, 54, 254, 191, 118, 34, 221, - 131, 11, 163, 99, 234, 81, 227, 147, 156, 176, 17, 142, 69, 12, 110, 62, - 27, 255, 0, 194, 59, 116, 242, 252, 19, 21, 187, 53, 207, 129, 64, 135, - 61, 40, 167, 237, 102, 223, 106, 159, 197, 189, 215, 137, 36, 32, 22, 5, -}; - - -// perlin's gradient has 12 cases so some get used 1/16th of the time -// and some 2/16ths. We reduce bias by changing those fractions -// to 5/64ths and 6/64ths - -// this array is designed to match the previous implementation -// of gradient hash: indices[stb__perlin_randtab[i]&63] -static unsigned char stb__perlin_randtab_grad_idx[512] = -{ - 7, 9, 5, 0, 11, 1, 6, 9, 3, 9, 11, 1, 8, 10, 4, 7, - 8, 6, 1, 5, 3, 10, 9, 10, 0, 8, 4, 1, 5, 2, 7, 8, - 7, 11, 9, 10, 1, 0, 4, 7, 5, 0, 11, 6, 1, 4, 2, 8, - 8, 10, 4, 9, 9, 2, 5, 7, 9, 1, 7, 2, 2, 6, 11, 5, - 5, 4, 6, 9, 0, 1, 1, 0, 7, 6, 9, 8, 4, 10, 3, 1, - 2, 8, 8, 9, 10, 11, 5, 11, 11, 2, 6, 10, 3, 4, 2, 4, - 9, 10, 3, 2, 6, 3, 6, 10, 5, 3, 4, 10, 11, 2, 9, 11, - 1, 11, 10, 4, 9, 4, 11, 0, 4, 11, 4, 0, 0, 0, 7, 6, - 10, 4, 1, 3, 11, 5, 3, 4, 2, 9, 1, 3, 0, 1, 8, 0, - 6, 7, 8, 7, 0, 4, 6, 10, 8, 2, 3, 11, 11, 8, 0, 2, - 4, 8, 3, 0, 0, 10, 6, 1, 2, 2, 4, 5, 6, 0, 1, 3, - 11, 9, 5, 5, 9, 6, 9, 8, 3, 8, 1, 8, 9, 6, 9, 11, - 10, 7, 5, 6, 5, 9, 1, 3, 7, 0, 2, 10, 11, 2, 6, 1, - 3, 11, 7, 7, 2, 1, 7, 3, 0, 8, 1, 1, 5, 0, 6, 10, - 11, 11, 0, 2, 7, 0, 10, 8, 3, 5, 7, 1, 11, 1, 0, 7, - 9, 0, 11, 5, 10, 3, 2, 3, 5, 9, 7, 9, 8, 4, 6, 5, - - // and a second copy so we don't need an extra mask or static initializer - 7, 9, 5, 0, 11, 1, 6, 9, 3, 9, 11, 1, 8, 10, 4, 7, - 8, 6, 1, 5, 3, 10, 9, 10, 0, 8, 4, 1, 5, 2, 7, 8, - 7, 11, 9, 10, 1, 0, 4, 7, 5, 0, 11, 6, 1, 4, 2, 8, - 8, 10, 4, 9, 9, 2, 5, 7, 9, 1, 7, 2, 2, 6, 11, 5, - 5, 4, 6, 9, 0, 1, 1, 0, 7, 6, 9, 8, 4, 10, 3, 1, - 2, 8, 8, 9, 10, 11, 5, 11, 11, 2, 6, 10, 3, 4, 2, 4, - 9, 10, 3, 2, 6, 3, 6, 10, 5, 3, 4, 10, 11, 2, 9, 11, - 1, 11, 10, 4, 9, 4, 11, 0, 4, 11, 4, 0, 0, 0, 7, 6, - 10, 4, 1, 3, 11, 5, 3, 4, 2, 9, 1, 3, 0, 1, 8, 0, - 6, 7, 8, 7, 0, 4, 6, 10, 8, 2, 3, 11, 11, 8, 0, 2, - 4, 8, 3, 0, 0, 10, 6, 1, 2, 2, 4, 5, 6, 0, 1, 3, - 11, 9, 5, 5, 9, 6, 9, 8, 3, 8, 1, 8, 9, 6, 9, 11, - 10, 7, 5, 6, 5, 9, 1, 3, 7, 0, 2, 10, 11, 2, 6, 1, - 3, 11, 7, 7, 2, 1, 7, 3, 0, 8, 1, 1, 5, 0, 6, 10, - 11, 11, 0, 2, 7, 0, 10, 8, 3, 5, 7, 1, 11, 1, 0, 7, - 9, 0, 11, 5, 10, 3, 2, 3, 5, 9, 7, 9, 8, 4, 6, 5, -}; - -static float stb__perlin_lerp(float a, float b, float t) -{ - return a + (b-a) * t; -} - -static int stb__perlin_fastfloor(float a) -{ - int ai = (int) a; - return (a < ai) ? ai-1 : ai; -} - -// different grad function from Perlin's, but easy to modify to match reference -static float stb__perlin_grad(int grad_idx, float x, float y, float z) -{ - static float basis[12][4] = - { - { 1, 1, 0 }, - { -1, 1, 0 }, - { 1,-1, 0 }, - { -1,-1, 0 }, - { 1, 0, 1 }, - { -1, 0, 1 }, - { 1, 0,-1 }, - { -1, 0,-1 }, - { 0, 1, 1 }, - { 0,-1, 1 }, - { 0, 1,-1 }, - { 0,-1,-1 }, - }; - - float *grad = basis[grad_idx]; - return grad[0]*x + grad[1]*y + grad[2]*z; -} - -float stb_perlin_noise3_internal(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, unsigned char seed) -{ - float u,v,w; - float n000,n001,n010,n011,n100,n101,n110,n111; - float n00,n01,n10,n11; - float n0,n1; - - unsigned int x_mask = (x_wrap-1) & 255; - unsigned int y_mask = (y_wrap-1) & 255; - unsigned int z_mask = (z_wrap-1) & 255; - int px = stb__perlin_fastfloor(x); - int py = stb__perlin_fastfloor(y); - int pz = stb__perlin_fastfloor(z); - int x0 = px & x_mask, x1 = (px+1) & x_mask; - int y0 = py & y_mask, y1 = (py+1) & y_mask; - int z0 = pz & z_mask, z1 = (pz+1) & z_mask; - int r0,r1, r00,r01,r10,r11; - - #define stb__perlin_ease(a) (((a*6-15)*a + 10) * a * a * a) - - x -= px; u = stb__perlin_ease(x); - y -= py; v = stb__perlin_ease(y); - z -= pz; w = stb__perlin_ease(z); - - r0 = stb__perlin_randtab[x0+seed]; - r1 = stb__perlin_randtab[x1+seed]; - - r00 = stb__perlin_randtab[r0+y0]; - r01 = stb__perlin_randtab[r0+y1]; - r10 = stb__perlin_randtab[r1+y0]; - r11 = stb__perlin_randtab[r1+y1]; - - n000 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r00+z0], x , y , z ); - n001 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r00+z1], x , y , z-1 ); - n010 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r01+z0], x , y-1, z ); - n011 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r01+z1], x , y-1, z-1 ); - n100 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r10+z0], x-1, y , z ); - n101 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r10+z1], x-1, y , z-1 ); - n110 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r11+z0], x-1, y-1, z ); - n111 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r11+z1], x-1, y-1, z-1 ); - - n00 = stb__perlin_lerp(n000,n001,w); - n01 = stb__perlin_lerp(n010,n011,w); - n10 = stb__perlin_lerp(n100,n101,w); - n11 = stb__perlin_lerp(n110,n111,w); - - n0 = stb__perlin_lerp(n00,n01,v); - n1 = stb__perlin_lerp(n10,n11,v); - - return stb__perlin_lerp(n0,n1,u); -} - -float stb_perlin_noise3(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap) -{ - return stb_perlin_noise3_internal(x,y,z,x_wrap,y_wrap,z_wrap,0); -} - -float stb_perlin_noise3_seed(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, int seed) -{ - return stb_perlin_noise3_internal(x,y,z,x_wrap,y_wrap,z_wrap, (unsigned char) seed); -} - -float stb_perlin_ridge_noise3(float x, float y, float z, float lacunarity, float gain, float offset, int octaves) -{ - int i; - float frequency = 1.0f; - float prev = 1.0f; - float amplitude = 0.5f; - float sum = 0.0f; - - for (i = 0; i < octaves; i++) { - float r = stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i); - r = offset - (float) fabs(r); - r = r*r; - sum += r*amplitude*prev; - prev = r; - frequency *= lacunarity; - amplitude *= gain; - } - return sum; -} - -float stb_perlin_fbm_noise3(float x, float y, float z, float lacunarity, float gain, int octaves) -{ - int i; - float frequency = 1.0f; - float amplitude = 1.0f; - float sum = 0.0f; - - for (i = 0; i < octaves; i++) { - sum += stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i)*amplitude; - frequency *= lacunarity; - amplitude *= gain; - } - return sum; -} - -float stb_perlin_turbulence_noise3(float x, float y, float z, float lacunarity, float gain, int octaves) -{ - int i; - float frequency = 1.0f; - float amplitude = 1.0f; - float sum = 0.0f; - - for (i = 0; i < octaves; i++) { - float r = stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i)*amplitude; - sum += (float) fabs(r); - frequency *= lacunarity; - amplitude *= gain; - } - return sum; -} - -float stb_perlin_noise3_wrap_nonpow2(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, unsigned char seed) -{ - float u,v,w; - float n000,n001,n010,n011,n100,n101,n110,n111; - float n00,n01,n10,n11; - float n0,n1; - - int px = stb__perlin_fastfloor(x); - int py = stb__perlin_fastfloor(y); - int pz = stb__perlin_fastfloor(z); - int x_wrap2 = (x_wrap ? x_wrap : 256); - int y_wrap2 = (y_wrap ? y_wrap : 256); - int z_wrap2 = (z_wrap ? z_wrap : 256); - int x0 = px % x_wrap2, x1; - int y0 = py % y_wrap2, y1; - int z0 = pz % z_wrap2, z1; - int r0,r1, r00,r01,r10,r11; - - if (x0 < 0) x0 += x_wrap2; - if (y0 < 0) y0 += y_wrap2; - if (z0 < 0) z0 += z_wrap2; - x1 = (x0+1) % x_wrap2; - y1 = (y0+1) % y_wrap2; - z1 = (z0+1) % z_wrap2; - - #define stb__perlin_ease(a) (((a*6-15)*a + 10) * a * a * a) - - x -= px; u = stb__perlin_ease(x); - y -= py; v = stb__perlin_ease(y); - z -= pz; w = stb__perlin_ease(z); - - r0 = stb__perlin_randtab[x0]; - r0 = stb__perlin_randtab[r0+seed]; - r1 = stb__perlin_randtab[x1]; - r1 = stb__perlin_randtab[r1+seed]; - - r00 = stb__perlin_randtab[r0+y0]; - r01 = stb__perlin_randtab[r0+y1]; - r10 = stb__perlin_randtab[r1+y0]; - r11 = stb__perlin_randtab[r1+y1]; - - n000 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r00+z0], x , y , z ); - n001 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r00+z1], x , y , z-1 ); - n010 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r01+z0], x , y-1, z ); - n011 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r01+z1], x , y-1, z-1 ); - n100 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r10+z0], x-1, y , z ); - n101 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r10+z1], x-1, y , z-1 ); - n110 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r11+z0], x-1, y-1, z ); - n111 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r11+z1], x-1, y-1, z-1 ); - - n00 = stb__perlin_lerp(n000,n001,w); - n01 = stb__perlin_lerp(n010,n011,w); - n10 = stb__perlin_lerp(n100,n101,w); - n11 = stb__perlin_lerp(n110,n111,w); - - n0 = stb__perlin_lerp(n00,n01,v); - n1 = stb__perlin_lerp(n10,n11,v); - - return stb__perlin_lerp(n0,n1,u); -} -#endif // STB_PERLIN_IMPLEMENTATION - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_rect_pack.h b/FCLauncher/src/main/jni/lwjgl/stb/stb_rect_pack.h deleted file mode 100644 index 6a633ce6..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_rect_pack.h +++ /dev/null @@ -1,623 +0,0 @@ -// stb_rect_pack.h - v1.01 - public domain - rectangle packing -// Sean Barrett 2014 -// -// Useful for e.g. packing rectangular textures into an atlas. -// Does not do rotation. -// -// Before #including, -// -// #define STB_RECT_PACK_IMPLEMENTATION -// -// in the file that you want to have the implementation. -// -// 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). -// -// Has only had a few tests run, may have issues. -// -// More docs to come. -// -// No memory allocations; uses qsort() and assert() from stdlib. -// Can override those by defining STBRP_SORT and STBRP_ASSERT. -// -// This library currently uses the Skyline Bottom-Left algorithm. -// -// Please note: better rectangle packers are welcome! Please -// implement them to the same API, but with a different init -// function. -// -// Credits -// -// Library -// Sean Barrett -// Minor features -// Martins Mozeiko -// github:IntellectualKitty -// -// Bugfixes / warning fixes -// Jeremy Jaussaud -// Fabian Giesen -// -// Version history: -// -// 1.01 (2021-07-11) always use large rect mode, expose STBRP__MAXVAL in public section -// 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles -// 0.99 (2019-02-07) warning fixes -// 0.11 (2017-03-03) return packing success/fail result -// 0.10 (2016-10-25) remove cast-away-const to avoid warnings -// 0.09 (2016-08-27) fix compiler warnings -// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0) -// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0) -// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort -// 0.05: added STBRP_ASSERT to allow replacing assert -// 0.04: fixed minor bug in STBRP_LARGE_RECTS support -// 0.01: initial release -// -// LICENSE -// -// See end of file for license information. - -////////////////////////////////////////////////////////////////////////////// -// -// INCLUDE SECTION -// - -#ifndef STB_INCLUDE_STB_RECT_PACK_H -#define STB_INCLUDE_STB_RECT_PACK_H - -#define STB_RECT_PACK_VERSION 1 - -#ifdef STBRP_STATIC -#define STBRP_DEF static -#else -#define STBRP_DEF extern -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct stbrp_context stbrp_context; -typedef struct stbrp_node stbrp_node; -typedef struct stbrp_rect stbrp_rect; - -typedef int stbrp_coord; - -#define STBRP__MAXVAL 0x7fffffff -// Mostly for internal use, but this is the maximum supported coordinate value. - -STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects); -// Assign packed locations to rectangles. The rectangles are of type -// 'stbrp_rect' defined below, stored in the array 'rects', and there -// are 'num_rects' many of them. -// -// Rectangles which are successfully packed have the 'was_packed' flag -// set to a non-zero value and 'x' and '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 'was_packed' flag set to 0. -// -// You should not try to access the '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 stbrp_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. -// -// The function returns 1 if all of the rectangles were successfully -// packed and 0 otherwise. - -struct stbrp_rect -{ - // reserved for your use: - int id; - - // input: - stbrp_coord w, h; - - // output: - stbrp_coord x, y; - int was_packed; // non-zero if valid packing - -}; // 16 bytes, nominally - - -STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes); -// Initialize a rectangle packer to: -// pack a rectangle that is 'width' by 'height' in dimensions -// using temporary storage provided by the array 'nodes', which is 'num_nodes' long -// -// You must call this function every time you start packing into a new target. -// -// There is no "shutdown" function. The 'nodes' memory must stay valid for -// the following stbrp_pack_rects() call (or calls), but can be freed after -// the call (or calls) finish. -// -// Note: to guarantee best results, either: -// 1. make sure 'num_nodes' >= 'width' -// or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1' -// -// 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. - -STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *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 above. -// If you call init again, this will be reset to the default (false). - - -STBRP_DEF void stbrp_setup_heuristic (stbrp_context *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. - -enum -{ - STBRP_HEURISTIC_Skyline_default=0, - STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default, - STBRP_HEURISTIC_Skyline_BF_sortHeight -}; - - -////////////////////////////////////////////////////////////////////////////// -// -// the details of the following structures don't matter to you, but they must -// be visible so you can handle the memory allocations for them - -struct stbrp_node -{ - stbrp_coord x,y; - stbrp_node *next; -}; - -struct stbrp_context -{ - int width; - int height; - int align; - int init_mode; - int heuristic; - int num_nodes; - stbrp_node *active_head; - stbrp_node *free_head; - stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' -}; - -#ifdef __cplusplus -} -#endif - -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// IMPLEMENTATION SECTION -// - -#ifdef STB_RECT_PACK_IMPLEMENTATION -#ifndef STBRP_SORT -#include -#define STBRP_SORT qsort -#endif - -#ifndef STBRP_ASSERT -#include -#define STBRP_ASSERT assert -#endif - -#ifdef _MSC_VER -#define STBRP__NOTUSED(v) (void)(v) -#define STBRP__CDECL __cdecl -#else -#define STBRP__NOTUSED(v) (void)sizeof(v) -#define STBRP__CDECL -#endif - -enum -{ - STBRP__INIT_skyline = 1 -}; - -STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic) -{ - switch (context->init_mode) { - case STBRP__INIT_skyline: - STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight); - context->heuristic = heuristic; - break; - default: - STBRP_ASSERT(0); - } -} - -STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem) -{ - if (allow_out_of_mem) - // if it's ok to run out of memory, then don't bother aligning them; - // this gives better packing, but may fail due to OOM (even though - // the rectangles easily fit). @TODO a smarter approach would be to only - // quantize once we've hit OOM, then we could get rid of this parameter. - context->align = 1; - else { - // if it's not ok to run out of memory, then quantize the widths - // so that num_nodes is always enough nodes. - // - // I.e. num_nodes * align >= width - // align >= width / num_nodes - // align = ceil(width/num_nodes) - - context->align = (context->width + context->num_nodes-1) / context->num_nodes; - } -} - -STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes) -{ - int i; - - for (i=0; i < num_nodes-1; ++i) - nodes[i].next = &nodes[i+1]; - nodes[i].next = NULL; - context->init_mode = STBRP__INIT_skyline; - context->heuristic = STBRP_HEURISTIC_Skyline_default; - context->free_head = &nodes[0]; - context->active_head = &context->extra[0]; - context->width = width; - context->height = height; - context->num_nodes = num_nodes; - stbrp_setup_allow_out_of_mem(context, 0); - - // node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) - context->extra[0].x = 0; - context->extra[0].y = 0; - context->extra[0].next = &context->extra[1]; - context->extra[1].x = (stbrp_coord) width; - context->extra[1].y = (1<<30); - context->extra[1].next = NULL; -} - -// find minimum y position if it starts at x1 -static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste) -{ - stbrp_node *node = first; - int x1 = x0 + width; - int min_y, visited_width, waste_area; - - STBRP__NOTUSED(c); - - STBRP_ASSERT(first->x <= x0); - - #if 0 - // skip in case we're past the node - while (node->next->x <= x0) - ++node; - #else - STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency - #endif - - STBRP_ASSERT(node->x <= x0); - - min_y = 0; - waste_area = 0; - visited_width = 0; - while (node->x < x1) { - if (node->y > min_y) { - // raise min_y higher. - // we've accounted for all waste up to min_y, - // but we'll now add more waste for everything we've visted - waste_area += visited_width * (node->y - min_y); - min_y = node->y; - // the first time through, visited_width might be reduced - if (node->x < x0) - visited_width += node->next->x - x0; - else - visited_width += node->next->x - node->x; - } else { - // add waste area - int under_width = node->next->x - node->x; - if (under_width + visited_width > width) - under_width = width - visited_width; - waste_area += under_width * (min_y - node->y); - visited_width += under_width; - } - node = node->next; - } - - *pwaste = waste_area; - return min_y; -} - -typedef struct -{ - int x,y; - stbrp_node **prev_link; -} stbrp__findresult; - -static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height) -{ - int best_waste = (1<<30), best_x, best_y = (1 << 30); - stbrp__findresult fr; - stbrp_node **prev, *node, *tail, **best = NULL; - - // align to multiple of c->align - width = (width + c->align - 1); - width -= width % c->align; - STBRP_ASSERT(width % c->align == 0); - - // if it can't possibly fit, bail immediately - if (width > c->width || height > c->height) { - fr.prev_link = NULL; - fr.x = fr.y = 0; - return fr; - } - - node = c->active_head; - prev = &c->active_head; - while (node->x + width <= c->width) { - int y,waste; - y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste); - if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL - // bottom left - if (y < best_y) { - best_y = y; - best = prev; - } - } else { - // best-fit - if (y + height <= c->height) { - // can only use it if it first vertically - if (y < best_y || (y == best_y && waste < best_waste)) { - best_y = y; - best_waste = waste; - best = prev; - } - } - } - prev = &node->next; - node = node->next; - } - - best_x = (best == NULL) ? 0 : (*best)->x; - - // if doing best-fit (BF), we also have to try aligning right edge to each node position - // - // e.g, if fitting - // - // ____________________ - // |____________________| - // - // into - // - // | | - // | ____________| - // |____________| - // - // then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned - // - // This makes BF take about 2x the time - - if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) { - tail = c->active_head; - node = c->active_head; - prev = &c->active_head; - // find first node that's admissible - while (tail->x < width) - tail = tail->next; - while (tail) { - int xpos = tail->x - width; - int y,waste; - STBRP_ASSERT(xpos >= 0); - // find the left position that matches this - while (node->next->x <= xpos) { - prev = &node->next; - node = node->next; - } - STBRP_ASSERT(node->next->x > xpos && node->x <= xpos); - y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste); - if (y + height <= c->height) { - if (y <= best_y) { - if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) { - best_x = xpos; - STBRP_ASSERT(y <= best_y); - best_y = y; - best_waste = waste; - best = prev; - } - } - } - tail = tail->next; - } - } - - fr.prev_link = best; - fr.x = best_x; - fr.y = best_y; - return fr; -} - -static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height) -{ - // find best position according to heuristic - stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height); - stbrp_node *node, *cur; - - // bail if: - // 1. it failed - // 2. the best node doesn't fit (we don't always check this) - // 3. we're out of memory - if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) { - res.prev_link = NULL; - return res; - } - - // on success, create new node - node = context->free_head; - node->x = (stbrp_coord) res.x; - node->y = (stbrp_coord) (res.y + height); - - context->free_head = node->next; - - // insert the new node into the right starting point, and - // let 'cur' point to the remaining nodes needing to be - // stiched back in - - cur = *res.prev_link; - if (cur->x < res.x) { - // preserve the existing one, so start testing with the next one - stbrp_node *next = cur->next; - cur->next = node; - cur = next; - } else { - *res.prev_link = node; - } - - // from here, traverse cur and free the nodes, until we get to one - // that shouldn't be freed - while (cur->next && cur->next->x <= res.x + width) { - stbrp_node *next = cur->next; - // move the current node to the free list - cur->next = context->free_head; - context->free_head = cur; - cur = next; - } - - // stitch the list back in - node->next = cur; - - if (cur->x < res.x + width) - cur->x = (stbrp_coord) (res.x + width); - -#ifdef _DEBUG - cur = context->active_head; - while (cur->x < context->width) { - STBRP_ASSERT(cur->x < cur->next->x); - cur = cur->next; - } - STBRP_ASSERT(cur->next == NULL); - - { - int count=0; - cur = context->active_head; - while (cur) { - cur = cur->next; - ++count; - } - cur = context->free_head; - while (cur) { - cur = cur->next; - ++count; - } - STBRP_ASSERT(count == context->num_nodes+2); - } -#endif - - return res; -} - -static int STBRP__CDECL rect_height_compare(const void *a, const void *b) -{ - const stbrp_rect *p = (const stbrp_rect *) a; - const stbrp_rect *q = (const stbrp_rect *) b; - if (p->h > q->h) - return -1; - if (p->h < q->h) - return 1; - return (p->w > q->w) ? -1 : (p->w < q->w); -} - -static int STBRP__CDECL rect_original_order(const void *a, const void *b) -{ - const stbrp_rect *p = (const stbrp_rect *) a; - const stbrp_rect *q = (const stbrp_rect *) b; - return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed); -} - -STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects) -{ - int i, all_rects_packed = 1; - - // we use the 'was_packed' field internally to allow sorting/unsorting - for (i=0; i < num_rects; ++i) { - rects[i].was_packed = i; - } - - // sort according to heuristic - STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare); - - for (i=0; i < num_rects; ++i) { - if (rects[i].w == 0 || rects[i].h == 0) { - rects[i].x = rects[i].y = 0; // empty rect needs no space - } else { - stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); - if (fr.prev_link) { - rects[i].x = (stbrp_coord) fr.x; - rects[i].y = (stbrp_coord) fr.y; - } else { - rects[i].x = rects[i].y = STBRP__MAXVAL; - } - } - } - - // unsort - STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order); - - // set was_packed flags and all_rects_packed status - for (i=0; i < num_rects; ++i) { - rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL); - if (!rects[i].was_packed) - all_rects_packed = 0; - } - - // return the all_rects_packed status - return all_rects_packed; -} -#endif - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_truetype.h b/FCLauncher/src/main/jni/lwjgl/stb/stb_truetype.h deleted file mode 100644 index bbf2284b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_truetype.h +++ /dev/null @@ -1,5077 +0,0 @@ -// stb_truetype.h - v1.26 - public domain -// authored from 2009-2021 by Sean Barrett / RAD Game Tools -// -// ======================================================================= -// -// NO SECURITY GUARANTEE -- DO NOT USE THIS ON UNTRUSTED FONT FILES -// -// This library does no range checking of the offsets found in the file, -// meaning an attacker can use it to read arbitrary memory. -// -// ======================================================================= -// -// This library processes TrueType files: -// parse files -// extract glyph metrics -// extract glyph shapes -// render glyphs to one-channel bitmaps with antialiasing (box filter) -// render glyphs to one-channel SDF bitmaps (signed-distance field/function) -// -// Todo: -// non-MS cmaps -// crashproof on bad data -// hinting? (no longer patented) -// cleartype-style AA? -// optimize: use simple memory allocator for intermediates -// optimize: build edge-list directly from curves -// optimize: rasterize directly from curves? -// -// ADDITIONAL CONTRIBUTORS -// -// Mikko Mononen: compound shape support, more cmap formats -// Tor Andersson: kerning, subpixel rendering -// Dougall Johnson: OpenType / Type 2 font handling -// Daniel Ribeiro Maciel: basic GPOS-based kerning -// -// Misc other: -// Ryan Gordon -// Simon Glass -// github:IntellectualKitty -// Imanol Celaya -// Daniel Ribeiro Maciel -// -// Bug/warning reports/fixes: -// "Zer" on mollyrocket Fabian "ryg" Giesen github:NiLuJe -// Cass Everitt Martins Mozeiko github:aloucks -// stoiko (Haemimont Games) Cap Petschulat github:oyvindjam -// Brian Hook Omar Cornut github:vassvik -// Walter van Niftrik Ryan Griege -// David Gow Peter LaValle -// David Given Sergey Popov -// Ivan-Assen Ivanov Giumo X. Clanjor -// Anthony Pesch Higor Euripedes -// Johan Duparc Thomas Fields -// Hou Qiming Derek Vinyard -// Rob Loach Cort Stratton -// Kenney Phillis Jr. Brian Costabile -// Ken Voskuil (kaesve) -// -// VERSION HISTORY -// -// 1.26 (2021-08-28) fix broken rasterizer -// 1.25 (2021-07-11) many fixes -// 1.24 (2020-02-05) fix warning -// 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS) -// 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined -// 1.21 (2019-02-25) fix warning -// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics() -// 1.19 (2018-02-11) GPOS kerning, STBTT_fmod -// 1.18 (2018-01-29) add missing function -// 1.17 (2017-07-23) make more arguments const; doc fix -// 1.16 (2017-07-12) SDF support -// 1.15 (2017-03-03) make more arguments const -// 1.14 (2017-01-16) num-fonts-in-TTC function -// 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts -// 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual -// 1.11 (2016-04-02) fix unused-variable warning -// 1.10 (2016-04-02) user-defined fabs(); rare memory leak; remove duplicate typedef -// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly -// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges -// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; -// variant PackFontRanges to pack and render in separate phases; -// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); -// fixed an assert() bug in the new rasterizer -// replace assert() with STBTT_assert() in new rasterizer -// -// Full history can be found at the end of this file. -// -// LICENSE -// -// See end of file for license information. -// -// USAGE -// -// Include this file in whatever places need to refer to it. In ONE C/C++ -// file, write: -// #define STB_TRUETYPE_IMPLEMENTATION -// before the #include of this file. This expands out the actual -// implementation into that C/C++ file. -// -// To make the implementation private to the file that generates the implementation, -// #define STBTT_STATIC -// -// Simple 3D API (don't ship this, but it's fine for tools and quick start) -// stbtt_BakeFontBitmap() -- bake a font to a bitmap for use as texture -// stbtt_GetBakedQuad() -- compute quad to draw for a given char -// -// Improved 3D API (more shippable): -// #include "stb_rect_pack.h" -- optional, but you really want it -// stbtt_PackBegin() -// stbtt_PackSetOversampling() -- for improved quality on small fonts -// stbtt_PackFontRanges() -- pack and renders -// stbtt_PackEnd() -// stbtt_GetPackedQuad() -// -// "Load" a font file from a memory buffer (you have to keep the buffer loaded) -// stbtt_InitFont() -// stbtt_GetFontOffsetForIndex() -- indexing for TTC font collections -// stbtt_GetNumberOfFonts() -- number of fonts for TTC font collections -// -// Render a unicode codepoint to a bitmap -// stbtt_GetCodepointBitmap() -- allocates and returns a bitmap -// stbtt_MakeCodepointBitmap() -- renders into bitmap you provide -// stbtt_GetCodepointBitmapBox() -- how big the bitmap must be -// -// Character advance/positioning -// stbtt_GetCodepointHMetrics() -// stbtt_GetFontVMetrics() -// stbtt_GetFontVMetricsOS2() -// stbtt_GetCodepointKernAdvance() -// -// Starting with version 1.06, the rasterizer was replaced with a new, -// faster and generally-more-precise rasterizer. The new rasterizer more -// accurately measures pixel coverage for anti-aliasing, except in the case -// where multiple shapes overlap, in which case it overestimates the AA pixel -// coverage. Thus, anti-aliasing of intersecting shapes may look wrong. If -// this turns out to be a problem, you can re-enable the old rasterizer with -// #define STBTT_RASTERIZER_VERSION 1 -// which will incur about a 15% speed hit. -// -// ADDITIONAL DOCUMENTATION -// -// Immediately after this block comment are a series of sample programs. -// -// After the sample programs is the "header file" section. This section -// includes documentation for each API function. -// -// 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 stbtt_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 ScaleForMappingEmToPixels to compute -// a scale factor 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 GetFontBoundingBox to get the baseline-relative -// bounding box for all characters. 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 y=0, then you would set the baseline to 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 . I.e. if it returns x0,y0,x1,y1, -// then the character should be displayed in the rectangle from -// to = 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.t0); glVertex2f(q.x0,q.y0); - glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y0); - glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y1); - glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y1); - } - ++text; - } - glEnd(); -} -#endif -// -// -////////////////////////////////////////////////////////////////////////////// -// -// Complete program (this compiles): get a single bitmap, print as ASCII art -// -#if 0 -#include -#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation -#include "stb_truetype.h" - -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; -} -#endif -// -// Output: -// -// .ii. -// @@@@@@. -// V@Mio@@o -// :i. V@V -// :oM@@M -// :@@@MM@M -// @@o o@M -// :@@. M@M -// @@@o@@@@ -// :M@@V:@@. -// -////////////////////////////////////////////////////////////////////////////// -// -// Complete program: print "Hello World!" banner, with bugs -// -#if 0 -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!"; // intentionally misspelled to show 'lj' brokenness - - 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; -} -#endif - - -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -//// -//// INTEGRATION WITH YOUR CODEBASE -//// -//// The following sections allow you to supply alternate definitions -//// of C library functions used by stb_truetype, e.g. if you don't -//// link with the C runtime library. - -#ifdef STB_TRUETYPE_IMPLEMENTATION - // #define your own (u)stbtt_int8/16/32 before including to override this - #ifndef stbtt_uint8 - typedef unsigned char stbtt_uint8; - typedef signed char stbtt_int8; - typedef unsigned short stbtt_uint16; - typedef signed short stbtt_int16; - typedef unsigned int stbtt_uint32; - typedef signed int stbtt_int32; - #endif - - typedef char stbtt__check_size32[sizeof(stbtt_int32)==4 ? 1 : -1]; - typedef char stbtt__check_size16[sizeof(stbtt_int16)==2 ? 1 : -1]; - - // e.g. #define your own STBTT_ifloor/STBTT_iceil() to avoid math.h - #ifndef STBTT_ifloor - #include - #define STBTT_ifloor(x) ((int) floor(x)) - #define STBTT_iceil(x) ((int) ceil(x)) - #endif - - #ifndef STBTT_sqrt - #include - #define STBTT_sqrt(x) sqrt(x) - #define STBTT_pow(x,y) pow(x,y) - #endif - - #ifndef STBTT_fmod - #include - #define STBTT_fmod(x,y) fmod(x,y) - #endif - - #ifndef STBTT_cos - #include - #define STBTT_cos(x) cos(x) - #define STBTT_acos(x) acos(x) - #endif - - #ifndef STBTT_fabs - #include - #define STBTT_fabs(x) fabs(x) - #endif - - // #define your own functions "STBTT_malloc" / "STBTT_free" to avoid malloc.h - #ifndef STBTT_malloc - #include - #define STBTT_malloc(x,u) ((void)(u),malloc(x)) - #define STBTT_free(x,u) ((void)(u),free(x)) - #endif - - #ifndef STBTT_assert - #include - #define STBTT_assert(x) assert(x) - #endif - - #ifndef STBTT_strlen - #include - #define STBTT_strlen(x) strlen(x) - #endif - - #ifndef STBTT_memcpy - #include - #define STBTT_memcpy memcpy - #define STBTT_memset memset - #endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//// -//// INTERFACE -//// -//// - -#ifndef __STB_INCLUDE_STB_TRUETYPE_H__ -#define __STB_INCLUDE_STB_TRUETYPE_H__ - -#ifdef STBTT_STATIC -#define STBTT_DEF static -#else -#define STBTT_DEF extern -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// private structure -typedef struct -{ - unsigned char *data; - int cursor; - int size; -} stbtt__buf; - -////////////////////////////////////////////////////////////////////////////// -// -// TEXTURE BAKING API -// -// If you use this API, you only have to call two functions ever. -// - -typedef struct -{ - unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap - float xoff,yoff,xadvance; -} stbtt_bakedchar; - -STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) - float pixel_height, // height of font in pixels - unsigned char *pixels, int pw, int ph, // bitmap to be filled in - int first_char, int num_chars, // characters to bake - stbtt_bakedchar *chardata); // you allocate this, it's num_chars long -// if return is positive, the first unused row of the bitmap -// if return is negative, returns the negative of the number of characters that fit -// if return is 0, no characters fit and no rows were used -// This uses a very crappy packing. - -typedef struct -{ - float x0,y0,s0,t0; // top-left - float x1,y1,s1,t1; // bottom-right -} stbtt_aligned_quad; - -STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, // same data as above - int char_index, // character to display - float *xpos, float *ypos, // pointers to current position in screen pixel space - stbtt_aligned_quad *q, // output: quad to draw - int opengl_fillrule); // true if opengl fill rule; false if DX9 or earlier -// Call GetBakedQuad with char_index = 'character - first_char', and it -// creates the quad you need to draw 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. -// -// It's inefficient; you might want to c&p it and optimize it. - -STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap); -// Query the font vertical metrics without having to create a font first. - - -////////////////////////////////////////////////////////////////////////////// -// -// NEW TEXTURE BAKING API -// -// This provides options for packing multiple fonts into one atlas, not -// perfectly but better than nothing. - -typedef struct -{ - unsigned short x0,y0,x1,y1; // coordinates of bbox in bitmap - float xoff,yoff,xadvance; - float xoff2,yoff2; -} stbtt_packedchar; - -typedef struct stbtt_pack_context stbtt_pack_context; -typedef struct stbtt_fontinfo stbtt_fontinfo; -#ifndef STB_RECT_PACK_VERSION -typedef struct stbrp_rect stbrp_rect; -#endif - -STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int width, int height, int stride_in_bytes, int padding, void *alloc_context); -// Initializes a packing context stored in the passed-in stbtt_pack_context. -// Future calls using this context will pack characters into the bitmap passed -// in here: a 1-channel bitmap that is width * height. stride_in_bytes is -// the distance from one row to the next (or 0 to mean they are packed tightly -// together). "padding" is the amount of padding to leave between each -// character (normally you want '1' for bitmaps you'll use as textures with -// bilinear filtering). -// -// Returns 0 on failure, 1 on success. - -STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc); -// Cleans up the packing context and frees all memory. - -#define STBTT_POINT_SIZE(x) (-(x)) - -STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size, - int first_unicode_char_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range); -// Creates character bitmaps from the font_index'th font found in fontdata (use -// font_index=0 if you don't know what that is). It creates num_chars_in_range -// bitmaps for characters with unicode values starting at first_unicode_char_in_range -// and increasing. Data for how to render them is stored in chardata_for_range; -// pass these to stbtt_GetPackedQuad to get back renderable quads. -// -// font_size is the full height of the character from ascender to descender, -// as computed by stbtt_ScaleForPixelHeight. To use a point size as computed -// by stbtt_ScaleForMappingEmToPixels, wrap the point size in STBTT_POINT_SIZE() -// and pass that result as 'font_size': -// ..., 20 , ... // font max minus min y is 20 pixels tall -// ..., STBTT_POINT_SIZE(20), ... // 'M' is 20 pixels tall - -typedef struct -{ - float font_size; - int first_unicode_codepoint_in_range; // if non-zero, then the chars are continuous, and this is the first codepoint - int *array_of_unicode_codepoints; // if non-zero, then this is an array of unicode codepoints - int num_chars; - stbtt_packedchar *chardata_for_range; // output - unsigned char h_oversample, v_oversample; // don't set these, they're used internally -} stbtt_pack_range; - -STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *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 stbtt_PackFontRange. Note that you can call this multiple -// times within a single PackBegin/PackEnd. - -STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned 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 -// stbtt_PackFontRange(s) or stbtt_PackFontRangesGatherRects for a given -// pack context. The default (no oversampling) is achieved by h_oversample=1 -// and v_oversample=1. The total number of pixels required is -// 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 -// call to PackFontRangesGatherRects. - -STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip); -// If skip != 0, this tells stb_truetype to skip any codepoints for which -// there is no corresponding glyph. If skip=0, which is the default, then -// codepoints without a glyph recived the font's "missing character" glyph, -// typically an empty box by convention. - -STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, // same data as above - int char_index, // character to display - float *xpos, float *ypos, // pointers to current position in screen pixel space - stbtt_aligned_quad *q, // output: quad to draw - int align_to_integer); - -STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); -STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects); -STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects); -// Calling these functions in sequence is roughly equivalent to calling -// stbtt_PackFontRanges(). If you 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 to of stbtt_PackFontRanges() and create a custom version -// using these functions, e.g. call GatherRects multiple times, -// building up a single array of rects, then call PackRects once, -// then call RenderIntoRects repeatedly. This may result in a -// better packing than calling PackFontRanges multiple times -// (or it may not). - -// this is an opaque structure that you shouldn't mess with which holds -// all the context needed from PackBegin to PackEnd. -struct stbtt_pack_context { - void *user_allocator_context; - void *pack_info; - int width; - int height; - int stride_in_bytes; - int padding; - int skip_missing; - unsigned int h_oversample, v_oversample; - unsigned char *pixels; - void *nodes; -}; - -////////////////////////////////////////////////////////////////////////////// -// -// FONT LOADING -// -// - -STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data); -// This function will determine 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 the previous function where the index is between zero and one -// less than the total fonts. If an error occurs, -1 is returned. - -STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *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. - -// The following structure is defined publicly so you can declare one on -// the stack or as a global or etc, but you should treat it as opaque. -struct stbtt_fontinfo -{ - void * userdata; - unsigned char * data; // pointer to .ttf file - int fontstart; // offset of start of font - - int numGlyphs; // number of glyphs, needed for range checking - - int loca,head,glyf,hhea,hmtx,kern,gpos,svg; // table locations as offset from start of .ttf - int index_map; // a cmap mapping for our chosen character encoding - int indexToLocFormat; // format needed to map from glyph index to glyph - - stbtt__buf cff; // cff font data - stbtt__buf charstrings; // the charstring index - stbtt__buf gsubrs; // global charstring subroutines index - stbtt__buf subrs; // private charstring subroutines index - stbtt__buf fontdicts; // array of font dicts - stbtt__buf fdselect; // map from glyph to fontdict -}; - -STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *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 stbtt_fontinfo 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. Returns 0 on failure. - - -////////////////////////////////////////////////////////////////////////////// -// -// CHARACTER TO GLYPH-INDEX CONVERSIOn - -STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *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. -// Returns 0 if the character codepoint is not defined in the font. - - -////////////////////////////////////////////////////////////////////////////// -// -// CHARACTER PROPERTIES -// - -STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float pixels); -// computes a scale factor to produce a font whose "height" is 'pixels' tall. -// Height is measured as the distance from the highest ascender to the lowest -// descender; in other words, it's equivalent to calling stbtt_GetFontVMetrics -// and computing: -// scale = pixels / (ascent - descent) -// so if you prefer to measure height by the ascent only, use a similar calculation. - -STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels); -// computes a scale factor to produce a font whose EM size is mapped to -// 'pixels' tall. This is probably what traditional APIs compute, but -// I'm not positive. - -STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap); -// ascent is the coordinate above the baseline the font extends; descent -// is the coordinate below the baseline the font extends (i.e. it is typically negative) -// lineGap is the spacing between one row's descent and the next row's ascent... -// so you should advance the vertical position by "*ascent - *descent + *lineGap" -// these are expressed in unscaled coordinates, so you must multiply by -// the scale factor for a given size - -STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap); -// analogous to GetFontVMetrics, but returns the "typographic" values from the OS/2 -// table (specific to MS/Windows TTF files). -// -// Returns 1 on success (table present), 0 on failure. - -STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1); -// the bounding box around all possible characters - -STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing); -// leftSideBearing is the offset from the current horizontal position to the left edge of the character -// advanceWidth is the offset from the current horizontal position to the next horizontal position -// these are expressed in unscaled coordinates - -STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2); -// an additional amount to add to the 'advance' value between ch1 and ch2 - -STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1); -// Gets the bounding box of the visible part of the glyph, in unscaled coordinates - -STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing); -STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2); -STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); -// as above, but takes one or more glyph indices for greater efficiency - -typedef struct stbtt_kerningentry -{ - int glyph1; // use stbtt_FindGlyphIndex - int glyph2; - int advance; -} stbtt_kerningentry; - -STBTT_DEF int stbtt_GetKerningTableLength(const stbtt_fontinfo *info); -STBTT_DEF int stbtt_GetKerningTable(const stbtt_fontinfo *info, stbtt_kerningentry* table, int table_length); -// Retrieves a complete list of all of the kerning pairs provided by the font -// stbtt_GetKerningTable never writes more than table_length entries and returns how many entries it did write. -// The table will be sorted by (a.glyph1 == b.glyph1)?(a.glyph2 < b.glyph2):(a.glyph1 < b.glyph1) - -////////////////////////////////////////////////////////////////////////////// -// -// GLYPH SHAPES (you probably don't need these, but they have to go before -// the bitmaps for C declaration-order reasons) -// - -#ifndef STBTT_vmove // you can predefine these to use different values (but why?) - enum { - STBTT_vmove=1, - STBTT_vline, - STBTT_vcurve, - STBTT_vcubic - }; -#endif - -#ifndef stbtt_vertex // you can predefine this to use different values - // (we share this with other code at RAD) - #define stbtt_vertex_type short // can't use stbtt_int16 because that's not visible in the header file - typedef struct - { - stbtt_vertex_type x,y,cx,cy,cx1,cy1; - unsigned char type,padding; - } stbtt_vertex; -#endif - -STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index); -// returns non-zero if nothing is drawn for this glyph - -STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices); -STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **vertices); -// returns # of vertices and fills *vertices with the pointer to them -// these are expressed in "unscaled" coordinates -// -// The shape is a series of contours. Each one starts with -// a STBTT_moveto, then consists of a series of mixed -// STBTT_lineto and STBTT_curveto segments. A lineto -// draws a line from previous endpoint to its x,y; a curveto -// draws a quadratic bezier from previous endpoint to -// its x,y, using cx,cy as the bezier control point. - -STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *vertices); -// frees the data allocated above - -STBTT_DEF unsigned char *stbtt_FindSVGDoc(const stbtt_fontinfo *info, int gl); -STBTT_DEF int stbtt_GetCodepointSVG(const stbtt_fontinfo *info, int unicode_codepoint, const char **svg); -STBTT_DEF int stbtt_GetGlyphSVG(const stbtt_fontinfo *info, int gl, const char **svg); -// fills svg with the character's SVG data. -// returns data size or 0 if SVG not found. - -////////////////////////////////////////////////////////////////////////////// -// -// BITMAP RENDERING -// - -STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata); -// frees the bitmap allocated below - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff); -// allocates a large-enough single-channel 8bpp bitmap and renders the -// specified character/glyph at the specified scale into it, with -// antialiasing. 0 is no coverage (transparent), 255 is fully covered (opaque). -// *width & *height are filled out with the width & height of the bitmap, -// which is stored left-to-right, top-to-bottom. -// -// xoff/yoff are the offset it pixel space from the glyph origin to the top-left of the bitmap - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff); -// the same as stbtt_GetCodepoitnBitmap, but you can specify a subpixel -// shift for the character - -STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint); -// the same as stbtt_GetCodepointBitmap, but you pass in storage for the bitmap -// in the form of 'output', with row spacing of 'out_stride' bytes. the bitmap -// is clipped to out_w/out_h bytes. Call stbtt_GetCodepointBitmapBox to get the -// width and height and positioning info for it first. - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *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 stbtt_MakeCodepointBitmap, but you can specify a subpixel -// shift for the character - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *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); -// same as stbtt_MakeCodepointBitmapSubpixel, but prefiltering -// is performed (see stbtt_PackSetOversampling) - -STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); -// get the bbox of the bitmap centered around the glyph origin; so the -// bitmap width is ix1-ix0, height is iy1-iy0, and location to place -// the bitmap top left is (leftSideBearing*scale,iy0). -// (Note that the bitmap uses y-increases-down, but the shape uses -// y-increases-up, so CodepointBitmapBox and CodepointBox are inverted.) - -STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); -// same as stbtt_GetCodepointBitmapBox, but you can specify a subpixel -// shift for the character - -// the following functions are equivalent to the above functions, but operate -// on glyph indices instead of Unicode codepoints (for efficiency) -STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff); -STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff); -STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph); -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph); -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *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); -STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1); -STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1); - - -// @TODO: don't expose this structure -typedef struct -{ - int w,h,stride; - unsigned char *pixels; -} stbtt__bitmap; - -// rasterize a shape with quadratic beziers into a bitmap -STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, // 1-channel bitmap to draw into - float flatness_in_pixels, // allowable error of curve in pixels - stbtt_vertex *vertices, // array of vertices defining shape - int num_verts, // number of vertices in above array - float scale_x, float scale_y, // scale applied to input vertices - float shift_x, float shift_y, // translation applied to input vertices - int x_off, int y_off, // another translation applied to input - int invert, // if non-zero, vertically flip shape - void *userdata); // context for to STBTT_MALLOC - -////////////////////////////////////////////////////////////////////////////// -// -// Signed Distance Function (or Field) rendering - -STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata); -// frees the SDF bitmap allocated below - -STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); -STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff); -// These functions compute 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. -// info -- the font -// scale -- controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap -// glyph/codepoint -- the character to generate the SDF for -// padding -- extra "pixels" around the character which are filled with the distance to the character (not 0), -// which allows effects like bit outlines -// onedge_value -- value 0-255 to test the SDF against to reconstruct the character (i.e. the isocontour of the character) -// 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, > onedge_value is inside; if negative, < onedge_value is inside -// width,height -- output height & width of the SDF bitmap (including padding) -// xoff,yoff -- output origin of the character -// return value -- a 2D array of bytes 0..255, width*height in size -// -// pixel_dist_scale & onedge_value are a scale & bias that allows you to make -// optimal use of the limited 0..255 for your application, trading off precision -// and special effects. SDF values outside the range 0..255 are clamped to 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 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 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 (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 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. - - - -////////////////////////////////////////////////////////////////////////////// -// -// 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: -// stbtt_FindMatchingFont() will use *case-sensitive* comparisons on -// unicode-encoded names to try to find the font you want; -// you can run this before calling stbtt_InitFont() -// -// stbtt_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 stbtt_InitFont() first. - - -STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *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 'macStyle' header field; i don't know if fonts set this consistently -#define STBTT_MACSTYLE_DONTCARE 0 -#define STBTT_MACSTYLE_BOLD 1 -#define STBTT_MACSTYLE_ITALIC 2 -#define STBTT_MACSTYLE_UNDERSCORE 4 -#define STBTT_MACSTYLE_NONE 8 // <= not same as 0, this makes us check the bitfield is 0 - -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *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 from next func - -STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *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 *length. -// -// some of the values for the IDs are below; for more see the truetype spec: -// http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html -// http://www.microsoft.com/typography/otspec/name.htm - -enum { // platformID - STBTT_PLATFORM_ID_UNICODE =0, - STBTT_PLATFORM_ID_MAC =1, - STBTT_PLATFORM_ID_ISO =2, - STBTT_PLATFORM_ID_MICROSOFT =3 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_UNICODE - 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 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_MICROSOFT - STBTT_MS_EID_SYMBOL =0, - STBTT_MS_EID_UNICODE_BMP =1, - STBTT_MS_EID_SHIFTJIS =2, - STBTT_MS_EID_UNICODE_FULL =10 -}; - -enum { // encodingID for STBTT_PLATFORM_ID_MAC; same as Script Manager codes - STBTT_MAC_EID_ROMAN =0, STBTT_MAC_EID_ARABIC =4, - STBTT_MAC_EID_JAPANESE =1, STBTT_MAC_EID_HEBREW =5, - STBTT_MAC_EID_CHINESE_TRAD =2, STBTT_MAC_EID_GREEK =6, - STBTT_MAC_EID_KOREAN =3, STBTT_MAC_EID_RUSSIAN =7 -}; - -enum { // languageID for STBTT_PLATFORM_ID_MICROSOFT; same as LCID... - // problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs - STBTT_MS_LANG_ENGLISH =0x0409, STBTT_MS_LANG_ITALIAN =0x0410, - STBTT_MS_LANG_CHINESE =0x0804, STBTT_MS_LANG_JAPANESE =0x0411, - STBTT_MS_LANG_DUTCH =0x0413, STBTT_MS_LANG_KOREAN =0x0412, - STBTT_MS_LANG_FRENCH =0x040c, STBTT_MS_LANG_RUSSIAN =0x0419, - STBTT_MS_LANG_GERMAN =0x0407, STBTT_MS_LANG_SPANISH =0x0409, - STBTT_MS_LANG_HEBREW =0x040d, STBTT_MS_LANG_SWEDISH =0x041D -}; - -enum { // languageID for STBTT_PLATFORM_ID_MAC - STBTT_MAC_LANG_ENGLISH =0 , STBTT_MAC_LANG_JAPANESE =11, - STBTT_MAC_LANG_ARABIC =12, STBTT_MAC_LANG_KOREAN =23, - STBTT_MAC_LANG_DUTCH =4 , STBTT_MAC_LANG_RUSSIAN =32, - STBTT_MAC_LANG_FRENCH =1 , STBTT_MAC_LANG_SPANISH =6 , - STBTT_MAC_LANG_GERMAN =2 , STBTT_MAC_LANG_SWEDISH =5 , - STBTT_MAC_LANG_HEBREW =10, STBTT_MAC_LANG_CHINESE_SIMPLIFIED =33, - STBTT_MAC_LANG_ITALIAN =3 , STBTT_MAC_LANG_CHINESE_TRAD =19 -}; - -#ifdef __cplusplus -} -#endif - -#endif // __STB_INCLUDE_STB_TRUETYPE_H__ - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -//// -//// IMPLEMENTATION -//// -//// - -#ifdef STB_TRUETYPE_IMPLEMENTATION - -#ifndef STBTT_MAX_OVERSAMPLE -#define STBTT_MAX_OVERSAMPLE 8 -#endif - -#if STBTT_MAX_OVERSAMPLE > 255 -#error "STBTT_MAX_OVERSAMPLE cannot be > 255" -#endif - -typedef int stbtt__test_oversample_pow2[(STBTT_MAX_OVERSAMPLE & (STBTT_MAX_OVERSAMPLE-1)) == 0 ? 1 : -1]; - -#ifndef STBTT_RASTERIZER_VERSION -#define STBTT_RASTERIZER_VERSION 2 -#endif - -#ifdef _MSC_VER -#define STBTT__NOTUSED(v) (void)(v) -#else -#define STBTT__NOTUSED(v) (void)sizeof(v) -#endif - -////////////////////////////////////////////////////////////////////////// -// -// stbtt__buf helpers to parse data from file -// - -static stbtt_uint8 stbtt__buf_get8(stbtt__buf *b) -{ - if (b->cursor >= b->size) - return 0; - return b->data[b->cursor++]; -} - -static stbtt_uint8 stbtt__buf_peek8(stbtt__buf *b) -{ - if (b->cursor >= b->size) - return 0; - return b->data[b->cursor]; -} - -static void stbtt__buf_seek(stbtt__buf *b, int o) -{ - STBTT_assert(!(o > b->size || o < 0)); - b->cursor = (o > b->size || o < 0) ? b->size : o; -} - -static void stbtt__buf_skip(stbtt__buf *b, int o) -{ - stbtt__buf_seek(b, b->cursor + o); -} - -static stbtt_uint32 stbtt__buf_get(stbtt__buf *b, int n) -{ - stbtt_uint32 v = 0; - int i; - STBTT_assert(n >= 1 && n <= 4); - for (i = 0; i < n; i++) - v = (v << 8) | stbtt__buf_get8(b); - return v; -} - -static stbtt__buf stbtt__new_buf(const void *p, size_t size) -{ - stbtt__buf r; - STBTT_assert(size < 0x40000000); - r.data = (stbtt_uint8*) p; - r.size = (int) size; - r.cursor = 0; - return r; -} - -#define stbtt__buf_get16(b) stbtt__buf_get((b), 2) -#define stbtt__buf_get32(b) stbtt__buf_get((b), 4) - -static stbtt__buf stbtt__buf_range(const stbtt__buf *b, int o, int s) -{ - stbtt__buf r = stbtt__new_buf(NULL, 0); - if (o < 0 || s < 0 || o > b->size || s > b->size - o) return r; - r.data = b->data + o; - r.size = s; - return r; -} - -static stbtt__buf stbtt__cff_get_index(stbtt__buf *b) -{ - int count, start, offsize; - start = b->cursor; - count = stbtt__buf_get16(b); - if (count) { - offsize = stbtt__buf_get8(b); - STBTT_assert(offsize >= 1 && offsize <= 4); - stbtt__buf_skip(b, offsize * count); - stbtt__buf_skip(b, stbtt__buf_get(b, offsize) - 1); - } - return stbtt__buf_range(b, start, b->cursor - start); -} - -static stbtt_uint32 stbtt__cff_int(stbtt__buf *b) -{ - int b0 = stbtt__buf_get8(b); - if (b0 >= 32 && b0 <= 246) return b0 - 139; - else if (b0 >= 247 && b0 <= 250) return (b0 - 247)*256 + stbtt__buf_get8(b) + 108; - else if (b0 >= 251 && b0 <= 254) return -(b0 - 251)*256 - stbtt__buf_get8(b) - 108; - else if (b0 == 28) return stbtt__buf_get16(b); - else if (b0 == 29) return stbtt__buf_get32(b); - STBTT_assert(0); - return 0; -} - -static void stbtt__cff_skip_operand(stbtt__buf *b) { - int v, b0 = stbtt__buf_peek8(b); - STBTT_assert(b0 >= 28); - if (b0 == 30) { - stbtt__buf_skip(b, 1); - while (b->cursor < b->size) { - v = stbtt__buf_get8(b); - if ((v & 0xF) == 0xF || (v >> 4) == 0xF) - break; - } - } else { - stbtt__cff_int(b); - } -} - -static stbtt__buf stbtt__dict_get(stbtt__buf *b, int key) -{ - stbtt__buf_seek(b, 0); - while (b->cursor < b->size) { - int start = b->cursor, end, op; - while (stbtt__buf_peek8(b) >= 28) - stbtt__cff_skip_operand(b); - end = b->cursor; - op = stbtt__buf_get8(b); - if (op == 12) op = stbtt__buf_get8(b) | 0x100; - if (op == key) return stbtt__buf_range(b, start, end-start); - } - return stbtt__buf_range(b, 0, 0); -} - -static void stbtt__dict_get_ints(stbtt__buf *b, int key, int outcount, stbtt_uint32 *out) -{ - int i; - stbtt__buf operands = stbtt__dict_get(b, key); - for (i = 0; i < outcount && operands.cursor < operands.size; i++) - out[i] = stbtt__cff_int(&operands); -} - -static int stbtt__cff_index_count(stbtt__buf *b) -{ - stbtt__buf_seek(b, 0); - return stbtt__buf_get16(b); -} - -static stbtt__buf stbtt__cff_index_get(stbtt__buf b, int i) -{ - int count, offsize, start, end; - stbtt__buf_seek(&b, 0); - count = stbtt__buf_get16(&b); - offsize = stbtt__buf_get8(&b); - STBTT_assert(i >= 0 && i < count); - STBTT_assert(offsize >= 1 && offsize <= 4); - stbtt__buf_skip(&b, i*offsize); - start = stbtt__buf_get(&b, offsize); - end = stbtt__buf_get(&b, offsize); - return stbtt__buf_range(&b, 2+(count+1)*offsize+start, end - start); -} - -////////////////////////////////////////////////////////////////////////// -// -// accessors to parse data from file -// - -// on platforms that don't allow misaligned reads, if we want to allow -// truetype fonts that aren't padded to alignment, define ALLOW_UNALIGNED_TRUETYPE - -#define ttBYTE(p) (* (stbtt_uint8 *) (p)) -#define ttCHAR(p) (* (stbtt_int8 *) (p)) -#define ttFixed(p) ttLONG(p) - -static stbtt_uint16 ttUSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } -static stbtt_int16 ttSHORT(stbtt_uint8 *p) { return p[0]*256 + p[1]; } -static stbtt_uint32 ttULONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } -static stbtt_int32 ttLONG(stbtt_uint8 *p) { return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; } - -#define stbtt_tag4(p,c0,c1,c2,c3) ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) -#define stbtt_tag(p,str) stbtt_tag4(p,str[0],str[1],str[2],str[3]) - -static int stbtt__isfont(stbtt_uint8 *font) -{ - // check the version number - if (stbtt_tag4(font, '1',0,0,0)) return 1; // TrueType 1 - if (stbtt_tag(font, "typ1")) return 1; // TrueType with type 1 font -- we don't support this! - if (stbtt_tag(font, "OTTO")) return 1; // OpenType with CFF - if (stbtt_tag4(font, 0,1,0,0)) return 1; // OpenType 1.0 - if (stbtt_tag(font, "true")) return 1; // Apple specification for TrueType fonts - return 0; -} - -// @OPTIMIZE: binary search -static stbtt_uint32 stbtt__find_table(stbtt_uint8 *data, stbtt_uint32 fontstart, const char *tag) -{ - stbtt_int32 num_tables = ttUSHORT(data+fontstart+4); - stbtt_uint32 tabledir = fontstart + 12; - stbtt_int32 i; - for (i=0; i < num_tables; ++i) { - stbtt_uint32 loc = tabledir + 16*i; - if (stbtt_tag(data+loc+0, tag)) - return ttULONG(data+loc+8); - } - return 0; -} - -static int stbtt_GetFontOffsetForIndex_internal(unsigned char *font_collection, int index) -{ - // if it's just a font, there's only one valid index - if (stbtt__isfont(font_collection)) - return index == 0 ? 0 : -1; - - // check if it's a TTC - if (stbtt_tag(font_collection, "ttcf")) { - // version 1? - if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { - stbtt_int32 n = ttLONG(font_collection+8); - if (index >= n) - return -1; - return ttULONG(font_collection+12+index*4); - } - } - return -1; -} - -static int stbtt_GetNumberOfFonts_internal(unsigned char *font_collection) -{ - // if it's just a font, there's only one valid font - if (stbtt__isfont(font_collection)) - return 1; - - // check if it's a TTC - if (stbtt_tag(font_collection, "ttcf")) { - // version 1? - if (ttULONG(font_collection+4) == 0x00010000 || ttULONG(font_collection+4) == 0x00020000) { - return ttLONG(font_collection+8); - } - } - return 0; -} - -static stbtt__buf stbtt__get_subrs(stbtt__buf cff, stbtt__buf fontdict) -{ - stbtt_uint32 subrsoff = 0, private_loc[2] = { 0, 0 }; - stbtt__buf pdict; - stbtt__dict_get_ints(&fontdict, 18, 2, private_loc); - if (!private_loc[1] || !private_loc[0]) return stbtt__new_buf(NULL, 0); - pdict = stbtt__buf_range(&cff, private_loc[1], private_loc[0]); - stbtt__dict_get_ints(&pdict, 19, 1, &subrsoff); - if (!subrsoff) return stbtt__new_buf(NULL, 0); - stbtt__buf_seek(&cff, private_loc[1]+subrsoff); - return stbtt__cff_get_index(&cff); -} - -// since most people won't use this, find this table the first time it's needed -static int stbtt__get_svg(stbtt_fontinfo *info) -{ - stbtt_uint32 t; - if (info->svg < 0) { - t = stbtt__find_table(info->data, info->fontstart, "SVG "); - if (t) { - stbtt_uint32 offset = ttULONG(info->data + t + 2); - info->svg = t + offset; - } else { - info->svg = 0; - } - } - return info->svg; -} - -static int stbtt_InitFont_internal(stbtt_fontinfo *info, unsigned char *data, int fontstart) -{ - stbtt_uint32 cmap, t; - stbtt_int32 i,numTables; - - info->data = data; - info->fontstart = fontstart; - info->cff = stbtt__new_buf(NULL, 0); - - cmap = stbtt__find_table(data, fontstart, "cmap"); // required - info->loca = stbtt__find_table(data, fontstart, "loca"); // required - info->head = stbtt__find_table(data, fontstart, "head"); // required - info->glyf = stbtt__find_table(data, fontstart, "glyf"); // required - info->hhea = stbtt__find_table(data, fontstart, "hhea"); // required - info->hmtx = stbtt__find_table(data, fontstart, "hmtx"); // required - info->kern = stbtt__find_table(data, fontstart, "kern"); // not required - info->gpos = stbtt__find_table(data, fontstart, "GPOS"); // not required - - if (!cmap || !info->head || !info->hhea || !info->hmtx) - return 0; - if (info->glyf) { - // required for truetype - if (!info->loca) return 0; - } else { - // initialization for CFF / Type2 fonts (OTF) - stbtt__buf b, topdict, topdictidx; - stbtt_uint32 cstype = 2, charstrings = 0, fdarrayoff = 0, fdselectoff = 0; - stbtt_uint32 cff; - - cff = stbtt__find_table(data, fontstart, "CFF "); - if (!cff) return 0; - - info->fontdicts = stbtt__new_buf(NULL, 0); - info->fdselect = stbtt__new_buf(NULL, 0); - - // @TODO this should use size from table (not 512MB) - info->cff = stbtt__new_buf(data+cff, 512*1024*1024); - b = info->cff; - - // read the header - stbtt__buf_skip(&b, 2); - stbtt__buf_seek(&b, stbtt__buf_get8(&b)); // hdrsize - - // @TODO the name INDEX could list multiple fonts, - // but we just use the first one. - stbtt__cff_get_index(&b); // name INDEX - topdictidx = stbtt__cff_get_index(&b); - topdict = stbtt__cff_index_get(topdictidx, 0); - stbtt__cff_get_index(&b); // string INDEX - info->gsubrs = stbtt__cff_get_index(&b); - - stbtt__dict_get_ints(&topdict, 17, 1, &charstrings); - stbtt__dict_get_ints(&topdict, 0x100 | 6, 1, &cstype); - stbtt__dict_get_ints(&topdict, 0x100 | 36, 1, &fdarrayoff); - stbtt__dict_get_ints(&topdict, 0x100 | 37, 1, &fdselectoff); - info->subrs = stbtt__get_subrs(b, topdict); - - // we only support Type 2 charstrings - if (cstype != 2) return 0; - if (charstrings == 0) return 0; - - if (fdarrayoff) { - // looks like a CID font - if (!fdselectoff) return 0; - stbtt__buf_seek(&b, fdarrayoff); - info->fontdicts = stbtt__cff_get_index(&b); - info->fdselect = stbtt__buf_range(&b, fdselectoff, b.size-fdselectoff); - } - - stbtt__buf_seek(&b, charstrings); - info->charstrings = stbtt__cff_get_index(&b); - } - - t = stbtt__find_table(data, fontstart, "maxp"); - if (t) - info->numGlyphs = ttUSHORT(data+t+4); - else - info->numGlyphs = 0xffff; - - info->svg = -1; - - // find a cmap encoding table we understand *now* to avoid searching - // later. (todo: could make this installable) - // the same regardless of glyph. - numTables = ttUSHORT(data + cmap + 2); - info->index_map = 0; - for (i=0; i < numTables; ++i) { - stbtt_uint32 encoding_record = cmap + 4 + 8 * i; - // find an encoding we understand: - switch(ttUSHORT(data+encoding_record)) { - case STBTT_PLATFORM_ID_MICROSOFT: - switch (ttUSHORT(data+encoding_record+2)) { - case STBTT_MS_EID_UNICODE_BMP: - case STBTT_MS_EID_UNICODE_FULL: - // MS/Unicode - info->index_map = cmap + ttULONG(data+encoding_record+4); - break; - } - break; - case STBTT_PLATFORM_ID_UNICODE: - // Mac/iOS has these - // all the encodingIDs are unicode, so we don't bother to check it - info->index_map = cmap + ttULONG(data+encoding_record+4); - break; - } - } - if (info->index_map == 0) - return 0; - - info->indexToLocFormat = ttUSHORT(data+info->head + 50); - return 1; -} - -STBTT_DEF int stbtt_FindGlyphIndex(const stbtt_fontinfo *info, int unicode_codepoint) -{ - stbtt_uint8 *data = info->data; - stbtt_uint32 index_map = info->index_map; - - stbtt_uint16 format = ttUSHORT(data + index_map + 0); - if (format == 0) { // apple byte encoding - stbtt_int32 bytes = ttUSHORT(data + index_map + 2); - if (unicode_codepoint < bytes-6) - return ttBYTE(data + index_map + 6 + unicode_codepoint); - return 0; - } else if (format == 6) { - stbtt_uint32 first = ttUSHORT(data + index_map + 6); - stbtt_uint32 count = ttUSHORT(data + index_map + 8); - if ((stbtt_uint32) unicode_codepoint >= first && (stbtt_uint32) unicode_codepoint < first+count) - return ttUSHORT(data + index_map + 10 + (unicode_codepoint - first)*2); - return 0; - } else if (format == 2) { - STBTT_assert(0); // @TODO: high-byte mapping for japanese/chinese/korean - return 0; - } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges - stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1; - stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1; - stbtt_uint16 entrySelector = ttUSHORT(data+index_map+10); - stbtt_uint16 rangeShift = ttUSHORT(data+index_map+12) >> 1; - - // do a binary search of the segments - stbtt_uint32 endCount = index_map + 14; - stbtt_uint32 search = endCount; - - if (unicode_codepoint > 0xffff) - return 0; - - // they lie from endCount .. endCount + segCount - // but searchRange is the nearest power of two, so... - if (unicode_codepoint >= ttUSHORT(data + search + rangeShift*2)) - search += rangeShift*2; - - // now decrement to bias correctly to find smallest - search -= 2; - while (entrySelector) { - stbtt_uint16 end; - searchRange >>= 1; - end = ttUSHORT(data + search + searchRange*2); - if (unicode_codepoint > end) - search += searchRange*2; - --entrySelector; - } - search += 2; - - { - stbtt_uint16 offset, start, last; - stbtt_uint16 item = (stbtt_uint16) ((search - endCount) >> 1); - - start = ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); - last = ttUSHORT(data + endCount + 2*item); - if (unicode_codepoint < start || unicode_codepoint > last) - return 0; - - offset = ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); - if (offset == 0) - return (stbtt_uint16) (unicode_codepoint + ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item)); - - return ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item); - } - } else if (format == 12 || format == 13) { - stbtt_uint32 ngroups = ttULONG(data+index_map+12); - stbtt_int32 low,high; - low = 0; high = (stbtt_int32)ngroups; - // Binary search the right group. - while (low < high) { - stbtt_int32 mid = low + ((high-low) >> 1); // rounds down, so low <= mid < high - stbtt_uint32 start_char = ttULONG(data+index_map+16+mid*12); - stbtt_uint32 end_char = ttULONG(data+index_map+16+mid*12+4); - if ((stbtt_uint32) unicode_codepoint < start_char) - high = mid; - else if ((stbtt_uint32) unicode_codepoint > end_char) - low = mid+1; - else { - stbtt_uint32 start_glyph = ttULONG(data+index_map+16+mid*12+8); - if (format == 12) - return start_glyph + unicode_codepoint-start_char; - else // format == 13 - return start_glyph; - } - } - return 0; // not found - } - // @TODO - STBTT_assert(0); - return 0; -} - -STBTT_DEF int stbtt_GetCodepointShape(const stbtt_fontinfo *info, int unicode_codepoint, stbtt_vertex **vertices) -{ - return stbtt_GetGlyphShape(info, stbtt_FindGlyphIndex(info, unicode_codepoint), vertices); -} - -static void stbtt_setvertex(stbtt_vertex *v, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy) -{ - v->type = type; - v->x = (stbtt_int16) x; - v->y = (stbtt_int16) y; - v->cx = (stbtt_int16) cx; - v->cy = (stbtt_int16) cy; -} - -static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index) -{ - int g1,g2; - - STBTT_assert(!info->cff.size); - - if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range - if (info->indexToLocFormat >= 2) return -1; // unknown index->glyph map format - - if (info->indexToLocFormat == 0) { - g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2; - g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2; - } else { - g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4); - g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4); - } - - return g1==g2 ? -1 : g1; // if length is 0, return -1 -} - -static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1); - -STBTT_DEF int stbtt_GetGlyphBox(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) -{ - if (info->cff.size) { - stbtt__GetGlyphInfoT2(info, glyph_index, x0, y0, x1, y1); - } else { - int g = stbtt__GetGlyfOffset(info, glyph_index); - if (g < 0) return 0; - - if (x0) *x0 = ttSHORT(info->data + g + 2); - if (y0) *y0 = ttSHORT(info->data + g + 4); - if (x1) *x1 = ttSHORT(info->data + g + 6); - if (y1) *y1 = ttSHORT(info->data + g + 8); - } - return 1; -} - -STBTT_DEF int stbtt_GetCodepointBox(const stbtt_fontinfo *info, int codepoint, int *x0, int *y0, int *x1, int *y1) -{ - return stbtt_GetGlyphBox(info, stbtt_FindGlyphIndex(info,codepoint), x0,y0,x1,y1); -} - -STBTT_DEF int stbtt_IsGlyphEmpty(const stbtt_fontinfo *info, int glyph_index) -{ - stbtt_int16 numberOfContours; - int g; - if (info->cff.size) - return stbtt__GetGlyphInfoT2(info, glyph_index, NULL, NULL, NULL, NULL) == 0; - g = stbtt__GetGlyfOffset(info, glyph_index); - if (g < 0) return 1; - numberOfContours = ttSHORT(info->data + g); - return numberOfContours == 0; -} - -static int stbtt__close_shape(stbtt_vertex *vertices, int num_vertices, int was_off, int start_off, - stbtt_int32 sx, stbtt_int32 sy, stbtt_int32 scx, stbtt_int32 scy, stbtt_int32 cx, stbtt_int32 cy) -{ - if (start_off) { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy); - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, sx,sy,scx,scy); - } else { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve,sx,sy,cx,cy); - else - stbtt_setvertex(&vertices[num_vertices++], STBTT_vline,sx,sy,0,0); - } - return num_vertices; -} - -static int stbtt__GetGlyphShapeTT(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) -{ - stbtt_int16 numberOfContours; - stbtt_uint8 *endPtsOfContours; - stbtt_uint8 *data = info->data; - stbtt_vertex *vertices=0; - int num_vertices=0; - int g = stbtt__GetGlyfOffset(info, glyph_index); - - *pvertices = NULL; - - if (g < 0) return 0; - - numberOfContours = ttSHORT(data + g); - - if (numberOfContours > 0) { - stbtt_uint8 flags=0,flagcount; - stbtt_int32 ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0; - stbtt_int32 x,y,cx,cy,sx,sy, scx,scy; - stbtt_uint8 *points; - endPtsOfContours = (data + g + 10); - ins = ttUSHORT(data + g + 10 + numberOfContours * 2); - points = data + g + 10 + numberOfContours * 2 + 2 + ins; - - n = 1+ttUSHORT(endPtsOfContours + numberOfContours*2-2); - - m = n + 2*numberOfContours; // a loose bound on how many vertices we might need - vertices = (stbtt_vertex *) STBTT_malloc(m * sizeof(vertices[0]), info->userdata); - if (vertices == 0) - return 0; - - next_move = 0; - flagcount=0; - - // in first pass, we load uninterpreted data into the allocated array - // above, shifted to the end of the array so we won't overwrite it when - // we create our final data starting from the front - - off = m - n; // starting offset for uninterpreted data, regardless of how m ends up being calculated - - // first load flags - - for (i=0; i < n; ++i) { - if (flagcount == 0) { - flags = *points++; - if (flags & 8) - flagcount = *points++; - } else - --flagcount; - vertices[off+i].type = flags; - } - - // now load x coordinates - x=0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - if (flags & 2) { - stbtt_int16 dx = *points++; - x += (flags & 16) ? dx : -dx; // ??? - } else { - if (!(flags & 16)) { - x = x + (stbtt_int16) (points[0]*256 + points[1]); - points += 2; - } - } - vertices[off+i].x = (stbtt_int16) x; - } - - // now load y coordinates - y=0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - if (flags & 4) { - stbtt_int16 dy = *points++; - y += (flags & 32) ? dy : -dy; // ??? - } else { - if (!(flags & 32)) { - y = y + (stbtt_int16) (points[0]*256 + points[1]); - points += 2; - } - } - vertices[off+i].y = (stbtt_int16) y; - } - - // now convert them to our format - num_vertices=0; - sx = sy = cx = cy = scx = scy = 0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - x = (stbtt_int16) vertices[off+i].x; - y = (stbtt_int16) vertices[off+i].y; - - if (next_move == i) { - if (i != 0) - num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - - // now start the new one - start_off = !(flags & 1); - if (start_off) { - // if we start off with an off-curve point, then when we need to find a point on the curve - // where we can start, and we need to save some state for when we wraparound. - scx = x; - scy = y; - if (!(vertices[off+i+1].type & 1)) { - // next point is also a curve point, so interpolate an on-point curve - sx = (x + (stbtt_int32) vertices[off+i+1].x) >> 1; - sy = (y + (stbtt_int32) vertices[off+i+1].y) >> 1; - } else { - // otherwise just use the next point as our start point - sx = (stbtt_int32) vertices[off+i+1].x; - sy = (stbtt_int32) vertices[off+i+1].y; - ++i; // we're using point i+1 as the starting point, so skip it - } - } else { - sx = x; - sy = y; - } - stbtt_setvertex(&vertices[num_vertices++], STBTT_vmove,sx,sy,0,0); - was_off = 0; - next_move = 1 + ttUSHORT(endPtsOfContours+j*2); - ++j; - } else { - if (!(flags & 1)) { // if it's a curve - if (was_off) // two off-curve control points in a row means interpolate an on-curve midpoint - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy); - cx = x; - cy = y; - was_off = 1; - } else { - if (was_off) - stbtt_setvertex(&vertices[num_vertices++], STBTT_vcurve, x,y, cx, cy); - else - stbtt_setvertex(&vertices[num_vertices++], STBTT_vline, x,y,0,0); - was_off = 0; - } - } - } - num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - } else if (numberOfContours < 0) { - // Compound shapes. - int more = 1; - stbtt_uint8 *comp = data + g + 10; - num_vertices = 0; - vertices = 0; - while (more) { - stbtt_uint16 flags, gidx; - int comp_num_verts = 0, i; - stbtt_vertex *comp_verts = 0, *tmp = 0; - float mtx[6] = {1,0,0,1,0,0}, m, n; - - flags = ttSHORT(comp); comp+=2; - gidx = ttSHORT(comp); comp+=2; - - if (flags & 2) { // XY values - if (flags & 1) { // shorts - mtx[4] = ttSHORT(comp); comp+=2; - mtx[5] = ttSHORT(comp); comp+=2; - } else { - mtx[4] = ttCHAR(comp); comp+=1; - mtx[5] = ttCHAR(comp); comp+=1; - } - } - else { - // @TODO handle matching point - STBTT_assert(0); - } - if (flags & (1<<3)) { // WE_HAVE_A_SCALE - mtx[0] = mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = mtx[2] = 0; - } else if (flags & (1<<6)) { // WE_HAVE_AN_X_AND_YSCALE - mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = mtx[2] = 0; - mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - } else if (flags & (1<<7)) { // WE_HAVE_A_TWO_BY_TWO - mtx[0] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[2] = ttSHORT(comp)/16384.0f; comp+=2; - mtx[3] = ttSHORT(comp)/16384.0f; comp+=2; - } - - // Find transformation scales. - m = (float) STBTT_sqrt(mtx[0]*mtx[0] + mtx[1]*mtx[1]); - n = (float) STBTT_sqrt(mtx[2]*mtx[2] + mtx[3]*mtx[3]); - - // Get indexed glyph. - comp_num_verts = stbtt_GetGlyphShape(info, gidx, &comp_verts); - if (comp_num_verts > 0) { - // Transform vertices. - for (i = 0; i < comp_num_verts; ++i) { - stbtt_vertex* v = &comp_verts[i]; - stbtt_vertex_type x,y; - x=v->x; y=v->y; - v->x = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); - v->y = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); - x=v->cx; y=v->cy; - v->cx = (stbtt_vertex_type)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); - v->cy = (stbtt_vertex_type)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); - } - // Append vertices. - tmp = (stbtt_vertex*)STBTT_malloc((num_vertices+comp_num_verts)*sizeof(stbtt_vertex), info->userdata); - if (!tmp) { - if (vertices) STBTT_free(vertices, info->userdata); - if (comp_verts) STBTT_free(comp_verts, info->userdata); - return 0; - } - if (num_vertices > 0 && vertices) STBTT_memcpy(tmp, vertices, num_vertices*sizeof(stbtt_vertex)); - STBTT_memcpy(tmp+num_vertices, comp_verts, comp_num_verts*sizeof(stbtt_vertex)); - if (vertices) STBTT_free(vertices, info->userdata); - vertices = tmp; - STBTT_free(comp_verts, info->userdata); - num_vertices += comp_num_verts; - } - // More components ? - more = flags & (1<<5); - } - } else { - // numberOfCounters == 0, do nothing - } - - *pvertices = vertices; - return num_vertices; -} - -typedef struct -{ - int bounds; - int started; - float first_x, first_y; - float x, y; - stbtt_int32 min_x, max_x, min_y, max_y; - - stbtt_vertex *pvertices; - int num_vertices; -} stbtt__csctx; - -#define STBTT__CSCTX_INIT(bounds) {bounds,0, 0,0, 0,0, 0,0,0,0, NULL, 0} - -static void stbtt__track_vertex(stbtt__csctx *c, stbtt_int32 x, stbtt_int32 y) -{ - if (x > c->max_x || !c->started) c->max_x = x; - if (y > c->max_y || !c->started) c->max_y = y; - if (x < c->min_x || !c->started) c->min_x = x; - if (y < c->min_y || !c->started) c->min_y = y; - c->started = 1; -} - -static void stbtt__csctx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy, stbtt_int32 cx1, stbtt_int32 cy1) -{ - if (c->bounds) { - stbtt__track_vertex(c, x, y); - if (type == STBTT_vcubic) { - stbtt__track_vertex(c, cx, cy); - stbtt__track_vertex(c, cx1, cy1); - } - } else { - stbtt_setvertex(&c->pvertices[c->num_vertices], type, x, y, cx, cy); - c->pvertices[c->num_vertices].cx1 = (stbtt_int16) cx1; - c->pvertices[c->num_vertices].cy1 = (stbtt_int16) cy1; - } - c->num_vertices++; -} - -static void stbtt__csctx_close_shape(stbtt__csctx *ctx) -{ - if (ctx->first_x != ctx->x || ctx->first_y != ctx->y) - stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->first_x, (int)ctx->first_y, 0, 0, 0, 0); -} - -static void stbtt__csctx_rmove_to(stbtt__csctx *ctx, float dx, float dy) -{ - stbtt__csctx_close_shape(ctx); - ctx->first_x = ctx->x = ctx->x + dx; - ctx->first_y = ctx->y = ctx->y + dy; - stbtt__csctx_v(ctx, STBTT_vmove, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); -} - -static void stbtt__csctx_rline_to(stbtt__csctx *ctx, float dx, float dy) -{ - ctx->x += dx; - ctx->y += dy; - stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0); -} - -static void stbtt__csctx_rccurve_to(stbtt__csctx *ctx, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) -{ - float cx1 = ctx->x + dx1; - float cy1 = ctx->y + dy1; - float cx2 = cx1 + dx2; - float cy2 = cy1 + dy2; - ctx->x = cx2 + dx3; - ctx->y = cy2 + dy3; - stbtt__csctx_v(ctx, STBTT_vcubic, (int)ctx->x, (int)ctx->y, (int)cx1, (int)cy1, (int)cx2, (int)cy2); -} - -static stbtt__buf stbtt__get_subr(stbtt__buf idx, int n) -{ - int count = stbtt__cff_index_count(&idx); - int bias = 107; - if (count >= 33900) - bias = 32768; - else if (count >= 1240) - bias = 1131; - n += bias; - if (n < 0 || n >= count) - return stbtt__new_buf(NULL, 0); - return stbtt__cff_index_get(idx, n); -} - -static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int glyph_index) -{ - stbtt__buf fdselect = info->fdselect; - int nranges, start, end, v, fmt, fdselector = -1, i; - - stbtt__buf_seek(&fdselect, 0); - fmt = stbtt__buf_get8(&fdselect); - if (fmt == 0) { - // untested - stbtt__buf_skip(&fdselect, glyph_index); - fdselector = stbtt__buf_get8(&fdselect); - } else if (fmt == 3) { - nranges = stbtt__buf_get16(&fdselect); - start = stbtt__buf_get16(&fdselect); - for (i = 0; i < nranges; i++) { - v = stbtt__buf_get8(&fdselect); - end = stbtt__buf_get16(&fdselect); - if (glyph_index >= start && glyph_index < end) { - fdselector = v; - break; - } - start = end; - } - } - if (fdselector == -1) stbtt__new_buf(NULL, 0); - return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector)); -} - -static int stbtt__run_charstring(const stbtt_fontinfo *info, int glyph_index, stbtt__csctx *c) -{ - int in_header = 1, maskbits = 0, subr_stack_height = 0, sp = 0, v, i, b0; - int has_subrs = 0, clear_stack; - float s[48]; - stbtt__buf subr_stack[10], subrs = info->subrs, b; - float f; - -#define STBTT__CSERR(s) (0) - - // this currently ignores the initial width value, which isn't needed if we have hmtx - b = stbtt__cff_index_get(info->charstrings, glyph_index); - while (b.cursor < b.size) { - i = 0; - clear_stack = 1; - b0 = stbtt__buf_get8(&b); - switch (b0) { - // @TODO implement hinting - case 0x13: // hintmask - case 0x14: // cntrmask - if (in_header) - maskbits += (sp / 2); // implicit "vstem" - in_header = 0; - stbtt__buf_skip(&b, (maskbits + 7) / 8); - break; - - case 0x01: // hstem - case 0x03: // vstem - case 0x12: // hstemhm - case 0x17: // vstemhm - maskbits += (sp / 2); - break; - - case 0x15: // rmoveto - in_header = 0; - if (sp < 2) return STBTT__CSERR("rmoveto stack"); - stbtt__csctx_rmove_to(c, s[sp-2], s[sp-1]); - break; - case 0x04: // vmoveto - in_header = 0; - if (sp < 1) return STBTT__CSERR("vmoveto stack"); - stbtt__csctx_rmove_to(c, 0, s[sp-1]); - break; - case 0x16: // hmoveto - in_header = 0; - if (sp < 1) return STBTT__CSERR("hmoveto stack"); - stbtt__csctx_rmove_to(c, s[sp-1], 0); - break; - - case 0x05: // rlineto - if (sp < 2) return STBTT__CSERR("rlineto stack"); - for (; i + 1 < sp; i += 2) - stbtt__csctx_rline_to(c, s[i], s[i+1]); - break; - - // hlineto/vlineto and vhcurveto/hvcurveto alternate horizontal and vertical - // starting from a different place. - - case 0x07: // vlineto - if (sp < 1) return STBTT__CSERR("vlineto stack"); - goto vlineto; - case 0x06: // hlineto - if (sp < 1) return STBTT__CSERR("hlineto stack"); - for (;;) { - if (i >= sp) break; - stbtt__csctx_rline_to(c, s[i], 0); - i++; - vlineto: - if (i >= sp) break; - stbtt__csctx_rline_to(c, 0, s[i]); - i++; - } - break; - - case 0x1F: // hvcurveto - if (sp < 4) return STBTT__CSERR("hvcurveto stack"); - goto hvcurveto; - case 0x1E: // vhcurveto - if (sp < 4) return STBTT__CSERR("vhcurveto stack"); - for (;;) { - if (i + 3 >= sp) break; - stbtt__csctx_rccurve_to(c, 0, s[i], s[i+1], s[i+2], s[i+3], (sp - i == 5) ? s[i + 4] : 0.0f); - i += 4; - hvcurveto: - if (i + 3 >= sp) break; - stbtt__csctx_rccurve_to(c, s[i], 0, s[i+1], s[i+2], (sp - i == 5) ? s[i+4] : 0.0f, s[i+3]); - i += 4; - } - break; - - case 0x08: // rrcurveto - if (sp < 6) return STBTT__CSERR("rcurveline stack"); - for (; i + 5 < sp; i += 6) - stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); - break; - - case 0x18: // rcurveline - if (sp < 8) return STBTT__CSERR("rcurveline stack"); - for (; i + 5 < sp - 2; i += 6) - stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); - if (i + 1 >= sp) return STBTT__CSERR("rcurveline stack"); - stbtt__csctx_rline_to(c, s[i], s[i+1]); - break; - - case 0x19: // rlinecurve - if (sp < 8) return STBTT__CSERR("rlinecurve stack"); - for (; i + 1 < sp - 6; i += 2) - stbtt__csctx_rline_to(c, s[i], s[i+1]); - if (i + 5 >= sp) return STBTT__CSERR("rlinecurve stack"); - stbtt__csctx_rccurve_to(c, s[i], s[i+1], s[i+2], s[i+3], s[i+4], s[i+5]); - break; - - case 0x1A: // vvcurveto - case 0x1B: // hhcurveto - if (sp < 4) return STBTT__CSERR("(vv|hh)curveto stack"); - f = 0.0; - if (sp & 1) { f = s[i]; i++; } - for (; i + 3 < sp; i += 4) { - if (b0 == 0x1B) - stbtt__csctx_rccurve_to(c, s[i], f, s[i+1], s[i+2], s[i+3], 0.0); - else - stbtt__csctx_rccurve_to(c, f, s[i], s[i+1], s[i+2], 0.0, s[i+3]); - f = 0.0; - } - break; - - case 0x0A: // callsubr - if (!has_subrs) { - if (info->fdselect.size) - subrs = stbtt__cid_get_glyph_subrs(info, glyph_index); - has_subrs = 1; - } - // FALLTHROUGH - case 0x1D: // callgsubr - if (sp < 1) return STBTT__CSERR("call(g|)subr stack"); - v = (int) s[--sp]; - if (subr_stack_height >= 10) return STBTT__CSERR("recursion limit"); - subr_stack[subr_stack_height++] = b; - b = stbtt__get_subr(b0 == 0x0A ? subrs : info->gsubrs, v); - if (b.size == 0) return STBTT__CSERR("subr not found"); - b.cursor = 0; - clear_stack = 0; - break; - - case 0x0B: // return - if (subr_stack_height <= 0) return STBTT__CSERR("return outside subr"); - b = subr_stack[--subr_stack_height]; - clear_stack = 0; - break; - - case 0x0E: // endchar - stbtt__csctx_close_shape(c); - return 1; - - case 0x0C: { // two-byte escape - float dx1, dx2, dx3, dx4, dx5, dx6, dy1, dy2, dy3, dy4, dy5, dy6; - float dx, dy; - int b1 = stbtt__buf_get8(&b); - switch (b1) { - // @TODO These "flex" implementations ignore the flex-depth and resolution, - // and always draw beziers. - case 0x22: // hflex - if (sp < 7) return STBTT__CSERR("hflex stack"); - dx1 = s[0]; - dx2 = s[1]; - dy2 = s[2]; - dx3 = s[3]; - dx4 = s[4]; - dx5 = s[5]; - dx6 = s[6]; - stbtt__csctx_rccurve_to(c, dx1, 0, dx2, dy2, dx3, 0); - stbtt__csctx_rccurve_to(c, dx4, 0, dx5, -dy2, dx6, 0); - break; - - case 0x23: // flex - if (sp < 13) return STBTT__CSERR("flex stack"); - dx1 = s[0]; - dy1 = s[1]; - dx2 = s[2]; - dy2 = s[3]; - dx3 = s[4]; - dy3 = s[5]; - dx4 = s[6]; - dy4 = s[7]; - dx5 = s[8]; - dy5 = s[9]; - dx6 = s[10]; - dy6 = s[11]; - //fd is s[12] - stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); - stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); - break; - - case 0x24: // hflex1 - if (sp < 9) return STBTT__CSERR("hflex1 stack"); - dx1 = s[0]; - dy1 = s[1]; - dx2 = s[2]; - dy2 = s[3]; - dx3 = s[4]; - dx4 = s[5]; - dx5 = s[6]; - dy5 = s[7]; - dx6 = s[8]; - stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, 0); - stbtt__csctx_rccurve_to(c, dx4, 0, dx5, dy5, dx6, -(dy1+dy2+dy5)); - break; - - case 0x25: // flex1 - if (sp < 11) return STBTT__CSERR("flex1 stack"); - dx1 = s[0]; - dy1 = s[1]; - dx2 = s[2]; - dy2 = s[3]; - dx3 = s[4]; - dy3 = s[5]; - dx4 = s[6]; - dy4 = s[7]; - dx5 = s[8]; - dy5 = s[9]; - dx6 = dy6 = s[10]; - dx = dx1+dx2+dx3+dx4+dx5; - dy = dy1+dy2+dy3+dy4+dy5; - if (STBTT_fabs(dx) > STBTT_fabs(dy)) - dy6 = -dy; - else - dx6 = -dx; - stbtt__csctx_rccurve_to(c, dx1, dy1, dx2, dy2, dx3, dy3); - stbtt__csctx_rccurve_to(c, dx4, dy4, dx5, dy5, dx6, dy6); - break; - - default: - return STBTT__CSERR("unimplemented"); - } - } break; - - default: - if (b0 != 255 && b0 != 28 && b0 < 32) - return STBTT__CSERR("reserved operator"); - - // push immediate - if (b0 == 255) { - f = (float)(stbtt_int32)stbtt__buf_get32(&b) / 0x10000; - } else { - stbtt__buf_skip(&b, -1); - f = (float)(stbtt_int16)stbtt__cff_int(&b); - } - if (sp >= 48) return STBTT__CSERR("push stack overflow"); - s[sp++] = f; - clear_stack = 0; - break; - } - if (clear_stack) sp = 0; - } - return STBTT__CSERR("no endchar"); - -#undef STBTT__CSERR -} - -static int stbtt__GetGlyphShapeT2(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) -{ - // runs the charstring twice, once to count and once to output (to avoid realloc) - stbtt__csctx count_ctx = STBTT__CSCTX_INIT(1); - stbtt__csctx output_ctx = STBTT__CSCTX_INIT(0); - if (stbtt__run_charstring(info, glyph_index, &count_ctx)) { - *pvertices = (stbtt_vertex*)STBTT_malloc(count_ctx.num_vertices*sizeof(stbtt_vertex), info->userdata); - output_ctx.pvertices = *pvertices; - if (stbtt__run_charstring(info, glyph_index, &output_ctx)) { - STBTT_assert(output_ctx.num_vertices == count_ctx.num_vertices); - return output_ctx.num_vertices; - } - } - *pvertices = NULL; - return 0; -} - -static int stbtt__GetGlyphInfoT2(const stbtt_fontinfo *info, int glyph_index, int *x0, int *y0, int *x1, int *y1) -{ - stbtt__csctx c = STBTT__CSCTX_INIT(1); - int r = stbtt__run_charstring(info, glyph_index, &c); - if (x0) *x0 = r ? c.min_x : 0; - if (y0) *y0 = r ? c.min_y : 0; - if (x1) *x1 = r ? c.max_x : 0; - if (y1) *y1 = r ? c.max_y : 0; - return r ? c.num_vertices : 0; -} - -STBTT_DEF int stbtt_GetGlyphShape(const stbtt_fontinfo *info, int glyph_index, stbtt_vertex **pvertices) -{ - if (!info->cff.size) - return stbtt__GetGlyphShapeTT(info, glyph_index, pvertices); - else - return stbtt__GetGlyphShapeT2(info, glyph_index, pvertices); -} - -STBTT_DEF void stbtt_GetGlyphHMetrics(const stbtt_fontinfo *info, int glyph_index, int *advanceWidth, int *leftSideBearing) -{ - stbtt_uint16 numOfLongHorMetrics = ttUSHORT(info->data+info->hhea + 34); - if (glyph_index < numOfLongHorMetrics) { - if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*glyph_index); - if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*glyph_index + 2); - } else { - if (advanceWidth) *advanceWidth = ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1)); - if (leftSideBearing) *leftSideBearing = ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics)); - } -} - -STBTT_DEF int stbtt_GetKerningTableLength(const stbtt_fontinfo *info) -{ - stbtt_uint8 *data = info->data + info->kern; - - // we only look at the first table. it must be 'horizontal' and format 0. - if (!info->kern) - return 0; - if (ttUSHORT(data+2) < 1) // number of tables, need at least 1 - return 0; - if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format - return 0; - - return ttUSHORT(data+10); -} - -STBTT_DEF int stbtt_GetKerningTable(const stbtt_fontinfo *info, stbtt_kerningentry* table, int table_length) -{ - stbtt_uint8 *data = info->data + info->kern; - int k, length; - - // we only look at the first table. it must be 'horizontal' and format 0. - if (!info->kern) - return 0; - if (ttUSHORT(data+2) < 1) // number of tables, need at least 1 - return 0; - if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format - return 0; - - length = ttUSHORT(data+10); - if (table_length < length) - length = table_length; - - for (k = 0; k < length; k++) - { - table[k].glyph1 = ttUSHORT(data+18+(k*6)); - table[k].glyph2 = ttUSHORT(data+20+(k*6)); - table[k].advance = ttSHORT(data+22+(k*6)); - } - - return length; -} - -static int stbtt__GetGlyphKernInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) -{ - stbtt_uint8 *data = info->data + info->kern; - stbtt_uint32 needle, straw; - int l, r, m; - - // we only look at the first table. it must be 'horizontal' and format 0. - if (!info->kern) - return 0; - if (ttUSHORT(data+2) < 1) // number of tables, need at least 1 - return 0; - if (ttUSHORT(data+8) != 1) // horizontal flag must be set in format - return 0; - - l = 0; - r = ttUSHORT(data+10) - 1; - needle = glyph1 << 16 | glyph2; - while (l <= r) { - m = (l + r) >> 1; - straw = ttULONG(data+18+(m*6)); // note: unaligned read - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else - return ttSHORT(data+22+(m*6)); - } - return 0; -} - -static stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int glyph) -{ - stbtt_uint16 coverageFormat = ttUSHORT(coverageTable); - switch (coverageFormat) { - case 1: { - stbtt_uint16 glyphCount = ttUSHORT(coverageTable + 2); - - // Binary search. - stbtt_int32 l=0, r=glyphCount-1, m; - int straw, needle=glyph; - while (l <= r) { - stbtt_uint8 *glyphArray = coverageTable + 4; - stbtt_uint16 glyphID; - m = (l + r) >> 1; - glyphID = ttUSHORT(glyphArray + 2 * m); - straw = glyphID; - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else { - return m; - } - } - break; - } - - case 2: { - stbtt_uint16 rangeCount = ttUSHORT(coverageTable + 2); - stbtt_uint8 *rangeArray = coverageTable + 4; - - // Binary search. - stbtt_int32 l=0, r=rangeCount-1, m; - int strawStart, strawEnd, needle=glyph; - while (l <= r) { - stbtt_uint8 *rangeRecord; - m = (l + r) >> 1; - rangeRecord = rangeArray + 6 * m; - strawStart = ttUSHORT(rangeRecord); - strawEnd = ttUSHORT(rangeRecord + 2); - if (needle < strawStart) - r = m - 1; - else if (needle > strawEnd) - l = m + 1; - else { - stbtt_uint16 startCoverageIndex = ttUSHORT(rangeRecord + 4); - return startCoverageIndex + glyph - strawStart; - } - } - break; - } - - default: return -1; // unsupported - } - - return -1; -} - -static stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph) -{ - stbtt_uint16 classDefFormat = ttUSHORT(classDefTable); - switch (classDefFormat) - { - case 1: { - stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2); - stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4); - stbtt_uint8 *classDef1ValueArray = classDefTable + 6; - - if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount) - return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID)); - break; - } - - case 2: { - stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2); - stbtt_uint8 *classRangeRecords = classDefTable + 4; - - // Binary search. - stbtt_int32 l=0, r=classRangeCount-1, m; - int strawStart, strawEnd, needle=glyph; - while (l <= r) { - stbtt_uint8 *classRangeRecord; - m = (l + r) >> 1; - classRangeRecord = classRangeRecords + 6 * m; - strawStart = ttUSHORT(classRangeRecord); - strawEnd = ttUSHORT(classRangeRecord + 2); - if (needle < strawStart) - r = m - 1; - else if (needle > strawEnd) - l = m + 1; - else - return (stbtt_int32)ttUSHORT(classRangeRecord + 4); - } - break; - } - - default: - return -1; // Unsupported definition type, return an error. - } - - // "All glyphs not assigned to a class fall into class 0". (OpenType spec) - return 0; -} - -// Define to STBTT_assert(x) if you want to break on unimplemented formats. -#define STBTT_GPOS_TODO_assert(x) - -static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2) -{ - stbtt_uint16 lookupListOffset; - stbtt_uint8 *lookupList; - stbtt_uint16 lookupCount; - stbtt_uint8 *data; - stbtt_int32 i, sti; - - if (!info->gpos) return 0; - - data = info->data + info->gpos; - - if (ttUSHORT(data+0) != 1) return 0; // Major version 1 - if (ttUSHORT(data+2) != 0) return 0; // Minor version 0 - - lookupListOffset = ttUSHORT(data+8); - lookupList = data + lookupListOffset; - lookupCount = ttUSHORT(lookupList); - - for (i=0; i= pairSetCount) return 0; - - needle=glyph2; - r=pairValueCount-1; - l=0; - - // Binary search. - while (l <= r) { - stbtt_uint16 secondGlyph; - stbtt_uint8 *pairValue; - m = (l + r) >> 1; - pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m; - secondGlyph = ttUSHORT(pairValue); - straw = secondGlyph; - if (needle < straw) - r = m - 1; - else if (needle > straw) - l = m + 1; - else { - stbtt_int16 xAdvance = ttSHORT(pairValue + 2); - return xAdvance; - } - } - } else - return 0; - break; - } - - case 2: { - stbtt_uint16 valueFormat1 = ttUSHORT(table + 4); - stbtt_uint16 valueFormat2 = ttUSHORT(table + 6); - if (valueFormat1 == 4 && valueFormat2 == 0) { // Support more formats? - stbtt_uint16 classDef1Offset = ttUSHORT(table + 8); - stbtt_uint16 classDef2Offset = ttUSHORT(table + 10); - int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1); - int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2); - - stbtt_uint16 class1Count = ttUSHORT(table + 12); - stbtt_uint16 class2Count = ttUSHORT(table + 14); - stbtt_uint8 *class1Records, *class2Records; - stbtt_int16 xAdvance; - - if (glyph1class < 0 || glyph1class >= class1Count) return 0; // malformed - if (glyph2class < 0 || glyph2class >= class2Count) return 0; // malformed - - class1Records = table + 16; - class2Records = class1Records + 2 * (glyph1class * class2Count); - xAdvance = ttSHORT(class2Records + 2 * glyph2class); - return xAdvance; - } else - return 0; - break; - } - - default: - return 0; // Unsupported position format - } - } - } - - return 0; -} - -STBTT_DEF int stbtt_GetGlyphKernAdvance(const stbtt_fontinfo *info, int g1, int g2) -{ - int xAdvance = 0; - - if (info->gpos) - xAdvance += stbtt__GetGlyphGPOSInfoAdvance(info, g1, g2); - else if (info->kern) - xAdvance += stbtt__GetGlyphKernInfoAdvance(info, g1, g2); - - return xAdvance; -} - -STBTT_DEF int stbtt_GetCodepointKernAdvance(const stbtt_fontinfo *info, int ch1, int ch2) -{ - if (!info->kern && !info->gpos) // if no kerning table, don't waste time looking up both codepoint->glyphs - return 0; - return stbtt_GetGlyphKernAdvance(info, stbtt_FindGlyphIndex(info,ch1), stbtt_FindGlyphIndex(info,ch2)); -} - -STBTT_DEF void stbtt_GetCodepointHMetrics(const stbtt_fontinfo *info, int codepoint, int *advanceWidth, int *leftSideBearing) -{ - stbtt_GetGlyphHMetrics(info, stbtt_FindGlyphIndex(info,codepoint), advanceWidth, leftSideBearing); -} - -STBTT_DEF void stbtt_GetFontVMetrics(const stbtt_fontinfo *info, int *ascent, int *descent, int *lineGap) -{ - if (ascent ) *ascent = ttSHORT(info->data+info->hhea + 4); - if (descent) *descent = ttSHORT(info->data+info->hhea + 6); - if (lineGap) *lineGap = ttSHORT(info->data+info->hhea + 8); -} - -STBTT_DEF int stbtt_GetFontVMetricsOS2(const stbtt_fontinfo *info, int *typoAscent, int *typoDescent, int *typoLineGap) -{ - int tab = stbtt__find_table(info->data, info->fontstart, "OS/2"); - if (!tab) - return 0; - if (typoAscent ) *typoAscent = ttSHORT(info->data+tab + 68); - if (typoDescent) *typoDescent = ttSHORT(info->data+tab + 70); - if (typoLineGap) *typoLineGap = ttSHORT(info->data+tab + 72); - return 1; -} - -STBTT_DEF void stbtt_GetFontBoundingBox(const stbtt_fontinfo *info, int *x0, int *y0, int *x1, int *y1) -{ - *x0 = ttSHORT(info->data + info->head + 36); - *y0 = ttSHORT(info->data + info->head + 38); - *x1 = ttSHORT(info->data + info->head + 40); - *y1 = ttSHORT(info->data + info->head + 42); -} - -STBTT_DEF float stbtt_ScaleForPixelHeight(const stbtt_fontinfo *info, float height) -{ - int fheight = ttSHORT(info->data + info->hhea + 4) - ttSHORT(info->data + info->hhea + 6); - return (float) height / fheight; -} - -STBTT_DEF float stbtt_ScaleForMappingEmToPixels(const stbtt_fontinfo *info, float pixels) -{ - int unitsPerEm = ttUSHORT(info->data + info->head + 18); - return pixels / unitsPerEm; -} - -STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v) -{ - STBTT_free(v, info->userdata); -} - -STBTT_DEF stbtt_uint8 *stbtt_FindSVGDoc(const stbtt_fontinfo *info, int gl) -{ - int i; - stbtt_uint8 *data = info->data; - stbtt_uint8 *svg_doc_list = data + stbtt__get_svg((stbtt_fontinfo *) info); - - int numEntries = ttUSHORT(svg_doc_list); - stbtt_uint8 *svg_docs = svg_doc_list + 2; - - for(i=0; i= ttUSHORT(svg_doc)) && (gl <= ttUSHORT(svg_doc + 2))) - return svg_doc; - } - return 0; -} - -STBTT_DEF int stbtt_GetGlyphSVG(const stbtt_fontinfo *info, int gl, const char **svg) -{ - stbtt_uint8 *data = info->data; - stbtt_uint8 *svg_doc; - - if (info->svg == 0) - return 0; - - svg_doc = stbtt_FindSVGDoc(info, gl); - if (svg_doc != NULL) { - *svg = (char *) data + info->svg + ttULONG(svg_doc + 4); - return ttULONG(svg_doc + 8); - } else { - return 0; - } -} - -STBTT_DEF int stbtt_GetCodepointSVG(const stbtt_fontinfo *info, int unicode_codepoint, const char **svg) -{ - return stbtt_GetGlyphSVG(info, stbtt_FindGlyphIndex(info, unicode_codepoint), svg); -} - -////////////////////////////////////////////////////////////////////////////// -// -// antialiasing software rasterizer -// - -STBTT_DEF void stbtt_GetGlyphBitmapBoxSubpixel(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y,float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - int x0=0,y0=0,x1,y1; // =0 suppresses compiler warning - if (!stbtt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) { - // e.g. space character - if (ix0) *ix0 = 0; - if (iy0) *iy0 = 0; - if (ix1) *ix1 = 0; - if (iy1) *iy1 = 0; - } else { - // move to integral bboxes (treating pixels as little squares, what pixels get touched)? - if (ix0) *ix0 = STBTT_ifloor( x0 * scale_x + shift_x); - if (iy0) *iy0 = STBTT_ifloor(-y1 * scale_y + shift_y); - if (ix1) *ix1 = STBTT_iceil ( x1 * scale_x + shift_x); - if (iy1) *iy1 = STBTT_iceil (-y0 * scale_y + shift_y); - } -} - -STBTT_DEF void stbtt_GetGlyphBitmapBox(const stbtt_fontinfo *font, int glyph, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1); -} - -STBTT_DEF void stbtt_GetCodepointBitmapBoxSubpixel(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetGlyphBitmapBoxSubpixel(font, stbtt_FindGlyphIndex(font,codepoint), scale_x, scale_y,shift_x,shift_y, ix0,iy0,ix1,iy1); -} - -STBTT_DEF void stbtt_GetCodepointBitmapBox(const stbtt_fontinfo *font, int codepoint, float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - stbtt_GetCodepointBitmapBoxSubpixel(font, codepoint, scale_x, scale_y,0.0f,0.0f, ix0,iy0,ix1,iy1); -} - -////////////////////////////////////////////////////////////////////////////// -// -// Rasterizer - -typedef struct stbtt__hheap_chunk -{ - struct stbtt__hheap_chunk *next; -} stbtt__hheap_chunk; - -typedef struct stbtt__hheap -{ - struct stbtt__hheap_chunk *head; - void *first_free; - int num_remaining_in_head_chunk; -} stbtt__hheap; - -static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata) -{ - if (hh->first_free) { - void *p = hh->first_free; - hh->first_free = * (void **) p; - return p; - } else { - if (hh->num_remaining_in_head_chunk == 0) { - int count = (size < 32 ? 2000 : size < 128 ? 800 : 100); - stbtt__hheap_chunk *c = (stbtt__hheap_chunk *) STBTT_malloc(sizeof(stbtt__hheap_chunk) + size * count, userdata); - if (c == NULL) - return NULL; - c->next = hh->head; - hh->head = c; - hh->num_remaining_in_head_chunk = count; - } - --hh->num_remaining_in_head_chunk; - return (char *) (hh->head) + sizeof(stbtt__hheap_chunk) + size * hh->num_remaining_in_head_chunk; - } -} - -static void stbtt__hheap_free(stbtt__hheap *hh, void *p) -{ - *(void **) p = hh->first_free; - hh->first_free = p; -} - -static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata) -{ - stbtt__hheap_chunk *c = hh->head; - while (c) { - stbtt__hheap_chunk *n = c->next; - STBTT_free(c, userdata); - c = n; - } -} - -typedef struct stbtt__edge { - float x0,y0, x1,y1; - int invert; -} stbtt__edge; - - -typedef struct stbtt__active_edge -{ - struct stbtt__active_edge *next; - #if STBTT_RASTERIZER_VERSION==1 - int x,dx; - float ey; - int direction; - #elif STBTT_RASTERIZER_VERSION==2 - float fx,fdx,fdy; - float direction; - float sy; - float ey; - #else - #error "Unrecognized value of STBTT_RASTERIZER_VERSION" - #endif -} stbtt__active_edge; - -#if STBTT_RASTERIZER_VERSION == 1 -#define STBTT_FIXSHIFT 10 -#define STBTT_FIX (1 << STBTT_FIXSHIFT) -#define STBTT_FIXMASK (STBTT_FIX-1) - -static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) -{ - stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); - STBTT_assert(z != NULL); - if (!z) return z; - - // round dx down to avoid overshooting - if (dxdy < 0) - z->dx = -STBTT_ifloor(STBTT_FIX * -dxdy); - else - z->dx = STBTT_ifloor(STBTT_FIX * dxdy); - - z->x = STBTT_ifloor(STBTT_FIX * e->x0 + z->dx * (start_point - e->y0)); // use z->dx so when we offset later it's by the same amount - z->x -= off_x * STBTT_FIX; - - z->ey = e->y1; - z->next = 0; - z->direction = e->invert ? 1 : -1; - return z; -} -#elif STBTT_RASTERIZER_VERSION == 2 -static stbtt__active_edge *stbtt__new_active(stbtt__hheap *hh, stbtt__edge *e, int off_x, float start_point, void *userdata) -{ - stbtt__active_edge *z = (stbtt__active_edge *) stbtt__hheap_alloc(hh, sizeof(*z), userdata); - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); - STBTT_assert(z != NULL); - //STBTT_assert(e->y0 <= start_point); - if (!z) return z; - z->fdx = dxdy; - z->fdy = dxdy != 0.0f ? (1.0f/dxdy) : 0.0f; - z->fx = e->x0 + dxdy * (start_point - e->y0); - z->fx -= off_x; - z->direction = e->invert ? 1.0f : -1.0f; - z->sy = e->y0; - z->ey = e->y1; - z->next = 0; - return z; -} -#else -#error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - -#if STBTT_RASTERIZER_VERSION == 1 -// note: this routine clips fills that extend off the edges... ideally this -// wouldn't happen, but it could happen if the truetype glyph bounding boxes -// are wrong, or if the user supplies a too-small bitmap -static void stbtt__fill_active_edges(unsigned char *scanline, int len, stbtt__active_edge *e, int max_weight) -{ - // non-zero winding fill - int x0=0, w=0; - - while (e) { - if (w == 0) { - // if we're currently at zero, we need to record the edge start point - x0 = e->x; w += e->direction; - } else { - int x1 = e->x; w += e->direction; - // if we went to zero, we need to draw - if (w == 0) { - int i = x0 >> STBTT_FIXSHIFT; - int j = x1 >> STBTT_FIXSHIFT; - - if (i < len && j >= 0) { - if (i == j) { - // x0,x1 are the same pixel, so compute combined coverage - scanline[i] = scanline[i] + (stbtt_uint8) ((x1 - x0) * max_weight >> STBTT_FIXSHIFT); - } else { - if (i >= 0) // add antialiasing for x0 - scanline[i] = scanline[i] + (stbtt_uint8) (((STBTT_FIX - (x0 & STBTT_FIXMASK)) * max_weight) >> STBTT_FIXSHIFT); - else - i = -1; // clip - - if (j < len) // add antialiasing for x1 - scanline[j] = scanline[j] + (stbtt_uint8) (((x1 & STBTT_FIXMASK) * max_weight) >> STBTT_FIXSHIFT); - else - j = len; // clip - - for (++i; i < j; ++i) // fill pixels between x0 and x1 - scanline[i] = scanline[i] + (stbtt_uint8) max_weight; - } - } - } - } - - e = e->next; - } -} - -static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) -{ - stbtt__hheap hh = { 0, 0, 0 }; - stbtt__active_edge *active = NULL; - int y,j=0; - int max_weight = (255 / vsubsample); // weight per vertical scanline - int s; // vertical subsample index - unsigned char scanline_data[512], *scanline; - - if (result->w > 512) - scanline = (unsigned char *) STBTT_malloc(result->w, userdata); - else - scanline = scanline_data; - - y = off_y * vsubsample; - e[n].y0 = (off_y + result->h) * (float) vsubsample + 1; - - while (j < result->h) { - STBTT_memset(scanline, 0, result->w); - for (s=0; s < vsubsample; ++s) { - // find center of pixel for this scanline - float scan_y = y + 0.5f; - stbtt__active_edge **step = &active; - - // update all active edges; - // remove all active edges that terminate before the center of this scanline - while (*step) { - stbtt__active_edge * z = *step; - if (z->ey <= scan_y) { - *step = z->next; // delete from list - STBTT_assert(z->direction); - z->direction = 0; - stbtt__hheap_free(&hh, z); - } else { - z->x += z->dx; // advance to position for current scanline - step = &((*step)->next); // advance through list - } - } - - // resort the list if needed - for(;;) { - int changed=0; - step = &active; - while (*step && (*step)->next) { - if ((*step)->x > (*step)->next->x) { - stbtt__active_edge *t = *step; - stbtt__active_edge *q = t->next; - - t->next = q->next; - q->next = t; - *step = q; - changed = 1; - } - step = &(*step)->next; - } - if (!changed) break; - } - - // insert all edges that start before the center of this scanline -- omit ones that also end on this scanline - while (e->y0 <= scan_y) { - if (e->y1 > scan_y) { - stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y, userdata); - if (z != NULL) { - // find insertion point - if (active == NULL) - active = z; - else if (z->x < active->x) { - // insert at front - z->next = active; - active = z; - } else { - // find thing to insert AFTER - stbtt__active_edge *p = active; - while (p->next && p->next->x < z->x) - p = p->next; - // at this point, p->next->x is NOT < z->x - z->next = p->next; - p->next = z; - } - } - } - ++e; - } - - // now process all active edges in XOR fashion - if (active) - stbtt__fill_active_edges(scanline, result->w, active, max_weight); - - ++y; - } - STBTT_memcpy(result->pixels + j * result->stride, scanline, result->w); - ++j; - } - - stbtt__hheap_cleanup(&hh, userdata); - - if (scanline != scanline_data) - STBTT_free(scanline, userdata); -} - -#elif STBTT_RASTERIZER_VERSION == 2 - -// the edge passed in here does not cross the vertical line at x or the vertical line at x+1 -// (i.e. it has already been clipped to those) -static void stbtt__handle_clipped_edge(float *scanline, int x, stbtt__active_edge *e, float x0, float y0, float x1, float y1) -{ - if (y0 == y1) return; - STBTT_assert(y0 < y1); - STBTT_assert(e->sy <= e->ey); - if (y0 > e->ey) return; - if (y1 < e->sy) return; - if (y0 < e->sy) { - x0 += (x1-x0) * (e->sy - y0) / (y1-y0); - y0 = e->sy; - } - if (y1 > e->ey) { - x1 += (x1-x0) * (e->ey - y1) / (y1-y0); - y1 = e->ey; - } - - if (x0 == x) - STBTT_assert(x1 <= x+1); - else if (x0 == x+1) - STBTT_assert(x1 >= x); - else if (x0 <= x) - STBTT_assert(x1 <= x); - else if (x0 >= x+1) - STBTT_assert(x1 >= x+1); - else - STBTT_assert(x1 >= x && x1 <= x+1); - - if (x0 <= x && x1 <= x) - scanline[x] += e->direction * (y1-y0); - else if (x0 >= x+1 && x1 >= x+1) - ; - else { - STBTT_assert(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1); - scanline[x] += e->direction * (y1-y0) * (1-((x0-x)+(x1-x))/2); // coverage = 1 - average x position - } -} - -static float stbtt__sized_trapezoid_area(float height, float top_width, float bottom_width) -{ - STBTT_assert(top_width >= 0); - STBTT_assert(bottom_width >= 0); - return (top_width + bottom_width) / 2.0f * height; -} - -static float stbtt__position_trapezoid_area(float height, float tx0, float tx1, float bx0, float bx1) -{ - return stbtt__sized_trapezoid_area(height, tx1 - tx0, bx1 - bx0); -} - -static float stbtt__sized_triangle_area(float height, float width) -{ - return height * width / 2; -} - -static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, stbtt__active_edge *e, float y_top) -{ - float y_bottom = y_top+1; - - while (e) { - // brute force every pixel - - // compute intersection points with top & bottom - STBTT_assert(e->ey >= y_top); - - if (e->fdx == 0) { - float x0 = e->fx; - if (x0 < len) { - if (x0 >= 0) { - stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom); - stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom); - } else { - stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom); - } - } - } else { - float x0 = e->fx; - float dx = e->fdx; - float xb = x0 + dx; - float x_top, x_bottom; - float sy0,sy1; - float dy = e->fdy; - STBTT_assert(e->sy <= y_bottom && e->ey >= y_top); - - // compute endpoints of line segment clipped to this scanline (if the - // line segment starts on this scanline. x0 is the intersection of the - // line with y_top, but that may be off the line segment. - if (e->sy > y_top) { - x_top = x0 + dx * (e->sy - y_top); - sy0 = e->sy; - } else { - x_top = x0; - sy0 = y_top; - } - if (e->ey < y_bottom) { - x_bottom = x0 + dx * (e->ey - y_top); - sy1 = e->ey; - } else { - x_bottom = xb; - sy1 = y_bottom; - } - - if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) { - // from here on, we don't have to range check x values - - if ((int) x_top == (int) x_bottom) { - float height; - // simple case, only spans one pixel - int x = (int) x_top; - height = (sy1 - sy0) * e->direction; - STBTT_assert(x >= 0 && x < len); - scanline[x] += stbtt__position_trapezoid_area(height, x_top, x+1.0f, x_bottom, x+1.0f); - scanline_fill[x] += height; // everything right of this pixel is filled - } else { - int x,x1,x2; - float y_crossing, y_final, step, sign, area; - // covers 2+ pixels - if (x_top > x_bottom) { - // flip scanline vertically; signed area is the same - float t; - sy0 = y_bottom - (sy0 - y_top); - sy1 = y_bottom - (sy1 - y_top); - t = sy0, sy0 = sy1, sy1 = t; - t = x_bottom, x_bottom = x_top, x_top = t; - dx = -dx; - dy = -dy; - t = x0, x0 = xb, xb = t; - } - STBTT_assert(dy >= 0); - STBTT_assert(dx >= 0); - - x1 = (int) x_top; - x2 = (int) x_bottom; - // compute intersection with y axis at x1+1 - y_crossing = y_top + dy * (x1+1 - x0); - - // compute intersection with y axis at x2 - y_final = y_top + dy * (x2 - x0); - - // x1 x_top x2 x_bottom - // y_top +------|-----+------------+------------+--------|---+------------+ - // | | | | | | - // | | | | | | - // sy0 | Txxxxx|............|............|............|............| - // y_crossing | *xxxxx.......|............|............|............| - // | | xxxxx..|............|............|............| - // | | /- xx*xxxx........|............|............| - // | | dy < | xxxxxx..|............|............| - // y_final | | \- | xx*xxx.........|............| - // sy1 | | | | xxxxxB...|............| - // | | | | | | - // | | | | | | - // y_bottom +------------+------------+------------+------------+------------+ - // - // goal is to measure the area covered by '.' in each pixel - - // if x2 is right at the right edge of x1, y_crossing can blow up, github #1057 - // @TODO: maybe test against sy1 rather than y_bottom? - if (y_crossing > y_bottom) - y_crossing = y_bottom; - - sign = e->direction; - - // area of the rectangle covered from sy0..y_crossing - area = sign * (y_crossing-sy0); - - // area of the triangle (x_top,sy0), (x1+1,sy0), (x1+1,y_crossing) - scanline[x1] += stbtt__sized_triangle_area(area, x1+1 - x_top); - - // check if final y_crossing is blown up; no test case for this - if (y_final > y_bottom) { - y_final = y_bottom; - dy = (y_final - y_crossing ) / (x2 - (x1+1)); // if denom=0, y_final = y_crossing, so y_final <= y_bottom - } - - // in second pixel, area covered by line segment found in first pixel - // is always a rectangle 1 wide * the height of that line segment; this - // is exactly what the variable 'area' stores. it also gets a contribution - // from the line segment within it. the THIRD pixel will get the first - // pixel's rectangle contribution, the second pixel's rectangle contribution, - // and its own contribution. the 'own contribution' is the same in every pixel except - // the leftmost and rightmost, a trapezoid that slides down in each pixel. - // the second pixel's contribution to the third pixel will be the - // rectangle 1 wide times the height change in the second pixel, which is dy. - - step = sign * dy * 1; // dy is dy/dx, change in y for every 1 change in x, - // which multiplied by 1-pixel-width is how much pixel area changes for each step in x - // so the area advances by 'step' every time - - for (x = x1+1; x < x2; ++x) { - scanline[x] += area + step/2; // area of trapezoid is 1*step/2 - area += step; - } - STBTT_assert(STBTT_fabs(area) <= 1.01f); // accumulated error from area += step unless we round step down - STBTT_assert(sy1 > y_final-0.01f); - - // area covered in the last pixel is the rectangle from all the pixels to the left, - // plus the trapezoid filled by the line segment in this pixel all the way to the right edge - scanline[x2] += area + sign * stbtt__position_trapezoid_area(sy1-y_final, (float) x2, x2+1.0f, x_bottom, x2+1.0f); - - // the rest of the line is filled based on the total height of the line segment in this pixel - scanline_fill[x2] += sign * (sy1-sy0); - } - } else { - // if edge goes outside of box we're drawing, we require - // clipping logic. since this does not match the intended use - // of this library, we use a different, very slow brute - // force implementation - // note though that this does happen some of the time because - // x_top and x_bottom can be extrapolated at the top & bottom of - // the shape and actually lie outside the bounding box - int x; - for (x=0; x < len; ++x) { - // cases: - // - // there can be up to two intersections with the pixel. any intersection - // with left or right edges can be handled by splitting into two (or three) - // regions. intersections with top & bottom do not necessitate case-wise logic. - // - // the old way of doing this found the intersections with the left & right edges, - // then used some simple logic to produce up to three segments in sorted order - // from top-to-bottom. however, this had a problem: if an x edge was epsilon - // across the x border, then the corresponding y position might not be distinct - // from the other y segment, and it might ignored as an empty segment. to avoid - // that, we need to explicitly produce segments based on x positions. - - // rename variables to clearly-defined pairs - float y0 = y_top; - float x1 = (float) (x); - float x2 = (float) (x+1); - float x3 = xb; - float y3 = y_bottom; - - // x = e->x + e->dx * (y-y_top) - // (y-y_top) = (x - e->x) / e->dx - // y = (x - e->x) / e->dx + y_top - float y1 = (x - x0) / dx + y_top; - float y2 = (x+1 - x0) / dx + y_top; - - if (x0 < x1 && x3 > x2) { // three segments descending down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else if (x3 < x1 && x0 > x2) { // three segments descending down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x0 < x1 && x3 > x1) { // two segments across x, down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x3 < x1 && x0 > x1) { // two segments across x, down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1); - stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3); - } else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2); - stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else { // one segment - stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3); - } - } - } - } - e = e->next; - } -} - -// directly AA rasterize edges w/o supersampling -static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) -{ - stbtt__hheap hh = { 0, 0, 0 }; - stbtt__active_edge *active = NULL; - int y,j=0, i; - float scanline_data[129], *scanline, *scanline2; - - STBTT__NOTUSED(vsubsample); - - if (result->w > 64) - scanline = (float *) STBTT_malloc((result->w*2+1) * sizeof(float), userdata); - else - scanline = scanline_data; - - scanline2 = scanline + result->w; - - y = off_y; - e[n].y0 = (float) (off_y + result->h) + 1; - - while (j < result->h) { - // find center of pixel for this scanline - float scan_y_top = y + 0.0f; - float scan_y_bottom = y + 1.0f; - stbtt__active_edge **step = &active; - - STBTT_memset(scanline , 0, result->w*sizeof(scanline[0])); - STBTT_memset(scanline2, 0, (result->w+1)*sizeof(scanline[0])); - - // update all active edges; - // remove all active edges that terminate before the top of this scanline - while (*step) { - stbtt__active_edge * z = *step; - if (z->ey <= scan_y_top) { - *step = z->next; // delete from list - STBTT_assert(z->direction); - z->direction = 0; - stbtt__hheap_free(&hh, z); - } else { - step = &((*step)->next); // advance through list - } - } - - // insert all edges that start before the bottom of this scanline - while (e->y0 <= scan_y_bottom) { - if (e->y0 != e->y1) { - stbtt__active_edge *z = stbtt__new_active(&hh, e, off_x, scan_y_top, userdata); - if (z != NULL) { - if (j == 0 && off_y != 0) { - if (z->ey < scan_y_top) { - // this can happen due to subpixel positioning and some kind of fp rounding error i think - z->ey = scan_y_top; - } - } - STBTT_assert(z->ey >= scan_y_top); // if we get really unlucky a tiny bit of an edge can be out of bounds - // insert at front - z->next = active; - active = z; - } - } - ++e; - } - - // now process all active edges - if (active) - stbtt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top); - - { - float sum = 0; - for (i=0; i < result->w; ++i) { - float k; - int m; - sum += scanline2[i]; - k = scanline[i] + sum; - k = (float) STBTT_fabs(k)*255 + 0.5f; - m = (int) k; - if (m > 255) m = 255; - result->pixels[j*result->stride + i] = (unsigned char) m; - } - } - // advance all the edges - step = &active; - while (*step) { - stbtt__active_edge *z = *step; - z->fx += z->fdx; // advance to position for current scanline - step = &((*step)->next); // advance through list - } - - ++y; - ++j; - } - - stbtt__hheap_cleanup(&hh, userdata); - - if (scanline != scanline_data) - STBTT_free(scanline, userdata); -} -#else -#error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - -#define STBTT__COMPARE(a,b) ((a)->y0 < (b)->y0) - -static void stbtt__sort_edges_ins_sort(stbtt__edge *p, int n) -{ - int i,j; - for (i=1; i < n; ++i) { - stbtt__edge t = p[i], *a = &t; - j = i; - while (j > 0) { - stbtt__edge *b = &p[j-1]; - int c = STBTT__COMPARE(a,b); - if (!c) break; - p[j] = p[j-1]; - --j; - } - if (i != j) - p[j] = t; - } -} - -static void stbtt__sort_edges_quicksort(stbtt__edge *p, int n) -{ - /* threshold for transitioning to insertion sort */ - while (n > 12) { - stbtt__edge t; - int c01,c12,c,m,i,j; - - /* compute median of three */ - m = n >> 1; - c01 = STBTT__COMPARE(&p[0],&p[m]); - c12 = STBTT__COMPARE(&p[m],&p[n-1]); - /* if 0 >= mid >= end, or 0 < mid < end, then use mid */ - if (c01 != c12) { - /* otherwise, we'll need to swap something else to middle */ - int z; - c = STBTT__COMPARE(&p[0],&p[n-1]); - /* 0>mid && midn => n; 0 0 */ - /* 0n: 0>n => 0; 0 n */ - z = (c == c12) ? 0 : n-1; - t = p[z]; - p[z] = p[m]; - p[m] = t; - } - /* now p[m] is the median-of-three */ - /* swap it to the beginning so it won't move around */ - t = p[0]; - p[0] = p[m]; - p[m] = t; - - /* partition loop */ - i=1; - j=n-1; - for(;;) { - /* handling of equality is crucial here */ - /* for sentinels & efficiency with duplicates */ - for (;;++i) { - if (!STBTT__COMPARE(&p[i], &p[0])) break; - } - for (;;--j) { - if (!STBTT__COMPARE(&p[0], &p[j])) break; - } - /* make sure we haven't crossed */ - if (i >= j) break; - t = p[i]; - p[i] = p[j]; - p[j] = t; - - ++i; - --j; - } - /* recurse on smaller side, iterate on larger */ - if (j < (n-i)) { - stbtt__sort_edges_quicksort(p,j); - p = p+i; - n = n-i; - } else { - stbtt__sort_edges_quicksort(p+i, n-i); - n = j; - } - } -} - -static void stbtt__sort_edges(stbtt__edge *p, int n) -{ - stbtt__sort_edges_quicksort(p, n); - stbtt__sort_edges_ins_sort(p, n); -} - -typedef struct -{ - float x,y; -} stbtt__point; - -static void stbtt__rasterize(stbtt__bitmap *result, stbtt__point *pts, int *wcount, int windings, float scale_x, float scale_y, float shift_x, float shift_y, int off_x, int off_y, int invert, void *userdata) -{ - float y_scale_inv = invert ? -scale_y : scale_y; - stbtt__edge *e; - int n,i,j,k,m; -#if STBTT_RASTERIZER_VERSION == 1 - int vsubsample = result->h < 8 ? 15 : 5; -#elif STBTT_RASTERIZER_VERSION == 2 - int vsubsample = 1; -#else - #error "Unrecognized value of STBTT_RASTERIZER_VERSION" -#endif - // vsubsample should divide 255 evenly; otherwise we won't reach full opacity - - // now we have to blow out the windings into explicit edge lists - n = 0; - for (i=0; i < windings; ++i) - n += wcount[i]; - - e = (stbtt__edge *) STBTT_malloc(sizeof(*e) * (n+1), userdata); // add an extra one as a sentinel - if (e == 0) return; - n = 0; - - m=0; - for (i=0; i < windings; ++i) { - stbtt__point *p = pts + m; - m += wcount[i]; - j = wcount[i]-1; - for (k=0; k < wcount[i]; j=k++) { - int a=k,b=j; - // skip the edge if horizontal - if (p[j].y == p[k].y) - continue; - // add edge from j to k to the list - e[n].invert = 0; - if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { - e[n].invert = 1; - a=j,b=k; - } - e[n].x0 = p[a].x * scale_x + shift_x; - e[n].y0 = (p[a].y * y_scale_inv + shift_y) * vsubsample; - e[n].x1 = p[b].x * scale_x + shift_x; - e[n].y1 = (p[b].y * y_scale_inv + shift_y) * vsubsample; - ++n; - } - } - - // now sort the edges by their highest point (should snap to integer, and then by x) - //STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare); - stbtt__sort_edges(e, n); - - // now, traverse the scanlines and find the intersections on each scanline, use xor winding rule - stbtt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, userdata); - - STBTT_free(e, userdata); -} - -static void stbtt__add_point(stbtt__point *points, int n, float x, float y) -{ - if (!points) return; // during first pass, it's unallocated - points[n].x = x; - points[n].y = y; -} - -// tessellate until threshold p is happy... @TODO warped to compensate for non-linear stretching -static int stbtt__tesselate_curve(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float objspace_flatness_squared, int n) -{ - // midpoint - float mx = (x0 + 2*x1 + x2)/4; - float my = (y0 + 2*y1 + y2)/4; - // versus directly drawn line - float dx = (x0+x2)/2 - mx; - float dy = (y0+y2)/2 - my; - if (n > 16) // 65536 segments on one curve better be enough! - return 1; - if (dx*dx+dy*dy > objspace_flatness_squared) { // half-pixel error allowed... need to be smaller if AA - stbtt__tesselate_curve(points, num_points, x0,y0, (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1); - stbtt__tesselate_curve(points, num_points, mx,my, (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1); - } else { - stbtt__add_point(points, *num_points,x2,y2); - *num_points = *num_points+1; - } - return 1; -} - -static void stbtt__tesselate_cubic(stbtt__point *points, int *num_points, float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, float objspace_flatness_squared, int n) -{ - // @TODO this "flatness" calculation is just made-up nonsense that seems to work well enough - float dx0 = x1-x0; - float dy0 = y1-y0; - float dx1 = x2-x1; - float dy1 = y2-y1; - float dx2 = x3-x2; - float dy2 = y3-y2; - float dx = x3-x0; - float dy = y3-y0; - float longlen = (float) (STBTT_sqrt(dx0*dx0+dy0*dy0)+STBTT_sqrt(dx1*dx1+dy1*dy1)+STBTT_sqrt(dx2*dx2+dy2*dy2)); - float shortlen = (float) STBTT_sqrt(dx*dx+dy*dy); - float flatness_squared = longlen*longlen-shortlen*shortlen; - - if (n > 16) // 65536 segments on one curve better be enough! - return; - - if (flatness_squared > objspace_flatness_squared) { - float x01 = (x0+x1)/2; - float y01 = (y0+y1)/2; - float x12 = (x1+x2)/2; - float y12 = (y1+y2)/2; - float x23 = (x2+x3)/2; - float y23 = (y2+y3)/2; - - float xa = (x01+x12)/2; - float ya = (y01+y12)/2; - float xb = (x12+x23)/2; - float yb = (y12+y23)/2; - - float mx = (xa+xb)/2; - float my = (ya+yb)/2; - - stbtt__tesselate_cubic(points, num_points, x0,y0, x01,y01, xa,ya, mx,my, objspace_flatness_squared,n+1); - stbtt__tesselate_cubic(points, num_points, mx,my, xb,yb, x23,y23, x3,y3, objspace_flatness_squared,n+1); - } else { - stbtt__add_point(points, *num_points,x3,y3); - *num_points = *num_points+1; - } -} - -// returns number of contours -static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata) -{ - stbtt__point *points=0; - int num_points=0; - - float objspace_flatness_squared = objspace_flatness * objspace_flatness; - int i,n=0,start=0, pass; - - // count how many "moves" there are to get the contour count - for (i=0; i < num_verts; ++i) - if (vertices[i].type == STBTT_vmove) - ++n; - - *num_contours = n; - if (n == 0) return 0; - - *contour_lengths = (int *) STBTT_malloc(sizeof(**contour_lengths) * n, userdata); - - if (*contour_lengths == 0) { - *num_contours = 0; - return 0; - } - - // make two passes through the points so we don't need to realloc - for (pass=0; pass < 2; ++pass) { - float x=0,y=0; - if (pass == 1) { - points = (stbtt__point *) STBTT_malloc(num_points * sizeof(points[0]), userdata); - if (points == NULL) goto error; - } - num_points = 0; - n= -1; - for (i=0; i < num_verts; ++i) { - switch (vertices[i].type) { - case STBTT_vmove: - // start the next contour - if (n >= 0) - (*contour_lengths)[n] = num_points - start; - ++n; - start = num_points; - - x = vertices[i].x, y = vertices[i].y; - stbtt__add_point(points, num_points++, x,y); - break; - case STBTT_vline: - x = vertices[i].x, y = vertices[i].y; - stbtt__add_point(points, num_points++, x, y); - break; - case STBTT_vcurve: - stbtt__tesselate_curve(points, &num_points, x,y, - vertices[i].cx, vertices[i].cy, - vertices[i].x, vertices[i].y, - objspace_flatness_squared, 0); - x = vertices[i].x, y = vertices[i].y; - break; - case STBTT_vcubic: - stbtt__tesselate_cubic(points, &num_points, x,y, - vertices[i].cx, vertices[i].cy, - vertices[i].cx1, vertices[i].cy1, - vertices[i].x, vertices[i].y, - objspace_flatness_squared, 0); - x = vertices[i].x, y = vertices[i].y; - break; - } - } - (*contour_lengths)[n] = num_points - start; - } - - return points; -error: - STBTT_free(points, userdata); - STBTT_free(*contour_lengths, userdata); - *contour_lengths = 0; - *num_contours = 0; - return NULL; -} - -STBTT_DEF void stbtt_Rasterize(stbtt__bitmap *result, float flatness_in_pixels, stbtt_vertex *vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, void *userdata) -{ - float scale = scale_x > scale_y ? scale_y : scale_x; - int winding_count = 0; - int *winding_lengths = NULL; - stbtt__point *windings = stbtt_FlattenCurves(vertices, num_verts, flatness_in_pixels / scale, &winding_lengths, &winding_count, userdata); - if (windings) { - stbtt__rasterize(result, windings, winding_lengths, winding_count, scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, userdata); - STBTT_free(winding_lengths, userdata); - STBTT_free(windings, userdata); - } -} - -STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata) -{ - STBTT_free(bitmap, userdata); -} - -STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int *width, int *height, int *xoff, int *yoff) -{ - int ix0,iy0,ix1,iy1; - stbtt__bitmap gbm; - stbtt_vertex *vertices; - int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - - if (scale_x == 0) scale_x = scale_y; - if (scale_y == 0) { - if (scale_x == 0) { - STBTT_free(vertices, info->userdata); - return NULL; - } - scale_y = scale_x; - } - - stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,&ix1,&iy1); - - // now we get the size - gbm.w = (ix1 - ix0); - gbm.h = (iy1 - iy0); - gbm.pixels = NULL; // in case we error - - if (width ) *width = gbm.w; - if (height) *height = gbm.h; - if (xoff ) *xoff = ix0; - if (yoff ) *yoff = iy0; - - if (gbm.w && gbm.h) { - gbm.pixels = (unsigned char *) STBTT_malloc(gbm.w * gbm.h, info->userdata); - if (gbm.pixels) { - gbm.stride = gbm.w; - - stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0, iy0, 1, info->userdata); - } - } - STBTT_free(vertices, info->userdata); - return gbm.pixels; -} - -STBTT_DEF unsigned char *stbtt_GetGlyphBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int glyph, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y, 0.0f, 0.0f, glyph, width, height, xoff, yoff); -} - -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph) -{ - int ix0,iy0; - stbtt_vertex *vertices; - int num_verts = stbtt_GetGlyphShape(info, glyph, &vertices); - stbtt__bitmap gbm; - - stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, shift_y, &ix0,&iy0,0,0); - gbm.pixels = output; - gbm.w = out_w; - gbm.h = out_h; - gbm.stride = out_stride; - - if (gbm.w && gbm.h) - stbtt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, shift_x, shift_y, ix0,iy0, 1, info->userdata); - - STBTT_free(vertices, info->userdata); -} - -STBTT_DEF void stbtt_MakeGlyphBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph) -{ - stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, glyph); -} - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmapSubpixel(const stbtt_fontinfo *info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetGlyphBitmapSubpixel(info, scale_x, scale_y,shift_x,shift_y, stbtt_FindGlyphIndex(info,codepoint), width,height,xoff,yoff); -} - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *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) -{ - stbtt_MakeGlyphBitmapSubpixelPrefilter(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, stbtt_FindGlyphIndex(info,codepoint)); -} - -STBTT_DEF void stbtt_MakeCodepointBitmapSubpixel(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) -{ - stbtt_MakeGlyphBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, stbtt_FindGlyphIndex(info,codepoint)); -} - -STBTT_DEF unsigned char *stbtt_GetCodepointBitmap(const stbtt_fontinfo *info, float scale_x, float scale_y, int codepoint, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetCodepointBitmapSubpixel(info, scale_x, scale_y, 0.0f,0.0f, codepoint, width,height,xoff,yoff); -} - -STBTT_DEF void stbtt_MakeCodepointBitmap(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) -{ - stbtt_MakeCodepointBitmapSubpixel(info, output, out_w, out_h, out_stride, scale_x, scale_y, 0.0f,0.0f, codepoint); -} - -////////////////////////////////////////////////////////////////////////////// -// -// bitmap baking -// -// This is SUPER-CRAPPY packing to keep source code small - -static int stbtt_BakeFontBitmap_internal(unsigned char *data, int offset, // font location (use offset=0 for plain .ttf) - float pixel_height, // height of font in pixels - unsigned char *pixels, int pw, int ph, // bitmap to be filled in - int first_char, int num_chars, // characters to bake - stbtt_bakedchar *chardata) -{ - float scale; - int x,y,bottom_y, i; - stbtt_fontinfo f; - f.userdata = NULL; - if (!stbtt_InitFont(&f, data, offset)) - return -1; - STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels - x=y=1; - bottom_y = 1; - - scale = stbtt_ScaleForPixelHeight(&f, pixel_height); - - for (i=0; i < num_chars; ++i) { - int advance, lsb, x0,y0,x1,y1,gw,gh; - int g = stbtt_FindGlyphIndex(&f, first_char + i); - stbtt_GetGlyphHMetrics(&f, g, &advance, &lsb); - stbtt_GetGlyphBitmapBox(&f, g, scale,scale, &x0,&y0,&x1,&y1); - gw = x1-x0; - gh = y1-y0; - if (x + gw + 1 >= pw) - y = bottom_y, x = 1; // advance to next row - if (y + gh + 1 >= ph) // check if it fits vertically AFTER potentially moving to next row - return -i; - STBTT_assert(x+gw < pw); - STBTT_assert(y+gh < ph); - stbtt_MakeGlyphBitmap(&f, pixels+x+y*pw, gw,gh,pw, scale,scale, g); - chardata[i].x0 = (stbtt_int16) x; - chardata[i].y0 = (stbtt_int16) y; - chardata[i].x1 = (stbtt_int16) (x + gw); - chardata[i].y1 = (stbtt_int16) (y + gh); - chardata[i].xadvance = scale * advance; - chardata[i].xoff = (float) x0; - chardata[i].yoff = (float) y0; - x = x + gw + 1; - if (y+gh+1 > bottom_y) - bottom_y = y+gh+1; - } - return bottom_y; -} - -STBTT_DEF void stbtt_GetBakedQuad(const stbtt_bakedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int opengl_fillrule) -{ - float d3d_bias = opengl_fillrule ? 0 : -0.5f; - float ipw = 1.0f / pw, iph = 1.0f / ph; - const stbtt_bakedchar *b = chardata + char_index; - int round_x = STBTT_ifloor((*xpos + b->xoff) + 0.5f); - int round_y = STBTT_ifloor((*ypos + b->yoff) + 0.5f); - - q->x0 = round_x + d3d_bias; - q->y0 = round_y + d3d_bias; - q->x1 = round_x + b->x1 - b->x0 + d3d_bias; - q->y1 = round_y + b->y1 - b->y0 + d3d_bias; - - q->s0 = b->x0 * ipw; - q->t0 = b->y0 * iph; - q->s1 = b->x1 * ipw; - q->t1 = b->y1 * iph; - - *xpos += b->xadvance; -} - -////////////////////////////////////////////////////////////////////////////// -// -// rectangle packing replacement routines if you don't have stb_rect_pack.h -// - -#ifndef STB_RECT_PACK_VERSION - -typedef int stbrp_coord; - -//////////////////////////////////////////////////////////////////////////////////// -// // -// // -// COMPILER WARNING ?!?!? // -// // -// // -// if you get a compile warning due to these symbols being defined more than // -// once, move #include "stb_rect_pack.h" before #include "stb_truetype.h" // -// // -//////////////////////////////////////////////////////////////////////////////////// - -typedef struct -{ - int width,height; - int x,y,bottom_y; -} stbrp_context; - -typedef struct -{ - unsigned char x; -} stbrp_node; - -struct stbrp_rect -{ - stbrp_coord x,y; - int id,w,h,was_packed; -}; - -static void stbrp_init_target(stbrp_context *con, int pw, int ph, stbrp_node *nodes, int num_nodes) -{ - con->width = pw; - con->height = ph; - con->x = 0; - con->y = 0; - con->bottom_y = 0; - STBTT__NOTUSED(nodes); - STBTT__NOTUSED(num_nodes); -} - -static void stbrp_pack_rects(stbrp_context *con, stbrp_rect *rects, int num_rects) -{ - int i; - for (i=0; i < num_rects; ++i) { - if (con->x + rects[i].w > con->width) { - con->x = 0; - con->y = con->bottom_y; - } - if (con->y + rects[i].h > con->height) - break; - rects[i].x = con->x; - rects[i].y = con->y; - rects[i].was_packed = 1; - con->x += rects[i].w; - if (con->y + rects[i].h > con->bottom_y) - con->bottom_y = con->y + rects[i].h; - } - for ( ; i < num_rects; ++i) - rects[i].was_packed = 0; -} -#endif - -////////////////////////////////////////////////////////////////////////////// -// -// bitmap baking -// -// This is SUPER-AWESOME (tm Ryan Gordon) packing using stb_rect_pack.h. If -// stb_rect_pack.h isn't available, it uses the BakeFontBitmap strategy. - -STBTT_DEF int stbtt_PackBegin(stbtt_pack_context *spc, unsigned char *pixels, int pw, int ph, int stride_in_bytes, int padding, void *alloc_context) -{ - stbrp_context *context = (stbrp_context *) STBTT_malloc(sizeof(*context) ,alloc_context); - int num_nodes = pw - padding; - stbrp_node *nodes = (stbrp_node *) STBTT_malloc(sizeof(*nodes ) * num_nodes,alloc_context); - - if (context == NULL || nodes == NULL) { - if (context != NULL) STBTT_free(context, alloc_context); - if (nodes != NULL) STBTT_free(nodes , alloc_context); - return 0; - } - - spc->user_allocator_context = alloc_context; - spc->width = pw; - spc->height = ph; - spc->pixels = pixels; - spc->pack_info = context; - spc->nodes = nodes; - spc->padding = padding; - spc->stride_in_bytes = stride_in_bytes != 0 ? stride_in_bytes : pw; - spc->h_oversample = 1; - spc->v_oversample = 1; - spc->skip_missing = 0; - - stbrp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); - - if (pixels) - STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels - - return 1; -} - -STBTT_DEF void stbtt_PackEnd (stbtt_pack_context *spc) -{ - STBTT_free(spc->nodes , spc->user_allocator_context); - STBTT_free(spc->pack_info, spc->user_allocator_context); -} - -STBTT_DEF void stbtt_PackSetOversampling(stbtt_pack_context *spc, unsigned int h_oversample, unsigned int v_oversample) -{ - STBTT_assert(h_oversample <= STBTT_MAX_OVERSAMPLE); - STBTT_assert(v_oversample <= STBTT_MAX_OVERSAMPLE); - if (h_oversample <= STBTT_MAX_OVERSAMPLE) - spc->h_oversample = h_oversample; - if (v_oversample <= STBTT_MAX_OVERSAMPLE) - spc->v_oversample = v_oversample; -} - -STBTT_DEF void stbtt_PackSetSkipMissingCodepoints(stbtt_pack_context *spc, int skip) -{ - spc->skip_missing = skip; -} - -#define STBTT__OVER_MASK (STBTT_MAX_OVERSAMPLE-1) - -static void stbtt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) -{ - unsigned char buffer[STBTT_MAX_OVERSAMPLE]; - int safe_w = w - kernel_width; - int j; - STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze - for (j=0; j < h; ++j) { - int i; - unsigned int total; - STBTT_memset(buffer, 0, kernel_width); - - total = 0; - - // make kernel_width a constant in common cases so compiler can optimize out the divide - switch (kernel_width) { - case 2: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 2); - } - break; - case 3: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 3); - } - break; - case 4: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 4); - } - break; - case 5: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 5); - } - break; - default: - for (i=0; i <= safe_w; ++i) { - total += pixels[i] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / kernel_width); - } - break; - } - - for (; i < w; ++i) { - STBTT_assert(pixels[i] == 0); - total -= buffer[i & STBTT__OVER_MASK]; - pixels[i] = (unsigned char) (total / kernel_width); - } - - pixels += stride_in_bytes; - } -} - -static void stbtt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, unsigned int kernel_width) -{ - unsigned char buffer[STBTT_MAX_OVERSAMPLE]; - int safe_h = h - kernel_width; - int j; - STBTT_memset(buffer, 0, STBTT_MAX_OVERSAMPLE); // suppress bogus warning from VS2013 -analyze - for (j=0; j < w; ++j) { - int i; - unsigned int total; - STBTT_memset(buffer, 0, kernel_width); - - total = 0; - - // make kernel_width a constant in common cases so compiler can optimize out the divide - switch (kernel_width) { - case 2: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 2); - } - break; - case 3: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 3); - } - break; - case 4: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 4); - } - break; - case 5: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 5); - } - break; - default: - for (i=0; i <= safe_h; ++i) { - total += pixels[i*stride_in_bytes] - buffer[i & STBTT__OVER_MASK]; - buffer[(i+kernel_width) & STBTT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); - } - break; - } - - for (; i < h; ++i) { - STBTT_assert(pixels[i*stride_in_bytes] == 0); - total -= buffer[i & STBTT__OVER_MASK]; - pixels[i*stride_in_bytes] = (unsigned char) (total / kernel_width); - } - - pixels += 1; - } -} - -static float stbtt__oversample_shift(int oversample) -{ - if (!oversample) - return 0.0f; - - // The prefilter is a box filter of width "oversample", - // which shifts phase by (oversample - 1)/2 pixels in - // oversampled space. We want to shift in the opposite - // direction to counter this. - return (float)-(oversample - 1) / (2.0f * (float)oversample); -} - -// rects array must be big enough to accommodate all characters in the given ranges -STBTT_DEF int stbtt_PackFontRangesGatherRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) -{ - int i,j,k; - int missing_glyph_added = 0; - - k=0; - for (i=0; i < num_ranges; ++i) { - float fh = ranges[i].font_size; - float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); - ranges[i].h_oversample = (unsigned char) spc->h_oversample; - ranges[i].v_oversample = (unsigned char) spc->v_oversample; - for (j=0; j < ranges[i].num_chars; ++j) { - int x0,y0,x1,y1; - int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; - int glyph = stbtt_FindGlyphIndex(info, codepoint); - if (glyph == 0 && (spc->skip_missing || missing_glyph_added)) { - rects[k].w = rects[k].h = 0; - } else { - stbtt_GetGlyphBitmapBoxSubpixel(info,glyph, - scale * spc->h_oversample, - scale * spc->v_oversample, - 0,0, - &x0,&y0,&x1,&y1); - rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1); - rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1); - if (glyph == 0) - missing_glyph_added = 1; - } - ++k; - } - } - - return k; -} - -STBTT_DEF void stbtt_MakeGlyphBitmapSubpixelPrefilter(const stbtt_fontinfo *info, unsigned char *output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int prefilter_x, int prefilter_y, float *sub_x, float *sub_y, int glyph) -{ - stbtt_MakeGlyphBitmapSubpixel(info, - output, - out_w - (prefilter_x - 1), - out_h - (prefilter_y - 1), - out_stride, - scale_x, - scale_y, - shift_x, - shift_y, - glyph); - - if (prefilter_x > 1) - stbtt__h_prefilter(output, out_w, out_h, out_stride, prefilter_x); - - if (prefilter_y > 1) - stbtt__v_prefilter(output, out_w, out_h, out_stride, prefilter_y); - - *sub_x = stbtt__oversample_shift(prefilter_x); - *sub_y = stbtt__oversample_shift(prefilter_y); -} - -// rects array must be big enough to accommodate all characters in the given ranges -STBTT_DEF int stbtt_PackFontRangesRenderIntoRects(stbtt_pack_context *spc, const stbtt_fontinfo *info, stbtt_pack_range *ranges, int num_ranges, stbrp_rect *rects) -{ - int i,j,k, missing_glyph = -1, return_value = 1; - - // save current values - int old_h_over = spc->h_oversample; - int old_v_over = spc->v_oversample; - - k = 0; - for (i=0; i < num_ranges; ++i) { - float fh = ranges[i].font_size; - float scale = fh > 0 ? stbtt_ScaleForPixelHeight(info, fh) : stbtt_ScaleForMappingEmToPixels(info, -fh); - float recip_h,recip_v,sub_x,sub_y; - spc->h_oversample = ranges[i].h_oversample; - spc->v_oversample = ranges[i].v_oversample; - recip_h = 1.0f / spc->h_oversample; - recip_v = 1.0f / spc->v_oversample; - sub_x = stbtt__oversample_shift(spc->h_oversample); - sub_y = stbtt__oversample_shift(spc->v_oversample); - for (j=0; j < ranges[i].num_chars; ++j) { - stbrp_rect *r = &rects[k]; - if (r->was_packed && r->w != 0 && r->h != 0) { - stbtt_packedchar *bc = &ranges[i].chardata_for_range[j]; - int advance, lsb, x0,y0,x1,y1; - int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j]; - int glyph = stbtt_FindGlyphIndex(info, codepoint); - stbrp_coord pad = (stbrp_coord) spc->padding; - - // pad on left and top - r->x += pad; - r->y += pad; - r->w -= pad; - r->h -= pad; - stbtt_GetGlyphHMetrics(info, glyph, &advance, &lsb); - stbtt_GetGlyphBitmapBox(info, glyph, - scale * spc->h_oversample, - scale * spc->v_oversample, - &x0,&y0,&x1,&y1); - stbtt_MakeGlyphBitmapSubpixel(info, - spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w - spc->h_oversample+1, - r->h - spc->v_oversample+1, - spc->stride_in_bytes, - scale * spc->h_oversample, - scale * spc->v_oversample, - 0,0, - glyph); - - if (spc->h_oversample > 1) - stbtt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w, r->h, spc->stride_in_bytes, - spc->h_oversample); - - if (spc->v_oversample > 1) - stbtt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w, r->h, spc->stride_in_bytes, - spc->v_oversample); - - bc->x0 = (stbtt_int16) r->x; - bc->y0 = (stbtt_int16) r->y; - bc->x1 = (stbtt_int16) (r->x + r->w); - bc->y1 = (stbtt_int16) (r->y + r->h); - bc->xadvance = scale * advance; - bc->xoff = (float) x0 * recip_h + sub_x; - bc->yoff = (float) y0 * recip_v + sub_y; - bc->xoff2 = (x0 + r->w) * recip_h + sub_x; - bc->yoff2 = (y0 + r->h) * recip_v + sub_y; - - if (glyph == 0) - missing_glyph = j; - } else if (spc->skip_missing) { - return_value = 0; - } else if (r->was_packed && r->w == 0 && r->h == 0 && missing_glyph >= 0) { - ranges[i].chardata_for_range[j] = ranges[i].chardata_for_range[missing_glyph]; - } else { - return_value = 0; // if any fail, report failure - } - - ++k; - } - } - - // restore original values - spc->h_oversample = old_h_over; - spc->v_oversample = old_v_over; - - return return_value; -} - -STBTT_DEF void stbtt_PackFontRangesPackRects(stbtt_pack_context *spc, stbrp_rect *rects, int num_rects) -{ - stbrp_pack_rects((stbrp_context *) spc->pack_info, rects, num_rects); -} - -STBTT_DEF int stbtt_PackFontRanges(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, stbtt_pack_range *ranges, int num_ranges) -{ - stbtt_fontinfo info; - int i,j,n, return_value = 1; - //stbrp_context *context = (stbrp_context *) spc->pack_info; - stbrp_rect *rects; - - // flag all characters as NOT packed - for (i=0; i < num_ranges; ++i) - for (j=0; j < ranges[i].num_chars; ++j) - ranges[i].chardata_for_range[j].x0 = - ranges[i].chardata_for_range[j].y0 = - ranges[i].chardata_for_range[j].x1 = - ranges[i].chardata_for_range[j].y1 = 0; - - n = 0; - for (i=0; i < num_ranges; ++i) - n += ranges[i].num_chars; - - rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context); - if (rects == NULL) - return 0; - - info.userdata = spc->user_allocator_context; - stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index)); - - n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects); - - stbtt_PackFontRangesPackRects(spc, rects, n); - - return_value = stbtt_PackFontRangesRenderIntoRects(spc, &info, ranges, num_ranges, rects); - - STBTT_free(rects, spc->user_allocator_context); - return return_value; -} - -STBTT_DEF int stbtt_PackFontRange(stbtt_pack_context *spc, const unsigned char *fontdata, int font_index, float font_size, - int first_unicode_codepoint_in_range, int num_chars_in_range, stbtt_packedchar *chardata_for_range) -{ - stbtt_pack_range range; - range.first_unicode_codepoint_in_range = first_unicode_codepoint_in_range; - range.array_of_unicode_codepoints = NULL; - range.num_chars = num_chars_in_range; - range.chardata_for_range = chardata_for_range; - range.font_size = font_size; - return stbtt_PackFontRanges(spc, fontdata, font_index, &range, 1); -} - -STBTT_DEF void stbtt_GetScaledFontVMetrics(const unsigned char *fontdata, int index, float size, float *ascent, float *descent, float *lineGap) -{ - int i_ascent, i_descent, i_lineGap; - float scale; - stbtt_fontinfo info; - stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata, index)); - scale = size > 0 ? stbtt_ScaleForPixelHeight(&info, size) : stbtt_ScaleForMappingEmToPixels(&info, -size); - stbtt_GetFontVMetrics(&info, &i_ascent, &i_descent, &i_lineGap); - *ascent = (float) i_ascent * scale; - *descent = (float) i_descent * scale; - *lineGap = (float) i_lineGap * scale; -} - -STBTT_DEF void stbtt_GetPackedQuad(const stbtt_packedchar *chardata, int pw, int ph, int char_index, float *xpos, float *ypos, stbtt_aligned_quad *q, int align_to_integer) -{ - float ipw = 1.0f / pw, iph = 1.0f / ph; - const stbtt_packedchar *b = chardata + char_index; - - if (align_to_integer) { - float x = (float) STBTT_ifloor((*xpos + b->xoff) + 0.5f); - float y = (float) STBTT_ifloor((*ypos + b->yoff) + 0.5f); - q->x0 = x; - q->y0 = y; - q->x1 = x + b->xoff2 - b->xoff; - q->y1 = y + b->yoff2 - b->yoff; - } else { - q->x0 = *xpos + b->xoff; - q->y0 = *ypos + b->yoff; - q->x1 = *xpos + b->xoff2; - q->y1 = *ypos + b->yoff2; - } - - q->s0 = b->x0 * ipw; - q->t0 = b->y0 * iph; - q->s1 = b->x1 * ipw; - q->t1 = b->y1 * iph; - - *xpos += b->xadvance; -} - -////////////////////////////////////////////////////////////////////////////// -// -// sdf computation -// - -#define STBTT_min(a,b) ((a) < (b) ? (a) : (b)) -#define STBTT_max(a,b) ((a) < (b) ? (b) : (a)) - -static int stbtt__ray_intersect_bezier(float orig[2], float ray[2], float q0[2], float q1[2], float q2[2], float hits[2][2]) -{ - float q0perp = q0[1]*ray[0] - q0[0]*ray[1]; - float q1perp = q1[1]*ray[0] - q1[0]*ray[1]; - float q2perp = q2[1]*ray[0] - q2[0]*ray[1]; - float roperp = orig[1]*ray[0] - orig[0]*ray[1]; - - float a = q0perp - 2*q1perp + q2perp; - float b = q1perp - q0perp; - float c = q0perp - roperp; - - float s0 = 0., s1 = 0.; - int num_s = 0; - - if (a != 0.0) { - float discr = b*b - a*c; - if (discr > 0.0) { - float rcpna = -1 / a; - float d = (float) STBTT_sqrt(discr); - s0 = (b+d) * rcpna; - s1 = (b-d) * rcpna; - if (s0 >= 0.0 && s0 <= 1.0) - num_s = 1; - if (d > 0.0 && s1 >= 0.0 && s1 <= 1.0) { - if (num_s == 0) s0 = s1; - ++num_s; - } - } - } else { - // 2*b*s + c = 0 - // s = -c / (2*b) - s0 = c / (-2 * b); - if (s0 >= 0.0 && s0 <= 1.0) - num_s = 1; - } - - if (num_s == 0) - return 0; - else { - float rcp_len2 = 1 / (ray[0]*ray[0] + ray[1]*ray[1]); - float rayn_x = ray[0] * rcp_len2, rayn_y = ray[1] * rcp_len2; - - float q0d = q0[0]*rayn_x + q0[1]*rayn_y; - float q1d = q1[0]*rayn_x + q1[1]*rayn_y; - float q2d = q2[0]*rayn_x + q2[1]*rayn_y; - float rod = orig[0]*rayn_x + orig[1]*rayn_y; - - float q10d = q1d - q0d; - float q20d = q2d - q0d; - float q0rd = q0d - rod; - - hits[0][0] = q0rd + s0*(2.0f - 2.0f*s0)*q10d + s0*s0*q20d; - hits[0][1] = a*s0+b; - - if (num_s > 1) { - hits[1][0] = q0rd + s1*(2.0f - 2.0f*s1)*q10d + s1*s1*q20d; - hits[1][1] = a*s1+b; - return 2; - } else { - return 1; - } - } -} - -static int equal(float *a, float *b) -{ - return (a[0] == b[0] && a[1] == b[1]); -} - -static int stbtt__compute_crossings_x(float x, float y, int nverts, stbtt_vertex *verts) -{ - int i; - float orig[2], ray[2] = { 1, 0 }; - float y_frac; - int winding = 0; - - // make sure y never passes through a vertex of the shape - y_frac = (float) STBTT_fmod(y, 1.0f); - if (y_frac < 0.01f) - y += 0.01f; - else if (y_frac > 0.99f) - y -= 0.01f; - - orig[0] = x; - orig[1] = y; - - // test a ray from (-infinity,y) to (x,y) - for (i=0; i < nverts; ++i) { - if (verts[i].type == STBTT_vline) { - int x0 = (int) verts[i-1].x, y0 = (int) verts[i-1].y; - int x1 = (int) verts[i ].x, y1 = (int) verts[i ].y; - if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { - float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; - if (x_inter < x) - winding += (y0 < y1) ? 1 : -1; - } - } - if (verts[i].type == STBTT_vcurve) { - int x0 = (int) verts[i-1].x , y0 = (int) verts[i-1].y ; - int x1 = (int) verts[i ].cx, y1 = (int) verts[i ].cy; - int x2 = (int) verts[i ].x , y2 = (int) verts[i ].y ; - int ax = STBTT_min(x0,STBTT_min(x1,x2)), ay = STBTT_min(y0,STBTT_min(y1,y2)); - int by = STBTT_max(y0,STBTT_max(y1,y2)); - if (y > ay && y < by && x > ax) { - float q0[2],q1[2],q2[2]; - float hits[2][2]; - q0[0] = (float)x0; - q0[1] = (float)y0; - q1[0] = (float)x1; - q1[1] = (float)y1; - q2[0] = (float)x2; - q2[1] = (float)y2; - if (equal(q0,q1) || equal(q1,q2)) { - x0 = (int)verts[i-1].x; - y0 = (int)verts[i-1].y; - x1 = (int)verts[i ].x; - y1 = (int)verts[i ].y; - if (y > STBTT_min(y0,y1) && y < STBTT_max(y0,y1) && x > STBTT_min(x0,x1)) { - float x_inter = (y - y0) / (y1 - y0) * (x1-x0) + x0; - if (x_inter < x) - winding += (y0 < y1) ? 1 : -1; - } - } else { - int num_hits = stbtt__ray_intersect_bezier(orig, ray, q0, q1, q2, hits); - if (num_hits >= 1) - if (hits[0][0] < 0) - winding += (hits[0][1] < 0 ? -1 : 1); - if (num_hits >= 2) - if (hits[1][0] < 0) - winding += (hits[1][1] < 0 ? -1 : 1); - } - } - } - } - return winding; -} - -static float stbtt__cuberoot( float x ) -{ - if (x<0) - return -(float) STBTT_pow(-x,1.0f/3.0f); - else - return (float) STBTT_pow( x,1.0f/3.0f); -} - -// x^3 + a*x^2 + b*x + c = 0 -static int stbtt__solve_cubic(float a, float b, float c, float* r) -{ - float s = -a / 3; - float p = b - a*a / 3; - float q = a * (2*a*a - 9*b) / 27 + c; - float p3 = p*p*p; - float d = q*q + 4*p3 / 27; - if (d >= 0) { - float z = (float) STBTT_sqrt(d); - float u = (-q + z) / 2; - float v = (-q - z) / 2; - u = stbtt__cuberoot(u); - v = stbtt__cuberoot(v); - r[0] = s + u + v; - return 1; - } else { - float u = (float) STBTT_sqrt(-p/3); - float v = (float) STBTT_acos(-STBTT_sqrt(-27/p3) * q / 2) / 3; // p3 must be negative, since d is negative - float m = (float) STBTT_cos(v); - float n = (float) STBTT_cos(v-3.141592/2)*1.732050808f; - r[0] = s + u * 2 * m; - r[1] = s - u * (m + n); - r[2] = s - u * (m - n); - - //STBTT_assert( STBTT_fabs(((r[0]+a)*r[0]+b)*r[0]+c) < 0.05f); // these asserts may not be safe at all scales, though they're in bezier t parameter units so maybe? - //STBTT_assert( STBTT_fabs(((r[1]+a)*r[1]+b)*r[1]+c) < 0.05f); - //STBTT_assert( STBTT_fabs(((r[2]+a)*r[2]+b)*r[2]+c) < 0.05f); - return 3; - } -} - -STBTT_DEF unsigned char * stbtt_GetGlyphSDF(const stbtt_fontinfo *info, float scale, int glyph, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) -{ - float scale_x = scale, scale_y = scale; - int ix0,iy0,ix1,iy1; - int w,h; - unsigned char *data; - - if (scale == 0) return NULL; - - stbtt_GetGlyphBitmapBoxSubpixel(info, glyph, scale, scale, 0.0f,0.0f, &ix0,&iy0,&ix1,&iy1); - - // if empty, return NULL - if (ix0 == ix1 || iy0 == iy1) - return NULL; - - ix0 -= padding; - iy0 -= padding; - ix1 += padding; - iy1 += padding; - - w = (ix1 - ix0); - h = (iy1 - iy0); - - if (width ) *width = w; - if (height) *height = h; - if (xoff ) *xoff = ix0; - if (yoff ) *yoff = iy0; - - // invert for y-downwards bitmaps - scale_y = -scale_y; - - { - int x,y,i,j; - float *precompute; - stbtt_vertex *verts; - int num_verts = stbtt_GetGlyphShape(info, glyph, &verts); - data = (unsigned char *) STBTT_malloc(w * h, info->userdata); - precompute = (float *) STBTT_malloc(num_verts * sizeof(float), info->userdata); - - for (i=0,j=num_verts-1; i < num_verts; j=i++) { - if (verts[i].type == STBTT_vline) { - float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; - float x1 = verts[j].x*scale_x, y1 = verts[j].y*scale_y; - float dist = (float) STBTT_sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0)); - precompute[i] = (dist == 0) ? 0.0f : 1.0f / dist; - } else if (verts[i].type == STBTT_vcurve) { - float x2 = verts[j].x *scale_x, y2 = verts[j].y *scale_y; - float x1 = verts[i].cx*scale_x, y1 = verts[i].cy*scale_y; - float x0 = verts[i].x *scale_x, y0 = verts[i].y *scale_y; - float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; - float len2 = bx*bx + by*by; - if (len2 != 0.0f) - precompute[i] = 1.0f / (bx*bx + by*by); - else - precompute[i] = 0.0f; - } else - precompute[i] = 0.0f; - } - - for (y=iy0; y < iy1; ++y) { - for (x=ix0; x < ix1; ++x) { - float val; - float min_dist = 999999.0f; - float sx = (float) x + 0.5f; - float sy = (float) y + 0.5f; - float x_gspace = (sx / scale_x); - float y_gspace = (sy / scale_y); - - int winding = stbtt__compute_crossings_x(x_gspace, y_gspace, num_verts, verts); // @OPTIMIZE: this could just be a rasterization, but needs to be line vs. non-tesselated curves so a new path - - for (i=0; i < num_verts; ++i) { - float x0 = verts[i].x*scale_x, y0 = verts[i].y*scale_y; - - if (verts[i].type == STBTT_vline && precompute[i] != 0.0f) { - float x1 = verts[i-1].x*scale_x, y1 = verts[i-1].y*scale_y; - - float dist,dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy); - if (dist2 < min_dist*min_dist) - min_dist = (float) STBTT_sqrt(dist2); - - // coarse culling against bbox - //if (sx > STBTT_min(x0,x1)-min_dist && sx < STBTT_max(x0,x1)+min_dist && - // sy > STBTT_min(y0,y1)-min_dist && sy < STBTT_max(y0,y1)+min_dist) - dist = (float) STBTT_fabs((x1-x0)*(y0-sy) - (y1-y0)*(x0-sx)) * precompute[i]; - STBTT_assert(i != 0); - if (dist < min_dist) { - // check position along line - // x' = x0 + t*(x1-x0), y' = y0 + t*(y1-y0) - // minimize (x'-sx)*(x'-sx)+(y'-sy)*(y'-sy) - float dx = x1-x0, dy = y1-y0; - float px = x0-sx, py = y0-sy; - // minimize (px+t*dx)^2 + (py+t*dy)^2 = px*px + 2*px*dx*t + t^2*dx*dx + py*py + 2*py*dy*t + t^2*dy*dy - // derivative: 2*px*dx + 2*py*dy + (2*dx*dx+2*dy*dy)*t, set to 0 and solve - float t = -(px*dx + py*dy) / (dx*dx + dy*dy); - if (t >= 0.0f && t <= 1.0f) - min_dist = dist; - } - } else if (verts[i].type == STBTT_vcurve) { - float x2 = verts[i-1].x *scale_x, y2 = verts[i-1].y *scale_y; - float x1 = verts[i ].cx*scale_x, y1 = verts[i ].cy*scale_y; - float box_x0 = STBTT_min(STBTT_min(x0,x1),x2); - float box_y0 = STBTT_min(STBTT_min(y0,y1),y2); - float box_x1 = STBTT_max(STBTT_max(x0,x1),x2); - float box_y1 = STBTT_max(STBTT_max(y0,y1),y2); - // coarse culling against bbox to avoid computing cubic unnecessarily - if (sx > box_x0-min_dist && sx < box_x1+min_dist && sy > box_y0-min_dist && sy < box_y1+min_dist) { - int num=0; - float ax = x1-x0, ay = y1-y0; - float bx = x0 - 2*x1 + x2, by = y0 - 2*y1 + y2; - float mx = x0 - sx, my = y0 - sy; - float res[3] = {0.f,0.f,0.f}; - float px,py,t,it,dist2; - float a_inv = precompute[i]; - if (a_inv == 0.0) { // if a_inv is 0, it's 2nd degree so use quadratic formula - float a = 3*(ax*bx + ay*by); - float b = 2*(ax*ax + ay*ay) + (mx*bx+my*by); - float c = mx*ax+my*ay; - if (a == 0.0) { // if a is 0, it's linear - if (b != 0.0) { - res[num++] = -c/b; - } - } else { - float discriminant = b*b - 4*a*c; - if (discriminant < 0) - num = 0; - else { - float root = (float) STBTT_sqrt(discriminant); - res[0] = (-b - root)/(2*a); - res[1] = (-b + root)/(2*a); - num = 2; // don't bother distinguishing 1-solution case, as code below will still work - } - } - } else { - float b = 3*(ax*bx + ay*by) * a_inv; // could precompute this as it doesn't depend on sample point - float c = (2*(ax*ax + ay*ay) + (mx*bx+my*by)) * a_inv; - float d = (mx*ax+my*ay) * a_inv; - num = stbtt__solve_cubic(b, c, d, res); - } - dist2 = (x0-sx)*(x0-sx) + (y0-sy)*(y0-sy); - if (dist2 < min_dist*min_dist) - min_dist = (float) STBTT_sqrt(dist2); - - if (num >= 1 && res[0] >= 0.0f && res[0] <= 1.0f) { - t = res[0], it = 1.0f - t; - px = it*it*x0 + 2*t*it*x1 + t*t*x2; - py = it*it*y0 + 2*t*it*y1 + t*t*y2; - dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); - if (dist2 < min_dist * min_dist) - min_dist = (float) STBTT_sqrt(dist2); - } - if (num >= 2 && res[1] >= 0.0f && res[1] <= 1.0f) { - t = res[1], it = 1.0f - t; - px = it*it*x0 + 2*t*it*x1 + t*t*x2; - py = it*it*y0 + 2*t*it*y1 + t*t*y2; - dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); - if (dist2 < min_dist * min_dist) - min_dist = (float) STBTT_sqrt(dist2); - } - if (num >= 3 && res[2] >= 0.0f && res[2] <= 1.0f) { - t = res[2], it = 1.0f - t; - px = it*it*x0 + 2*t*it*x1 + t*t*x2; - py = it*it*y0 + 2*t*it*y1 + t*t*y2; - dist2 = (px-sx)*(px-sx) + (py-sy)*(py-sy); - if (dist2 < min_dist * min_dist) - min_dist = (float) STBTT_sqrt(dist2); - } - } - } - } - if (winding == 0) - min_dist = -min_dist; // if outside the shape, value is negative - val = onedge_value + pixel_dist_scale * min_dist; - if (val < 0) - val = 0; - else if (val > 255) - val = 255; - data[(y-iy0)*w+(x-ix0)] = (unsigned char) val; - } - } - STBTT_free(precompute, info->userdata); - STBTT_free(verts, info->userdata); - } - return data; -} - -STBTT_DEF unsigned char * stbtt_GetCodepointSDF(const stbtt_fontinfo *info, float scale, int codepoint, int padding, unsigned char onedge_value, float pixel_dist_scale, int *width, int *height, int *xoff, int *yoff) -{ - return stbtt_GetGlyphSDF(info, scale, stbtt_FindGlyphIndex(info, codepoint), padding, onedge_value, pixel_dist_scale, width, height, xoff, yoff); -} - -STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata) -{ - STBTT_free(bitmap, userdata); -} - -////////////////////////////////////////////////////////////////////////////// -// -// font name matching -- recommended not to use this -// - -// check if a utf8 string contains a prefix which is the utf16 string; if so return length of matching utf8 string -static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) -{ - stbtt_int32 i=0; - - // convert utf16 to utf8 and compare the results while converting - while (len2) { - stbtt_uint16 ch = s2[0]*256 + s2[1]; - if (ch < 0x80) { - if (i >= len1) return -1; - if (s1[i++] != ch) return -1; - } else if (ch < 0x800) { - if (i+1 >= len1) return -1; - if (s1[i++] != 0xc0 + (ch >> 6)) return -1; - if (s1[i++] != 0x80 + (ch & 0x3f)) return -1; - } else if (ch >= 0xd800 && ch < 0xdc00) { - stbtt_uint32 c; - stbtt_uint16 ch2 = s2[2]*256 + s2[3]; - if (i+3 >= len1) return -1; - c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000; - if (s1[i++] != 0xf0 + (c >> 18)) return -1; - if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((c >> 6) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((c ) & 0x3f)) return -1; - s2 += 2; // plus another 2 below - len2 -= 2; - } else if (ch >= 0xdc00 && ch < 0xe000) { - return -1; - } else { - if (i+2 >= len1) return -1; - if (s1[i++] != 0xe0 + (ch >> 12)) return -1; - if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1; - if (s1[i++] != 0x80 + ((ch ) & 0x3f)) return -1; - } - s2 += 2; - len2 -= 2; - } - return i; -} - -static int stbtt_CompareUTF8toUTF16_bigendian_internal(char *s1, int len1, char *s2, int len2) -{ - return len1 == stbtt__CompareUTF8toUTF16_bigendian_prefix((stbtt_uint8*) s1, len1, (stbtt_uint8*) s2, len2); -} - -// returns results in whatever encoding you request... but note that 2-byte encodings -// will be BIG-ENDIAN... use stbtt_CompareUTF8toUTF16_bigendian() to compare -STBTT_DEF const char *stbtt_GetFontNameString(const stbtt_fontinfo *font, int *length, int platformID, int encodingID, int languageID, int nameID) -{ - stbtt_int32 i,count,stringOffset; - stbtt_uint8 *fc = font->data; - stbtt_uint32 offset = font->fontstart; - stbtt_uint32 nm = stbtt__find_table(fc, offset, "name"); - if (!nm) return NULL; - - count = ttUSHORT(fc+nm+2); - stringOffset = nm + ttUSHORT(fc+nm+4); - for (i=0; i < count; ++i) { - stbtt_uint32 loc = nm + 6 + 12 * i; - if (platformID == ttUSHORT(fc+loc+0) && encodingID == ttUSHORT(fc+loc+2) - && languageID == ttUSHORT(fc+loc+4) && nameID == ttUSHORT(fc+loc+6)) { - *length = ttUSHORT(fc+loc+8); - return (const char *) (fc+stringOffset+ttUSHORT(fc+loc+10)); - } - } - return NULL; -} - -static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id) -{ - stbtt_int32 i; - stbtt_int32 count = ttUSHORT(fc+nm+2); - stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4); - - for (i=0; i < count; ++i) { - stbtt_uint32 loc = nm + 6 + 12 * i; - stbtt_int32 id = ttUSHORT(fc+loc+6); - if (id == target_id) { - // find the encoding - stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4); - - // is this a Unicode encoding? - if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) { - stbtt_int32 slen = ttUSHORT(fc+loc+8); - stbtt_int32 off = ttUSHORT(fc+loc+10); - - // check if there's a prefix match - stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen); - if (matchlen >= 0) { - // check for target_id+1 immediately following, with same encoding & language - if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) { - slen = ttUSHORT(fc+loc+12+8); - off = ttUSHORT(fc+loc+12+10); - if (slen == 0) { - if (matchlen == nlen) - return 1; - } else if (matchlen < nlen && name[matchlen] == ' ') { - ++matchlen; - if (stbtt_CompareUTF8toUTF16_bigendian_internal((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen)) - return 1; - } - } else { - // if nothing immediately following - if (matchlen == nlen) - return 1; - } - } - } - - // @TODO handle other encodings - } - } - return 0; -} - -static int stbtt__matches(stbtt_uint8 *fc, stbtt_uint32 offset, stbtt_uint8 *name, stbtt_int32 flags) -{ - stbtt_int32 nlen = (stbtt_int32) STBTT_strlen((char *) name); - stbtt_uint32 nm,hd; - if (!stbtt__isfont(fc+offset)) return 0; - - // check italics/bold/underline flags in macStyle... - if (flags) { - hd = stbtt__find_table(fc, offset, "head"); - if ((ttUSHORT(fc+hd+44) & 7) != (flags & 7)) return 0; - } - - nm = stbtt__find_table(fc, offset, "name"); - if (!nm) return 0; - - if (flags) { - // if we checked the macStyle flags, then just check the family and ignore the subfamily - if (stbtt__matchpair(fc, nm, name, nlen, 16, -1)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 1, -1)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; - } else { - if (stbtt__matchpair(fc, nm, name, nlen, 16, 17)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 1, 2)) return 1; - if (stbtt__matchpair(fc, nm, name, nlen, 3, -1)) return 1; - } - - return 0; -} - -static int stbtt_FindMatchingFont_internal(unsigned char *font_collection, char *name_utf8, stbtt_int32 flags) -{ - stbtt_int32 i; - for (i=0;;++i) { - stbtt_int32 off = stbtt_GetFontOffsetForIndex(font_collection, i); - if (off < 0) return off; - if (stbtt__matches((stbtt_uint8 *) font_collection, off, (stbtt_uint8*) name_utf8, flags)) - return off; - } -} - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-qual" -#endif - -STBTT_DEF int stbtt_BakeFontBitmap(const unsigned char *data, int offset, - float pixel_height, unsigned char *pixels, int pw, int ph, - int first_char, int num_chars, stbtt_bakedchar *chardata) -{ - return stbtt_BakeFontBitmap_internal((unsigned char *) data, offset, pixel_height, pixels, pw, ph, first_char, num_chars, chardata); -} - -STBTT_DEF int stbtt_GetFontOffsetForIndex(const unsigned char *data, int index) -{ - return stbtt_GetFontOffsetForIndex_internal((unsigned char *) data, index); -} - -STBTT_DEF int stbtt_GetNumberOfFonts(const unsigned char *data) -{ - return stbtt_GetNumberOfFonts_internal((unsigned char *) data); -} - -STBTT_DEF int stbtt_InitFont(stbtt_fontinfo *info, const unsigned char *data, int offset) -{ - return stbtt_InitFont_internal(info, (unsigned char *) data, offset); -} - -STBTT_DEF int stbtt_FindMatchingFont(const unsigned char *fontdata, const char *name, int flags) -{ - return stbtt_FindMatchingFont_internal((unsigned char *) fontdata, (char *) name, flags); -} - -STBTT_DEF int stbtt_CompareUTF8toUTF16_bigendian(const char *s1, int len1, const char *s2, int len2) -{ - return stbtt_CompareUTF8toUTF16_bigendian_internal((char *) s1, len1, (char *) s2, len2); -} - -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - -#endif // STB_TRUETYPE_IMPLEMENTATION - - -// FULL VERSION HISTORY -// -// 1.25 (2021-07-11) many fixes -// 1.24 (2020-02-05) fix warning -// 1.23 (2020-02-02) query SVG data for glyphs; query whole kerning table (but only kern not GPOS) -// 1.22 (2019-08-11) minimize missing-glyph duplication; fix kerning if both 'GPOS' and 'kern' are defined -// 1.21 (2019-02-25) fix warning -// 1.20 (2019-02-07) PackFontRange skips missing codepoints; GetScaleFontVMetrics() -// 1.19 (2018-02-11) OpenType GPOS kerning (horizontal only), STBTT_fmod -// 1.18 (2018-01-29) add missing function -// 1.17 (2017-07-23) make more arguments const; doc fix -// 1.16 (2017-07-12) SDF support -// 1.15 (2017-03-03) make more arguments const -// 1.14 (2017-01-16) num-fonts-in-TTC function -// 1.13 (2017-01-02) support OpenType fonts, certain Apple fonts -// 1.12 (2016-10-25) suppress warnings about casting away const with -Wcast-qual -// 1.11 (2016-04-02) fix unused-variable warning -// 1.10 (2016-04-02) allow user-defined fabs() replacement -// fix memory leak if fontsize=0.0 -// fix warning from duplicate typedef -// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges -// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges -// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints; -// allow PackFontRanges to pack and render in separate phases; -// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?); -// fixed an assert() bug in the new rasterizer -// replace assert() with STBTT_assert() in new rasterizer -// 1.06 (2015-07-14) performance improvements (~35% faster on x86 and x64 on test machine) -// also more precise AA rasterizer, except if shapes overlap -// remove need for STBTT_sort -// 1.05 (2015-04-15) fix misplaced definitions for STBTT_STATIC -// 1.04 (2015-04-15) typo in example -// 1.03 (2015-04-12) STBTT_STATIC, fix memory leak in new packing, various fixes -// 1.02 (2014-12-10) fix various warnings & compile issues w/ stb_rect_pack, C++ -// 1.01 (2014-12-08) fix subpixel position when oversampling to exactly match -// non-oversampled; STBTT_POINT_SIZE for packed case only -// 1.00 (2014-12-06) add new PackBegin etc. API, w/ support for oversampling -// 0.99 (2014-09-18) fix multiple bugs with subpixel rendering (ryg) -// 0.9 (2014-08-07) support certain mac/iOS fonts without an MS platformID -// 0.8b (2014-07-07) fix a warning -// 0.8 (2014-05-25) fix a few more warnings -// 0.7 (2013-09-25) bugfix: subpixel glyph bug fixed in 0.5 had come back -// 0.6c (2012-07-24) improve documentation -// 0.6b (2012-07-20) fix a few more warnings -// 0.6 (2012-07-17) fix warnings; added stbtt_ScaleForMappingEmToPixels, -// stbtt_GetFontBoundingBox, stbtt_IsGlyphEmpty -// 0.5 (2011-12-09) bugfixes: -// subpixel glyph renderer computed wrong bounding box -// first vertex of shape can be off-curve (FreeSans) -// 0.4b (2011-12-03) fixed an error in the font baking example -// 0.4 (2011-12-01) kerning, subpixel rendering (tor) -// bugfixes for: -// codepoint-to-glyph conversion using table fmt=12 -// codepoint-to-glyph conversion using table fmt=4 -// stbtt_GetBakedQuad with non-square texture (Zer) -// updated Hello World! sample to use kerning and subpixel -// fixed some warnings -// 0.3 (2009-06-24) cmap fmt=12, compound shapes (MM) -// userdata, malloc-from-userdata, non-zero fill (stb) -// 0.2 (2009-03-11) Fix unsigned/signed char warnings -// 0.1 (2009-03-09) First public release -// - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/stb/stb_vorbis.c b/FCLauncher/src/main/jni/lwjgl/stb/stb_vorbis.c deleted file mode 100644 index 3e5c2504..00000000 --- a/FCLauncher/src/main/jni/lwjgl/stb/stb_vorbis.c +++ /dev/null @@ -1,5584 +0,0 @@ -// Ogg Vorbis audio decoder - v1.22 - public domain -// http://nothings.org/stb_vorbis/ -// -// Original version written by Sean Barrett in 2007. -// -// Originally sponsored by RAD Game Tools. Seeking implementation -// sponsored by Phillip Bennefall, Marc Andersen, Aaron Baker, -// Elias Software, Aras Pranckevicius, and Sean Barrett. -// -// LICENSE -// -// See end of file for license information. -// -// 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) -// -// Feature contributors: -// Dougall Johnson (sample-exact seeking) -// -// Bugfix/warning contributors: -// Terje Mathisen Niklas Frykholm Andy Hill -// Casey Muratori John Bolton Gargaj -// Laurent Gomila Marc LeBlanc Ronny Chevalier -// Bernhard Wodo Evan Balster github:alxprd -// Tom Beaumont Ingo Leitgeb Nicolas Guillemot -// Phillip Bennefall Rohit Thiago Goulart -// github:manxorist Saga Musix github:infatum -// Timur Gagiev Maxwell Koo Peter Waller -// github:audinowho Dougall Johnson David Reid -// github:Clownacy Pedro J. Estebanez Remi Verschelde -// AnthoFoxo github:morlat Gabriel Ravier -// -// Partial history: -// 1.22 - 2021-07-11 - various small fixes -// 1.21 - 2021-07-02 - fix bug for files with no comments -// 1.20 - 2020-07-11 - several small fixes -// 1.19 - 2020-02-05 - warnings -// 1.18 - 2020-02-02 - fix seek bugs; parse header comments; misc warnings etc. -// 1.17 - 2019-07-08 - fix CVE-2019-13217..CVE-2019-13223 (by ForAllSecure) -// 1.16 - 2019-03-04 - fix warnings -// 1.15 - 2019-02-07 - explicit failure if Ogg Skeleton data is found -// 1.14 - 2018-02-11 - delete bogus dealloca usage -// 1.13 - 2018-01-29 - fix truncation of last frame (hopefully) -// 1.12 - 2017-11-21 - limit residue begin/end to blocksize/2 to avoid large temp allocs in bad/corrupt files -// 1.11 - 2017-07-23 - fix MinGW compilation -// 1.10 - 2017-03-03 - more robust seeking; fix negative ilog(); clear error in open_memory -// 1.09 - 2016-04-04 - back out 'truncation of last frame' fix from previous version -// 1.08 - 2016-04-02 - warnings; setup memory leaks; truncation of last frame -// 1.07 - 2015-01-16 - fixes for crashes on invalid files; warning fixes; const -// 1.06 - 2015-08-31 - full, correct support for seeking API (Dougall Johnson) -// some crash fixes when out of memory or with corrupt files -// fix some inappropriately signed shifts -// 1.05 - 2015-04-19 - don't define __forceinline if it's redundant -// 1.04 - 2014-08-27 - fix missing const-correct case in API -// 1.03 - 2014-08-07 - warning fixes -// 1.02 - 2014-07-09 - declare qsort comparison as explicitly _cdecl in Windows -// 1.01 - 2014-06-18 - fix stb_vorbis_get_samples_float (interleaved was correct) -// 1.0 - 2014-05-26 - fix memory leaks; fix warnings; fix bugs in >2-channel; -// (API change) report sample rate for decode-full-file funcs -// -// See end of file for full version history. - - -////////////////////////////////////////////////////////////////////////////// -// -// HEADER BEGINS HERE -// - -#ifndef STB_VORBIS_INCLUDE_STB_VORBIS_H -#define STB_VORBIS_INCLUDE_STB_VORBIS_H - -#if defined(STB_VORBIS_NO_CRT) && !defined(STB_VORBIS_NO_STDIO) -#define STB_VORBIS_NO_STDIO 1 -#endif - -#ifndef STB_VORBIS_NO_STDIO -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/////////// 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 -// stb_vorbis* handles and decode from them independently in multiple thrads. - - -/////////// MEMORY ALLOCATION - -// normally stb_vorbis uses malloc() to allocate memory at startup, -// and alloca() to allocate temporary memory during a frame on the -// stack. (Memory consumption will depend on the amount of setup -// data in the file and how you set the compile flags for speed -// vs. size. In my test files the maximal-size usage is ~150KB.) -// -// You can modify the wrapper functions in the source (setup_malloc, -// setup_temp_malloc, temp_malloc) to change this behavior, or you -// can use a simpler allocation model: you pass in a buffer from -// which stb_vorbis will allocate _all_ its memory (including the -// temp memory). "open" may fail with a VORBIS_outofmem if you -// do not pass in enough data; there is no way to determine how -// much you do need except to succeed (at which point you can -// query get_info to find the exact amount required. yes I know -// this is lame). -// -// If you pass in a non-NULL buffer of the type below, allocation -// will occur from it as described above. Otherwise just pass NULL -// to use malloc()/alloca() - -typedef struct -{ - char *alloc_buffer; - int alloc_buffer_length_in_bytes; -} stb_vorbis_alloc; - - -/////////// FUNCTIONS USEABLE WITH ALL INPUT MODES - -typedef struct stb_vorbis stb_vorbis; - -typedef struct -{ - 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; -} stb_vorbis_info; - -typedef struct -{ - char *vendor; - - int comment_list_length; - char **comment_list; -} stb_vorbis_comment; - -// get general information about the file -extern stb_vorbis_info stb_vorbis_get_info(stb_vorbis *f); - -// get ogg comments -extern stb_vorbis_comment stb_vorbis_get_comment(stb_vorbis *f); - -// get the last error detected (clears it, too) -extern int stb_vorbis_get_error(stb_vorbis *f); - -// close an ogg vorbis file and free all memory in use -extern void stb_vorbis_close(stb_vorbis *f); - -// this function 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 flush_pushdata() call, this may take a while before -// it becomes valid again. -// NOT WORKING YET after a seek with PULLDATA API -extern int stb_vorbis_get_sample_offset(stb_vorbis *f); - -// returns the current seek point within the file, or offset from the beginning -// of the memory buffer. In pushdata mode it returns 0. -extern unsigned int stb_vorbis_get_file_offset(stb_vorbis *f); - -/////////// PUSHDATA API - -#ifndef STB_VORBIS_NO_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. - -extern stb_vorbis *stb_vorbis_open_pushdata( - const unsigned char * datablock, int datablock_length_in_bytes, - int *datablock_memory_consumed_in_bytes, - int *error, - const stb_vorbis_alloc *alloc_buffer); -// create 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) -// on success, returns an stb_vorbis *, does not set error, returns the amount of -// data parsed/consumed on this call in *datablock_memory_consumed_in_bytes; -// on failure, returns NULL on error and sets *error, does not change *datablock_memory_consumed -// if returns NULL and *error is VORBIS_need_more_data, then the input block was -// incomplete and you need to pass in a larger block from the start of the file - -extern int stb_vorbis_decode_frame_pushdata( - stb_vorbis *f, - const unsigned char *datablock, int datablock_length_in_bytes, - int *channels, // place to write number of float * buffers - float ***output, // place to write float ** array of float * buffers - int *samples // place to write number of output samples - ); -// decode a frame of audio sample data if possible from the passed-in data block -// -// return value: 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. -// -// Note that on resynch, stb_vorbis will rarely consume all of the buffer, -// instead only 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 -// NULL--it is always the same as the number of channels reported by -// get_info). *output will contain an array of float* buffers, one per -// channel. In other words, (*output)[0][0] contains the first sample from -// the first channel, and (*output)[1][0] contains the first sample from -// the second channel. -// -// *output points into stb_vorbis's internal output buffer storage; these -// buffers are owned by stb_vorbis and application code should not free -// them or modify their contents. They are transient and will be overwritten -// once you ask for more data to get decoded, so be sure to grab any data -// you need before then. - -extern void stb_vorbis_flush_pushdata(stb_vorbis *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 stb_vorbis_get_sample_offset, and -// if you don't like the result, seek your file again and repeat. -#endif - - -////////// PULLING INPUT API - -#ifndef STB_VORBIS_NO_PULLDATA_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.) - -#if !defined(STB_VORBIS_NO_STDIO) && !defined(STB_VORBIS_NO_INTEGER_CONVERSION) -extern int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output); -#endif -#if !defined(STB_VORBIS_NO_INTEGER_CONVERSION) -extern int stb_vorbis_decode_memory(const unsigned char *mem, int len, int *channels, int *sample_rate, short **output); -#endif -// decode an entire file and output the data interleaved into a malloc()ed -// buffer stored in *output. The return value is the number of samples -// decoded, or -1 if the file could not be opened or was not an ogg vorbis file. -// When you're done with it, just free() the pointer returned in *output. - -extern stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, - int *error, const stb_vorbis_alloc *alloc_buffer); -// create an ogg vorbis decoder from an ogg vorbis stream in memory (note -// this must be the entire stream!). on failure, returns NULL and sets *error - -#ifndef STB_VORBIS_NO_STDIO -extern stb_vorbis * stb_vorbis_open_filename(const char *filename, - int *error, const stb_vorbis_alloc *alloc_buffer); -// create an ogg vorbis decoder from a filename via fopen(). on failure, -// returns NULL and sets *error (possibly to VORBIS_file_open_failure). - -extern stb_vorbis * stb_vorbis_open_file(FILE *f, int close_handle_on_close, - int *error, const stb_vorbis_alloc *alloc_buffer); -// create an ogg vorbis decoder from an open FILE *, looking for a stream at -// the _current_ seek point (ftell). on failure, returns NULL and sets *error. -// note that stb_vorbis must "own" this stream; if you seek it in between -// calls to stb_vorbis, it will become confused. Moreover, if you attempt to -// perform stb_vorbis_seek_*() operations on this file, it will assume it -// owns the _entire_ rest of the file after the start point. Use the next -// function, stb_vorbis_open_file_section(), to limit it. - -extern stb_vorbis * stb_vorbis_open_file_section(FILE *f, int close_handle_on_close, - int *error, const stb_vorbis_alloc *alloc_buffer, unsigned int len); -// create an ogg vorbis decoder from an open FILE *, looking for a stream at -// the _current_ seek point (ftell); the stream will be of length 'len' bytes. -// on failure, returns NULL and sets *error. note that stb_vorbis must "own" -// this stream; if you seek it in between calls to stb_vorbis, it will become -// confused. -#endif - -extern int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number); -extern int stb_vorbis_seek(stb_vorbis *f, unsigned int sample_number); -// these functions seek in the Vorbis file to (approximately) 'sample_number'. -// after calling seek_frame(), the next call to get_frame_*() will include -// the specified sample. after calling stb_vorbis_seek(), the next call to -// stb_vorbis_get_samples_* will start with the specified sample. If you -// do not need to seek to EXACTLY the target sample when using get_samples_*, -// you can also use seek_frame(). - -extern int stb_vorbis_seek_start(stb_vorbis *f); -// this function is equivalent to stb_vorbis_seek(f,0) - -extern unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f); -extern float stb_vorbis_stream_length_in_seconds(stb_vorbis *f); -// these functions return the total length of the vorbis stream - -extern int stb_vorbis_get_frame_float(stb_vorbis *f, int *channels, float ***output); -// decode the next frame and return the number of samples. the number of -// channels returned are stored in *channels (which can be NULL--it is always -// the same as the number of channels reported by get_info). *output will -// contain an array of float* buffers, one per channel. These outputs will -// be overwritten on the next call to stb_vorbis_get_frame_*. -// -// You generally should not intermix calls to stb_vorbis_get_frame_*() -// and stb_vorbis_get_samples_*(), since the latter calls the former. - -#ifndef STB_VORBIS_NO_INTEGER_CONVERSION -extern int stb_vorbis_get_frame_short_interleaved(stb_vorbis *f, int num_c, short *buffer, int num_shorts); -extern int stb_vorbis_get_frame_short (stb_vorbis *f, int num_c, short **buffer, int num_samples); -#endif -// decode the next frame and return 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 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. - -extern int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats); -extern int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples); -// gets 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. -// Returns 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. - -#ifndef STB_VORBIS_NO_INTEGER_CONVERSION -extern int stb_vorbis_get_samples_short_interleaved(stb_vorbis *f, int channels, short *buffer, int num_shorts); -extern int stb_vorbis_get_samples_short(stb_vorbis *f, int channels, short **buffer, int num_samples); -#endif -// gets 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 'channels' channels. Returns 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. - -#endif - -//////// ERROR CODES - -enum STBVorbisError -{ - VORBIS__no_error, - - VORBIS_need_more_data=1, // not a real error - - VORBIS_invalid_api_mixing, // can't mix API modes - VORBIS_outofmem, // not enough memory - VORBIS_feature_not_supported, // uses floor 0 - VORBIS_too_many_channels, // STB_VORBIS_MAX_CHANNELS is too small - VORBIS_file_open_failure, // fopen() failed - VORBIS_seek_without_length, // can't seek in unknown-length file - - VORBIS_unexpected_eof=10, // file is truncated? - VORBIS_seek_invalid, // seek past EOF - - // decoding errors (corrupt/invalid stream) -- you probably - // don't care about the exact details of these - - // vorbis errors: - VORBIS_invalid_setup=20, - VORBIS_invalid_stream, - - // ogg errors: - VORBIS_missing_capture_pattern=30, - VORBIS_invalid_stream_structure_version, - VORBIS_continued_packet_flag_invalid, - VORBIS_incorrect_stream_serial_number, - VORBIS_invalid_first_page, - VORBIS_bad_packet_type, - VORBIS_cant_find_last_page, - VORBIS_seek_failed, - VORBIS_ogg_skeleton_not_supported -}; - - -#ifdef __cplusplus -} -#endif - -#endif // STB_VORBIS_INCLUDE_STB_VORBIS_H -// -// HEADER ENDS HERE -// -////////////////////////////////////////////////////////////////////////////// - -#ifndef STB_VORBIS_HEADER_ONLY - -// global configuration settings (e.g. set these in the project/makefile), -// or just set them in this file at the top (although ideally the first few -// should be visible when the header file is compiled too, although it's not -// crucial) - -// STB_VORBIS_NO_PUSHDATA_API -// does not compile the code for the various stb_vorbis_*_pushdata() -// functions -// #define STB_VORBIS_NO_PUSHDATA_API - -// STB_VORBIS_NO_PULLDATA_API -// does not compile the code for the non-pushdata APIs -// #define STB_VORBIS_NO_PULLDATA_API - -// STB_VORBIS_NO_STDIO -// does not compile the code for the APIs that use FILE *s internally -// or externally (implied by STB_VORBIS_NO_PULLDATA_API) -// #define STB_VORBIS_NO_STDIO - -// STB_VORBIS_NO_INTEGER_CONVERSION -// does not compile the code for converting audio sample data from -// float to integer (implied by STB_VORBIS_NO_PULLDATA_API) -// #define STB_VORBIS_NO_INTEGER_CONVERSION - -// STB_VORBIS_NO_FAST_SCALED_FLOAT -// does not use a fast float-to-int trick to accelerate float-to-int on -// most platforms which requires endianness be defined correctly. -//#define STB_VORBIS_NO_FAST_SCALED_FLOAT - - -// STB_VORBIS_MAX_CHANNELS [number] -// globally define this to the maximum number of channels you need. -// The spec does not put a restriction on channels except that -// the count is stored in a byte, so 255 is the hard limit. -// Reducing this saves about 16 bytes per value, so using 16 saves -// (255-16)*16 or around 4KB. Plus anything other memory usage -// I forgot to account for. Can probably go as low as 8 (7.1 audio), -// 6 (5.1 audio), or 2 (stereo only). -#ifndef STB_VORBIS_MAX_CHANNELS -#define STB_VORBIS_MAX_CHANNELS 16 // enough for anyone? -#endif - -// STB_VORBIS_PUSHDATA_CRC_COUNT [number] -// after a flush_pushdata(), stb_vorbis begins scanning for the -// next valid page, without backtracking. when it finds something -// that looks like a page, it streams through it and verifies its -// CRC32. Should that validation fail, it keeps scanning. But it's -// possible that _while_ streaming through to check the CRC32 of -// one candidate page, it sees another candidate page. This #define -// determines how many "overlapping" candidate pages it can search -// at once. Note that "real" pages are typically ~4KB to ~8KB, whereas -// garbage pages could be as big as 64KB, but probably average ~16KB. -// So don't hose ourselves by scanning an apparent 64KB page and -// missing a ton of real ones in the interim; so minimum of 2 -#ifndef STB_VORBIS_PUSHDATA_CRC_COUNT -#define STB_VORBIS_PUSHDATA_CRC_COUNT 4 -#endif - -// STB_VORBIS_FAST_HUFFMAN_LENGTH [number] -// sets the log size of the huffman-acceleration table. Maximum -// supported value is 24. with larger numbers, more decodings are O(1), -// but the table size is larger so worse cache missing, so you'll have -// to probe (and try multiple ogg vorbis files) to find the sweet spot. -#ifndef STB_VORBIS_FAST_HUFFMAN_LENGTH -#define STB_VORBIS_FAST_HUFFMAN_LENGTH 10 -#endif - -// STB_VORBIS_FAST_BINARY_LENGTH [number] -// sets the log size of the binary-search acceleration table. this -// is used in similar fashion to the fast-huffman size to set initial -// parameters for the binary search - -// STB_VORBIS_FAST_HUFFMAN_INT -// The fast huffman tables are much more efficient if they can be -// stored as 16-bit results instead of 32-bit results. This restricts -// the codebooks to having only 65535 possible outcomes, though. -// (At least, accelerated by the huffman table.) -#ifndef STB_VORBIS_FAST_HUFFMAN_INT -#define STB_VORBIS_FAST_HUFFMAN_SHORT -#endif - -// STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH -// If the 'fast huffman' search doesn't succeed, then stb_vorbis falls -// back on binary searching for the correct one. This requires storing -// extra tables with the huffman codes in sorted order. Defining this -// symbol trades off space for speed by forcing a linear search in the -// non-fast case, except for "sparse" codebooks. -// #define STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH - -// STB_VORBIS_DIVIDES_IN_RESIDUE -// stb_vorbis precomputes the result of the scalar residue decoding -// that would otherwise require a divide per chunk. you can trade off -// space for time by defining this symbol. -// #define STB_VORBIS_DIVIDES_IN_RESIDUE - -// STB_VORBIS_DIVIDES_IN_CODEBOOK -// vorbis VQ codebooks can be encoded two ways: with every case explicitly -// stored, or with all elements being chosen from a small range of values, -// and all values possible in all elements. By default, stb_vorbis expands -// this latter kind out to look like the former kind for ease of decoding, -// because otherwise an integer divide-per-vector-element is required to -// unpack the index. If you define STB_VORBIS_DIVIDES_IN_CODEBOOK, you can -// trade off storage for speed. -//#define STB_VORBIS_DIVIDES_IN_CODEBOOK - -#ifdef STB_VORBIS_CODEBOOK_SHORTS -#error "STB_VORBIS_CODEBOOK_SHORTS is no longer supported as it produced incorrect results for some input formats" -#endif - -// STB_VORBIS_DIVIDE_TABLE -// this replaces small integer divides in the floor decode loop with -// table lookups. made less than 1% difference, so disabled by default. - -// STB_VORBIS_NO_INLINE_DECODE -// disables the inlining of the scalar codebook fast-huffman decode. -// might save a little codespace; useful for debugging -// #define STB_VORBIS_NO_INLINE_DECODE - -// STB_VORBIS_NO_DEFER_FLOOR -// Normally we only decode the floor without synthesizing the actual -// full curve. We can instead synthesize the curve immediately. This -// requires more memory and is very likely slower, so I don't think -// you'd ever want to do it except for debugging. -// #define STB_VORBIS_NO_DEFER_FLOOR - - - - -////////////////////////////////////////////////////////////////////////////// - -#ifdef STB_VORBIS_NO_PULLDATA_API - #define STB_VORBIS_NO_INTEGER_CONVERSION - #define STB_VORBIS_NO_STDIO -#endif - -#if defined(STB_VORBIS_NO_CRT) && !defined(STB_VORBIS_NO_STDIO) - #define STB_VORBIS_NO_STDIO 1 -#endif - -#ifndef STB_VORBIS_NO_INTEGER_CONVERSION -#ifndef STB_VORBIS_NO_FAST_SCALED_FLOAT - - // only need endianness for fast-float-to-int, which we don't - // use for pushdata - - #ifndef STB_VORBIS_BIG_ENDIAN - #define STB_VORBIS_ENDIAN 0 - #else - #define STB_VORBIS_ENDIAN 1 - #endif - -#endif -#endif - - -#ifndef STB_VORBIS_NO_STDIO -#include -#endif - -#ifndef STB_VORBIS_NO_CRT - #include - #include - #include - #include - - // find definition of alloca if it's not in stdlib.h: - #if defined(_MSC_VER) || defined(__MINGW32__) - #include - #endif - #if defined(__linux__) || defined(__linux) || defined(__sun__) || defined(__EMSCRIPTEN__) || defined(__NEWLIB__) - #include - #endif -#else // STB_VORBIS_NO_CRT - #define NULL 0 - #define malloc(s) 0 - #define free(s) ((void) 0) - #define realloc(s) 0 -#endif // STB_VORBIS_NO_CRT - -#include - -#ifdef __MINGW32__ - // eff you mingw: - // "fixed": - // http://sourceforge.net/p/mingw-w64/mailman/message/32882927/ - // "no that broke the build, reverted, who cares about C": - // http://sourceforge.net/p/mingw-w64/mailman/message/32890381/ - #ifdef __forceinline - #undef __forceinline - #endif - #define __forceinline - #ifndef alloca - #define alloca __builtin_alloca - #endif -#elif !defined(_MSC_VER) - #if __GNUC__ - #define __forceinline inline - #else - #define __forceinline - #endif -#endif - -#if STB_VORBIS_MAX_CHANNELS > 256 -#error "Value of STB_VORBIS_MAX_CHANNELS outside of allowed range" -#endif - -#if STB_VORBIS_FAST_HUFFMAN_LENGTH > 24 -#error "Value of STB_VORBIS_FAST_HUFFMAN_LENGTH outside of allowed range" -#endif - - -#if 0 -#include -#define CHECK(f) _CrtIsValidHeapPointer(f->channel_buffers[1]) -#else -#define CHECK(f) ((void) 0) -#endif - -#define MAX_BLOCKSIZE_LOG 13 // from specification -#define MAX_BLOCKSIZE (1 << MAX_BLOCKSIZE_LOG) - - -typedef unsigned char uint8; -typedef signed char int8; -typedef unsigned short uint16; -typedef signed short int16; -typedef unsigned int uint32; -typedef signed int int32; - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -typedef float codetype; - -#ifdef _MSC_VER -#define STBV_NOTUSED(v) (void)(v) -#else -#define STBV_NOTUSED(v) (void)sizeof(v) -#endif - -// @NOTE -// -// Some arrays below are tagged "//varies", which means it's actually -// a variable-sized piece of data, but rather than malloc I assume it's -// small enough it's better to just allocate it all together with the -// main thing -// -// Most of the variables are specified with the smallest size I could pack -// them into. It might give better performance to make them all full-sized -// integers. It should be safe to freely rearrange the structures or change -// the sizes larger--nothing relies on silently truncating etc., nor the -// order of variables. - -#define FAST_HUFFMAN_TABLE_SIZE (1 << STB_VORBIS_FAST_HUFFMAN_LENGTH) -#define FAST_HUFFMAN_TABLE_MASK (FAST_HUFFMAN_TABLE_SIZE - 1) - -typedef struct -{ - int dimensions, entries; - uint8 *codeword_lengths; - float minimum_value; - float delta_value; - uint8 value_bits; - uint8 lookup_type; - uint8 sequence_p; - uint8 sparse; - uint32 lookup_values; - codetype *multiplicands; - uint32 *codewords; - #ifdef STB_VORBIS_FAST_HUFFMAN_SHORT - int16 fast_huffman[FAST_HUFFMAN_TABLE_SIZE]; - #else - int32 fast_huffman[FAST_HUFFMAN_TABLE_SIZE]; - #endif - uint32 *sorted_codewords; - int *sorted_values; - int sorted_entries; -} Codebook; - -typedef struct -{ - uint8 order; - uint16 rate; - uint16 bark_map_size; - uint8 amplitude_bits; - uint8 amplitude_offset; - uint8 number_of_books; - uint8 book_list[16]; // varies -} Floor0; - -typedef struct -{ - uint8 partitions; - uint8 partition_class_list[32]; // varies - uint8 class_dimensions[16]; // varies - uint8 class_subclasses[16]; // varies - uint8 class_masterbooks[16]; // varies - int16 subclass_books[16][8]; // varies - uint16 Xlist[31*8+2]; // varies - uint8 sorted_order[31*8+2]; - uint8 neighbors[31*8+2][2]; - uint8 floor1_multiplier; - uint8 rangebits; - int values; -} Floor1; - -typedef union -{ - Floor0 floor0; - Floor1 floor1; -} Floor; - -typedef struct -{ - uint32 begin, end; - uint32 part_size; - uint8 classifications; - uint8 classbook; - uint8 **classdata; - int16 (*residue_books)[8]; -} Residue; - -typedef struct -{ - uint8 magnitude; - uint8 angle; - uint8 mux; -} MappingChannel; - -typedef struct -{ - uint16 coupling_steps; - MappingChannel *chan; - uint8 submaps; - uint8 submap_floor[15]; // varies - uint8 submap_residue[15]; // varies -} Mapping; - -typedef struct -{ - uint8 blockflag; - uint8 mapping; - uint16 windowtype; - uint16 transformtype; -} Mode; - -typedef struct -{ - uint32 goal_crc; // expected crc if match - int bytes_left; // bytes left in packet - uint32 crc_so_far; // running crc - int bytes_done; // bytes processed in _current_ chunk - uint32 sample_loc; // granule pos encoded in page -} CRCscan; - -typedef struct -{ - uint32 page_start, page_end; - uint32 last_decoded_sample; -} ProbedPage; - -struct stb_vorbis -{ - // user-accessible info - unsigned int sample_rate; - int channels; - - unsigned int setup_memory_required; - unsigned int temp_memory_required; - unsigned int setup_temp_memory_required; - - char *vendor; - int comment_list_length; - char **comment_list; - - // input config -#ifndef STB_VORBIS_NO_STDIO - FILE *f; - uint32 f_start; - int close_on_free; -#endif - - uint8 *stream; - uint8 *stream_start; - uint8 *stream_end; - - uint32 stream_len; - - uint8 push_mode; - - // the page to seek to when seeking to start, may be zero - uint32 first_audio_page_offset; - - // p_first is the page on which the first audio packet ends - // (but not necessarily the page on which it starts) - ProbedPage p_first, p_last; - - // memory management - stb_vorbis_alloc alloc; - int setup_offset; - int temp_offset; - - // run-time results - int eof; - enum STBVorbisError error; - - // user-useful data - - // header info - int blocksize[2]; - int blocksize_0, blocksize_1; - int codebook_count; - Codebook *codebooks; - int floor_count; - uint16 floor_types[64]; // varies - Floor *floor_config; - int residue_count; - uint16 residue_types[64]; // varies - Residue *residue_config; - int mapping_count; - Mapping *mapping; - int mode_count; - Mode mode_config[64]; // varies - - uint32 total_samples; - - // decode buffer - float *channel_buffers[STB_VORBIS_MAX_CHANNELS]; - float *outputs [STB_VORBIS_MAX_CHANNELS]; - - float *previous_window[STB_VORBIS_MAX_CHANNELS]; - int previous_length; - - #ifndef STB_VORBIS_NO_DEFER_FLOOR - int16 *finalY[STB_VORBIS_MAX_CHANNELS]; - #else - float *floor_buffers[STB_VORBIS_MAX_CHANNELS]; - #endif - - uint32 current_loc; // sample location of next frame to decode - int current_loc_valid; - - // per-blocksize precomputed data - - // twiddle factors - float *A[2],*B[2],*C[2]; - float *window[2]; - uint16 *bit_reverse[2]; - - // current page/packet/segment streaming info - uint32 serial; // stream serial number for verification - int last_page; - int segment_count; - uint8 segments[255]; - uint8 page_flag; - uint8 bytes_in_seg; - uint8 first_decode; - int next_seg; - int last_seg; // flag that we're on the last segment - int last_seg_which; // what was the segment number of the last seg? - uint32 acc; - int valid_bits; - int packet_bytes; - int end_seg_with_known_loc; - uint32 known_loc_for_packet; - int discard_samples_deferred; - uint32 samples_output; - - // push mode scanning - int page_crc_tests; // only in push_mode: number of tests active; -1 if not searching -#ifndef STB_VORBIS_NO_PUSHDATA_API - CRCscan scan[STB_VORBIS_PUSHDATA_CRC_COUNT]; -#endif - - // sample-access - int channel_buffer_start; - int channel_buffer_end; -}; - -#if defined(STB_VORBIS_NO_PUSHDATA_API) - #define IS_PUSH_MODE(f) FALSE -#elif defined(STB_VORBIS_NO_PULLDATA_API) - #define IS_PUSH_MODE(f) TRUE -#else - #define IS_PUSH_MODE(f) ((f)->push_mode) -#endif - -typedef struct stb_vorbis vorb; - -static int error(vorb *f, enum STBVorbisError e) -{ - f->error = e; - if (!f->eof && e != VORBIS_need_more_data) { - f->error=e; // breakpoint for debugging - } - return 0; -} - - -// these functions are used for allocating temporary memory -// while decoding. if you can afford the stack space, use -// alloca(); otherwise, provide a temp buffer and it will -// allocate out of those. - -#define array_size_required(count,size) (count*(sizeof(void *)+(size))) - -#define temp_alloc(f,size) (f->alloc.alloc_buffer ? setup_temp_malloc(f,size) : alloca(size)) -#define temp_free(f,p) (void)0 -#define temp_alloc_save(f) ((f)->temp_offset) -#define temp_alloc_restore(f,p) ((f)->temp_offset = (p)) - -#define temp_block_array(f,count,size) make_block_array(temp_alloc(f,array_size_required(count,size)), count, size) - -// given a sufficiently large block of memory, make an array of pointers to subblocks of it -static void *make_block_array(void *mem, int count, int size) -{ - int i; - void ** p = (void **) mem; - char *q = (char *) (p + count); - for (i=0; i < count; ++i) { - p[i] = q; - q += size; - } - return p; -} - -static void *setup_malloc(vorb *f, int sz) -{ - sz = (sz+7) & ~7; // round up to nearest 8 for alignment of future allocs. - f->setup_memory_required += sz; - if (f->alloc.alloc_buffer) { - void *p = (char *) f->alloc.alloc_buffer + f->setup_offset; - if (f->setup_offset + sz > f->temp_offset) return NULL; - f->setup_offset += sz; - return p; - } - return sz ? malloc(sz) : NULL; -} - -static void setup_free(vorb *f, void *p) -{ - if (f->alloc.alloc_buffer) return; // do nothing; setup mem is a stack - free(p); -} - -static void *setup_temp_malloc(vorb *f, int sz) -{ - sz = (sz+7) & ~7; // round up to nearest 8 for alignment of future allocs. - if (f->alloc.alloc_buffer) { - if (f->temp_offset - sz < f->setup_offset) return NULL; - f->temp_offset -= sz; - return (char *) f->alloc.alloc_buffer + f->temp_offset; - } - return malloc(sz); -} - -static void setup_temp_free(vorb *f, void *p, int sz) -{ - if (f->alloc.alloc_buffer) { - f->temp_offset += (sz+7)&~7; - return; - } - free(p); -} - -#define CRC32_POLY 0x04c11db7 // from spec - -static uint32 crc_table[256]; -static void crc32_init(void) -{ - int i,j; - uint32 s; - for(i=0; i < 256; i++) { - for (s=(uint32) i << 24, j=0; j < 8; ++j) - s = (s << 1) ^ (s >= (1U<<31) ? CRC32_POLY : 0); - crc_table[i] = s; - } -} - -static __forceinline uint32 crc32_update(uint32 crc, uint8 byte) -{ - return (crc << 8) ^ crc_table[byte ^ (crc >> 24)]; -} - - -// used in setup, and for huffman that doesn't go fast path -static unsigned int bit_reverse(unsigned int n) -{ - n = ((n & 0xAAAAAAAA) >> 1) | ((n & 0x55555555) << 1); - n = ((n & 0xCCCCCCCC) >> 2) | ((n & 0x33333333) << 2); - n = ((n & 0xF0F0F0F0) >> 4) | ((n & 0x0F0F0F0F) << 4); - n = ((n & 0xFF00FF00) >> 8) | ((n & 0x00FF00FF) << 8); - return (n >> 16) | (n << 16); -} - -static float square(float x) -{ - return x*x; -} - -// this is a weird definition of log2() for which log2(1) = 1, log2(2) = 2, log2(4) = 3 -// as required by the specification. fast(?) implementation from stb.h -// @OPTIMIZE: called multiple times per-packet with "constants"; move to setup -static int ilog(int32 n) -{ - static signed char log2_4[16] = { 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4 }; - - if (n < 0) return 0; // signed n returns 0 - - // 2 compares if n < 16, 3 compares otherwise (4 if signed or n > 1<<29) - if (n < (1 << 14)) - if (n < (1 << 4)) return 0 + log2_4[n ]; - else if (n < (1 << 9)) return 5 + log2_4[n >> 5]; - else return 10 + log2_4[n >> 10]; - else if (n < (1 << 24)) - if (n < (1 << 19)) return 15 + log2_4[n >> 15]; - else return 20 + log2_4[n >> 20]; - else if (n < (1 << 29)) return 25 + log2_4[n >> 25]; - else return 30 + log2_4[n >> 30]; -} - -#ifndef M_PI - #define M_PI 3.14159265358979323846264f // from CRC -#endif - -// code length assigned to a value with no huffman encoding -#define NO_CODE 255 - -/////////////////////// LEAF SETUP FUNCTIONS ////////////////////////// -// -// these functions are only called at setup, and only a few times -// per file - -static float float32_unpack(uint32 x) -{ - // from the specification - uint32 mantissa = x & 0x1fffff; - uint32 sign = x & 0x80000000; - uint32 exp = (x & 0x7fe00000) >> 21; - double res = sign ? -(double)mantissa : (double)mantissa; - return (float) ldexp((float)res, (int)exp-788); -} - - -// zlib & jpeg huffman tables assume that the output symbols -// can either be arbitrarily arranged, or have monotonically -// increasing frequencies--they rely on the lengths being sorted; -// this makes for a very simple generation algorithm. -// vorbis allows a huffman table with non-sorted lengths. This -// requires a more sophisticated construction, since symbols in -// order do not map to huffman codes "in order". -static void add_entry(Codebook *c, uint32 huff_code, int symbol, int count, int len, uint32 *values) -{ - if (!c->sparse) { - c->codewords [symbol] = huff_code; - } else { - c->codewords [count] = huff_code; - c->codeword_lengths[count] = len; - values [count] = symbol; - } -} - -static int compute_codewords(Codebook *c, uint8 *len, int n, uint32 *values) -{ - int i,k,m=0; - uint32 available[32]; - - memset(available, 0, sizeof(available)); - // find the first entry - for (k=0; k < n; ++k) if (len[k] < NO_CODE) break; - if (k == n) { assert(c->sorted_entries == 0); return TRUE; } - assert(len[k] < 32); // no error return required, code reading lens checks this - // add to the list - add_entry(c, 0, k, m++, len[k], values); - // add all available leaves - for (i=1; i <= len[k]; ++i) - available[i] = 1U << (32-i); - // note that the above code treats the first case specially, - // but it's really the same as the following code, so they - // could probably be combined (except the initial code is 0, - // and I use 0 in available[] to mean 'empty') - for (i=k+1; i < n; ++i) { - uint32 res; - int z = len[i], y; - if (z == NO_CODE) continue; - assert(z < 32); // no error return required, code reading lens checks this - // find lowest available leaf (should always be earliest, - // which is what the specification calls for) - // note that this property, and the fact we can never have - // more than one free leaf at a given level, isn't totally - // trivial to prove, but it seems true and the assert never - // fires, so! - while (z > 0 && !available[z]) --z; - if (z == 0) { return FALSE; } - res = available[z]; - available[z] = 0; - add_entry(c, bit_reverse(res), i, m++, len[i], values); - // propagate availability up the tree - if (z != len[i]) { - for (y=len[i]; y > z; --y) { - assert(available[y] == 0); - available[y] = res + (1 << (32-y)); - } - } - } - return TRUE; -} - -// accelerated huffman table allows fast O(1) match of all symbols -// of length <= STB_VORBIS_FAST_HUFFMAN_LENGTH -static void compute_accelerated_huffman(Codebook *c) -{ - int i, len; - for (i=0; i < FAST_HUFFMAN_TABLE_SIZE; ++i) - c->fast_huffman[i] = -1; - - len = c->sparse ? c->sorted_entries : c->entries; - #ifdef STB_VORBIS_FAST_HUFFMAN_SHORT - if (len > 32767) len = 32767; // largest possible value we can encode! - #endif - for (i=0; i < len; ++i) { - if (c->codeword_lengths[i] <= STB_VORBIS_FAST_HUFFMAN_LENGTH) { - uint32 z = c->sparse ? bit_reverse(c->sorted_codewords[i]) : c->codewords[i]; - // set table entries for all bit combinations in the higher bits - while (z < FAST_HUFFMAN_TABLE_SIZE) { - c->fast_huffman[z] = i; - z += 1 << c->codeword_lengths[i]; - } - } - } -} - -#ifdef _MSC_VER -#define STBV_CDECL __cdecl -#else -#define STBV_CDECL -#endif - -static int STBV_CDECL uint32_compare(const void *p, const void *q) -{ - uint32 x = * (uint32 *) p; - uint32 y = * (uint32 *) q; - return x < y ? -1 : x > y; -} - -static int include_in_sort(Codebook *c, uint8 len) -{ - if (c->sparse) { assert(len != NO_CODE); return TRUE; } - if (len == NO_CODE) return FALSE; - if (len > STB_VORBIS_FAST_HUFFMAN_LENGTH) return TRUE; - return FALSE; -} - -// if the fast table above doesn't work, we want to binary -// search them... need to reverse the bits -static void compute_sorted_huffman(Codebook *c, uint8 *lengths, uint32 *values) -{ - int i, len; - // build a list of all the entries - // OPTIMIZATION: don't include the short ones, since they'll be caught by FAST_HUFFMAN. - // this is kind of a frivolous optimization--I don't see any performance improvement, - // but it's like 4 extra lines of code, so. - if (!c->sparse) { - int k = 0; - for (i=0; i < c->entries; ++i) - if (include_in_sort(c, lengths[i])) - c->sorted_codewords[k++] = bit_reverse(c->codewords[i]); - assert(k == c->sorted_entries); - } else { - for (i=0; i < c->sorted_entries; ++i) - c->sorted_codewords[i] = bit_reverse(c->codewords[i]); - } - - qsort(c->sorted_codewords, c->sorted_entries, sizeof(c->sorted_codewords[0]), uint32_compare); - c->sorted_codewords[c->sorted_entries] = 0xffffffff; - - len = c->sparse ? c->sorted_entries : c->entries; - // now we need to indicate how they correspond; we could either - // #1: sort a different data structure that says who they correspond to - // #2: for each sorted entry, search the original list to find who corresponds - // #3: for each original entry, find the sorted entry - // #1 requires extra storage, #2 is slow, #3 can use binary search! - for (i=0; i < len; ++i) { - int huff_len = c->sparse ? lengths[values[i]] : lengths[i]; - if (include_in_sort(c,huff_len)) { - uint32 code = bit_reverse(c->codewords[i]); - int x=0, n=c->sorted_entries; - while (n > 1) { - // invariant: sc[x] <= code < sc[x+n] - int m = x + (n >> 1); - if (c->sorted_codewords[m] <= code) { - x = m; - n -= (n>>1); - } else { - n >>= 1; - } - } - assert(c->sorted_codewords[x] == code); - if (c->sparse) { - c->sorted_values[x] = values[i]; - c->codeword_lengths[x] = huff_len; - } else { - c->sorted_values[x] = i; - } - } - } -} - -// only run while parsing the header (3 times) -static int vorbis_validate(uint8 *data) -{ - static uint8 vorbis[6] = { 'v', 'o', 'r', 'b', 'i', 's' }; - return memcmp(data, vorbis, 6) == 0; -} - -// called from setup only, once per code book -// (formula implied by specification) -static int lookup1_values(int entries, int dim) -{ - int r = (int) floor(exp((float) log((float) entries) / dim)); - if ((int) floor(pow((float) r+1, dim)) <= entries) // (int) cast for MinGW warning; - ++r; // floor() to avoid _ftol() when non-CRT - if (pow((float) r+1, dim) <= entries) - return -1; - if ((int) floor(pow((float) r, dim)) > entries) - return -1; - return r; -} - -// called twice per file -static void compute_twiddle_factors(int n, float *A, float *B, float *C) -{ - int n4 = n >> 2, n8 = n >> 3; - int k,k2; - - for (k=k2=0; k < n4; ++k,k2+=2) { - A[k2 ] = (float) cos(4*k*M_PI/n); - A[k2+1] = (float) -sin(4*k*M_PI/n); - B[k2 ] = (float) cos((k2+1)*M_PI/n/2) * 0.5f; - B[k2+1] = (float) sin((k2+1)*M_PI/n/2) * 0.5f; - } - for (k=k2=0; k < n8; ++k,k2+=2) { - C[k2 ] = (float) cos(2*(k2+1)*M_PI/n); - C[k2+1] = (float) -sin(2*(k2+1)*M_PI/n); - } -} - -static void compute_window(int n, float *window) -{ - int n2 = n >> 1, i; - for (i=0; i < n2; ++i) - window[i] = (float) sin(0.5 * M_PI * square((float) sin((i - 0 + 0.5) / n2 * 0.5 * M_PI))); -} - -static void compute_bitreverse(int n, uint16 *rev) -{ - int ld = ilog(n) - 1; // ilog is off-by-one from normal definitions - int i, n8 = n >> 3; - for (i=0; i < n8; ++i) - rev[i] = (bit_reverse(i) >> (32-ld+3)) << 2; -} - -static int init_blocksize(vorb *f, int b, int n) -{ - int n2 = n >> 1, n4 = n >> 2, n8 = n >> 3; - f->A[b] = (float *) setup_malloc(f, sizeof(float) * n2); - f->B[b] = (float *) setup_malloc(f, sizeof(float) * n2); - f->C[b] = (float *) setup_malloc(f, sizeof(float) * n4); - if (!f->A[b] || !f->B[b] || !f->C[b]) return error(f, VORBIS_outofmem); - compute_twiddle_factors(n, f->A[b], f->B[b], f->C[b]); - f->window[b] = (float *) setup_malloc(f, sizeof(float) * n2); - if (!f->window[b]) return error(f, VORBIS_outofmem); - compute_window(n, f->window[b]); - f->bit_reverse[b] = (uint16 *) setup_malloc(f, sizeof(uint16) * n8); - if (!f->bit_reverse[b]) return error(f, VORBIS_outofmem); - compute_bitreverse(n, f->bit_reverse[b]); - return TRUE; -} - -static void neighbors(uint16 *x, int n, int *plow, int *phigh) -{ - int low = -1; - int high = 65536; - int i; - for (i=0; i < n; ++i) { - if (x[i] > low && x[i] < x[n]) { *plow = i; low = x[i]; } - if (x[i] < high && x[i] > x[n]) { *phigh = i; high = x[i]; } - } -} - -// this has been repurposed so y is now the original index instead of y -typedef struct -{ - uint16 x,id; -} stbv__floor_ordering; - -static int STBV_CDECL point_compare(const void *p, const void *q) -{ - stbv__floor_ordering *a = (stbv__floor_ordering *) p; - stbv__floor_ordering *b = (stbv__floor_ordering *) q; - return a->x < b->x ? -1 : a->x > b->x; -} - -// -/////////////////////// END LEAF SETUP FUNCTIONS ////////////////////////// - - -#if defined(STB_VORBIS_NO_STDIO) - #define USE_MEMORY(z) TRUE -#else - #define USE_MEMORY(z) ((z)->stream) -#endif - -static uint8 get8(vorb *z) -{ - if (USE_MEMORY(z)) { - if (z->stream >= z->stream_end) { z->eof = TRUE; return 0; } - return *z->stream++; - } - - #ifndef STB_VORBIS_NO_STDIO - { - int c = fgetc(z->f); - if (c == EOF) { z->eof = TRUE; return 0; } - return c; - } - #endif -} - -static uint32 get32(vorb *f) -{ - uint32 x; - x = get8(f); - x += get8(f) << 8; - x += get8(f) << 16; - x += (uint32) get8(f) << 24; - return x; -} - -static int getn(vorb *z, uint8 *data, int n) -{ - if (USE_MEMORY(z)) { - if (z->stream+n > z->stream_end) { z->eof = 1; return 0; } - memcpy(data, z->stream, n); - z->stream += n; - return 1; - } - - #ifndef STB_VORBIS_NO_STDIO - if (fread(data, n, 1, z->f) == 1) - return 1; - else { - z->eof = 1; - return 0; - } - #endif -} - -static void skip(vorb *z, int n) -{ - if (USE_MEMORY(z)) { - z->stream += n; - if (z->stream >= z->stream_end) z->eof = 1; - return; - } - #ifndef STB_VORBIS_NO_STDIO - { - long x = ftell(z->f); - fseek(z->f, x+n, SEEK_SET); - } - #endif -} - -static int set_file_offset(stb_vorbis *f, unsigned int loc) -{ - #ifndef STB_VORBIS_NO_PUSHDATA_API - if (f->push_mode) return 0; - #endif - f->eof = 0; - if (USE_MEMORY(f)) { - if (f->stream_start + loc >= f->stream_end || f->stream_start + loc < f->stream_start) { - f->stream = f->stream_end; - f->eof = 1; - return 0; - } else { - f->stream = f->stream_start + loc; - return 1; - } - } - #ifndef STB_VORBIS_NO_STDIO - if (loc + f->f_start < loc || loc >= 0x80000000) { - loc = 0x7fffffff; - f->eof = 1; - } else { - loc += f->f_start; - } - if (!fseek(f->f, loc, SEEK_SET)) - return 1; - f->eof = 1; - fseek(f->f, f->f_start, SEEK_END); - return 0; - #endif -} - - -static uint8 ogg_page_header[4] = { 0x4f, 0x67, 0x67, 0x53 }; - -static int capture_pattern(vorb *f) -{ - if (0x4f != get8(f)) return FALSE; - if (0x67 != get8(f)) return FALSE; - if (0x67 != get8(f)) return FALSE; - if (0x53 != get8(f)) return FALSE; - return TRUE; -} - -#define PAGEFLAG_continued_packet 1 -#define PAGEFLAG_first_page 2 -#define PAGEFLAG_last_page 4 - -static int start_page_no_capturepattern(vorb *f) -{ - uint32 loc0,loc1,n; - if (f->first_decode && !IS_PUSH_MODE(f)) { - f->p_first.page_start = stb_vorbis_get_file_offset(f) - 4; - } - // stream structure version - if (0 != get8(f)) return error(f, VORBIS_invalid_stream_structure_version); - // header flag - f->page_flag = get8(f); - // absolute granule position - loc0 = get32(f); - loc1 = get32(f); - // @TODO: validate loc0,loc1 as valid positions? - // stream serial number -- vorbis doesn't interleave, so discard - get32(f); - //if (f->serial != get32(f)) return error(f, VORBIS_incorrect_stream_serial_number); - // page sequence number - n = get32(f); - f->last_page = n; - // CRC32 - get32(f); - // page_segments - f->segment_count = get8(f); - if (!getn(f, f->segments, f->segment_count)) - return error(f, VORBIS_unexpected_eof); - // assume we _don't_ know any the sample position of any segments - f->end_seg_with_known_loc = -2; - if (loc0 != ~0U || loc1 != ~0U) { - int i; - // determine which packet is the last one that will complete - for (i=f->segment_count-1; i >= 0; --i) - if (f->segments[i] < 255) - break; - // 'i' is now the index of the _last_ segment of a packet that ends - if (i >= 0) { - f->end_seg_with_known_loc = i; - f->known_loc_for_packet = loc0; - } - } - if (f->first_decode) { - int i,len; - len = 0; - for (i=0; i < f->segment_count; ++i) - len += f->segments[i]; - len += 27 + f->segment_count; - f->p_first.page_end = f->p_first.page_start + len; - f->p_first.last_decoded_sample = loc0; - } - f->next_seg = 0; - return TRUE; -} - -static int start_page(vorb *f) -{ - if (!capture_pattern(f)) return error(f, VORBIS_missing_capture_pattern); - return start_page_no_capturepattern(f); -} - -static int start_packet(vorb *f) -{ - while (f->next_seg == -1) { - if (!start_page(f)) return FALSE; - if (f->page_flag & PAGEFLAG_continued_packet) - return error(f, VORBIS_continued_packet_flag_invalid); - } - f->last_seg = FALSE; - f->valid_bits = 0; - f->packet_bytes = 0; - f->bytes_in_seg = 0; - // f->next_seg is now valid - return TRUE; -} - -static int maybe_start_packet(vorb *f) -{ - if (f->next_seg == -1) { - int x = get8(f); - if (f->eof) return FALSE; // EOF at page boundary is not an error! - if (0x4f != x ) return error(f, VORBIS_missing_capture_pattern); - if (0x67 != get8(f)) return error(f, VORBIS_missing_capture_pattern); - if (0x67 != get8(f)) return error(f, VORBIS_missing_capture_pattern); - if (0x53 != get8(f)) return error(f, VORBIS_missing_capture_pattern); - if (!start_page_no_capturepattern(f)) return FALSE; - if (f->page_flag & PAGEFLAG_continued_packet) { - // set up enough state that we can read this packet if we want, - // e.g. during recovery - f->last_seg = FALSE; - f->bytes_in_seg = 0; - return error(f, VORBIS_continued_packet_flag_invalid); - } - } - return start_packet(f); -} - -static int next_segment(vorb *f) -{ - int len; - if (f->last_seg) return 0; - if (f->next_seg == -1) { - f->last_seg_which = f->segment_count-1; // in case start_page fails - if (!start_page(f)) { f->last_seg = 1; return 0; } - if (!(f->page_flag & PAGEFLAG_continued_packet)) return error(f, VORBIS_continued_packet_flag_invalid); - } - len = f->segments[f->next_seg++]; - if (len < 255) { - f->last_seg = TRUE; - f->last_seg_which = f->next_seg-1; - } - if (f->next_seg >= f->segment_count) - f->next_seg = -1; - assert(f->bytes_in_seg == 0); - f->bytes_in_seg = len; - return len; -} - -#define EOP (-1) -#define INVALID_BITS (-1) - -static int get8_packet_raw(vorb *f) -{ - if (!f->bytes_in_seg) { // CLANG! - if (f->last_seg) return EOP; - else if (!next_segment(f)) return EOP; - } - assert(f->bytes_in_seg > 0); - --f->bytes_in_seg; - ++f->packet_bytes; - return get8(f); -} - -static int get8_packet(vorb *f) -{ - int x = get8_packet_raw(f); - f->valid_bits = 0; - return x; -} - -static int get32_packet(vorb *f) -{ - uint32 x; - x = get8_packet(f); - x += get8_packet(f) << 8; - x += get8_packet(f) << 16; - x += (uint32) get8_packet(f) << 24; - return x; -} - -static void flush_packet(vorb *f) -{ - while (get8_packet_raw(f) != EOP); -} - -// @OPTIMIZE: this is the secondary bit decoder, so it's probably not as important -// as the huffman decoder? -static uint32 get_bits(vorb *f, int n) -{ - uint32 z; - - if (f->valid_bits < 0) return 0; - if (f->valid_bits < n) { - if (n > 24) { - // the accumulator technique below would not work correctly in this case - z = get_bits(f, 24); - z += get_bits(f, n-24) << 24; - return z; - } - if (f->valid_bits == 0) f->acc = 0; - while (f->valid_bits < n) { - int z = get8_packet_raw(f); - if (z == EOP) { - f->valid_bits = INVALID_BITS; - return 0; - } - f->acc += z << f->valid_bits; - f->valid_bits += 8; - } - } - - assert(f->valid_bits >= n); - z = f->acc & ((1 << n)-1); - f->acc >>= n; - f->valid_bits -= n; - return z; -} - -// @OPTIMIZE: primary accumulator for huffman -// expand the buffer to as many bits as possible without reading off end of packet -// it might be nice to allow f->valid_bits and f->acc to be stored in registers, -// e.g. cache them locally and decode locally -static __forceinline void prep_huffman(vorb *f) -{ - if (f->valid_bits <= 24) { - if (f->valid_bits == 0) f->acc = 0; - do { - int z; - if (f->last_seg && !f->bytes_in_seg) return; - z = get8_packet_raw(f); - if (z == EOP) return; - f->acc += (unsigned) z << f->valid_bits; - f->valid_bits += 8; - } while (f->valid_bits <= 24); - } -} - -enum -{ - VORBIS_packet_id = 1, - VORBIS_packet_comment = 3, - VORBIS_packet_setup = 5 -}; - -static int codebook_decode_scalar_raw(vorb *f, Codebook *c) -{ - int i; - prep_huffman(f); - - if (c->codewords == NULL && c->sorted_codewords == NULL) - return -1; - - // cases to use binary search: sorted_codewords && !c->codewords - // sorted_codewords && c->entries > 8 - if (c->entries > 8 ? c->sorted_codewords!=NULL : !c->codewords) { - // binary search - uint32 code = bit_reverse(f->acc); - int x=0, n=c->sorted_entries, len; - - while (n > 1) { - // invariant: sc[x] <= code < sc[x+n] - int m = x + (n >> 1); - if (c->sorted_codewords[m] <= code) { - x = m; - n -= (n>>1); - } else { - n >>= 1; - } - } - // x is now the sorted index - if (!c->sparse) x = c->sorted_values[x]; - // x is now sorted index if sparse, or symbol otherwise - len = c->codeword_lengths[x]; - if (f->valid_bits >= len) { - f->acc >>= len; - f->valid_bits -= len; - return x; - } - - f->valid_bits = 0; - return -1; - } - - // if small, linear search - assert(!c->sparse); - for (i=0; i < c->entries; ++i) { - if (c->codeword_lengths[i] == NO_CODE) continue; - if (c->codewords[i] == (f->acc & ((1 << c->codeword_lengths[i])-1))) { - if (f->valid_bits >= c->codeword_lengths[i]) { - f->acc >>= c->codeword_lengths[i]; - f->valid_bits -= c->codeword_lengths[i]; - return i; - } - f->valid_bits = 0; - return -1; - } - } - - error(f, VORBIS_invalid_stream); - f->valid_bits = 0; - return -1; -} - -#ifndef STB_VORBIS_NO_INLINE_DECODE - -#define DECODE_RAW(var, f,c) \ - if (f->valid_bits < STB_VORBIS_FAST_HUFFMAN_LENGTH) \ - prep_huffman(f); \ - var = f->acc & FAST_HUFFMAN_TABLE_MASK; \ - var = c->fast_huffman[var]; \ - if (var >= 0) { \ - int n = c->codeword_lengths[var]; \ - f->acc >>= n; \ - f->valid_bits -= n; \ - if (f->valid_bits < 0) { f->valid_bits = 0; var = -1; } \ - } else { \ - var = codebook_decode_scalar_raw(f,c); \ - } - -#else - -static int codebook_decode_scalar(vorb *f, Codebook *c) -{ - int i; - if (f->valid_bits < STB_VORBIS_FAST_HUFFMAN_LENGTH) - prep_huffman(f); - // fast huffman table lookup - i = f->acc & FAST_HUFFMAN_TABLE_MASK; - i = c->fast_huffman[i]; - if (i >= 0) { - f->acc >>= c->codeword_lengths[i]; - f->valid_bits -= c->codeword_lengths[i]; - if (f->valid_bits < 0) { f->valid_bits = 0; return -1; } - return i; - } - return codebook_decode_scalar_raw(f,c); -} - -#define DECODE_RAW(var,f,c) var = codebook_decode_scalar(f,c); - -#endif - -#define DECODE(var,f,c) \ - DECODE_RAW(var,f,c) \ - if (c->sparse) var = c->sorted_values[var]; - -#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK - #define DECODE_VQ(var,f,c) DECODE_RAW(var,f,c) -#else - #define DECODE_VQ(var,f,c) DECODE(var,f,c) -#endif - - - - - - -// CODEBOOK_ELEMENT_FAST is an optimization for the CODEBOOK_FLOATS case -// where we avoid one addition -#define CODEBOOK_ELEMENT(c,off) (c->multiplicands[off]) -#define CODEBOOK_ELEMENT_FAST(c,off) (c->multiplicands[off]) -#define CODEBOOK_ELEMENT_BASE(c) (0) - -static int codebook_decode_start(vorb *f, Codebook *c) -{ - int z = -1; - - // type 0 is only legal in a scalar context - if (c->lookup_type == 0) - error(f, VORBIS_invalid_stream); - else { - DECODE_VQ(z,f,c); - if (c->sparse) assert(z < c->sorted_entries); - if (z < 0) { // check for EOP - if (!f->bytes_in_seg) - if (f->last_seg) - return z; - error(f, VORBIS_invalid_stream); - } - } - return z; -} - -static int codebook_decode(vorb *f, Codebook *c, float *output, int len) -{ - int i,z = codebook_decode_start(f,c); - if (z < 0) return FALSE; - if (len > c->dimensions) len = c->dimensions; - -#ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (c->lookup_type == 1) { - float last = CODEBOOK_ELEMENT_BASE(c); - int div = 1; - for (i=0; i < len; ++i) { - int off = (z / div) % c->lookup_values; - float val = CODEBOOK_ELEMENT_FAST(c,off) + last; - output[i] += val; - if (c->sequence_p) last = val + c->minimum_value; - div *= c->lookup_values; - } - return TRUE; - } -#endif - - z *= c->dimensions; - if (c->sequence_p) { - float last = CODEBOOK_ELEMENT_BASE(c); - for (i=0; i < len; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - output[i] += val; - last = val + c->minimum_value; - } - } else { - float last = CODEBOOK_ELEMENT_BASE(c); - for (i=0; i < len; ++i) { - output[i] += CODEBOOK_ELEMENT_FAST(c,z+i) + last; - } - } - - return TRUE; -} - -static int codebook_decode_step(vorb *f, Codebook *c, float *output, int len, int step) -{ - int i,z = codebook_decode_start(f,c); - float last = CODEBOOK_ELEMENT_BASE(c); - if (z < 0) return FALSE; - if (len > c->dimensions) len = c->dimensions; - -#ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (c->lookup_type == 1) { - int div = 1; - for (i=0; i < len; ++i) { - int off = (z / div) % c->lookup_values; - float val = CODEBOOK_ELEMENT_FAST(c,off) + last; - output[i*step] += val; - if (c->sequence_p) last = val; - div *= c->lookup_values; - } - return TRUE; - } -#endif - - z *= c->dimensions; - for (i=0; i < len; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - output[i*step] += val; - if (c->sequence_p) last = val; - } - - return TRUE; -} - -static int codebook_decode_deinterleave_repeat(vorb *f, Codebook *c, float **outputs, int ch, int *c_inter_p, int *p_inter_p, int len, int total_decode) -{ - int c_inter = *c_inter_p; - int p_inter = *p_inter_p; - int i,z, effective = c->dimensions; - - // type 0 is only legal in a scalar context - if (c->lookup_type == 0) return error(f, VORBIS_invalid_stream); - - while (total_decode > 0) { - float last = CODEBOOK_ELEMENT_BASE(c); - DECODE_VQ(z,f,c); - #ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK - assert(!c->sparse || z < c->sorted_entries); - #endif - if (z < 0) { - if (!f->bytes_in_seg) - if (f->last_seg) return FALSE; - return error(f, VORBIS_invalid_stream); - } - - // if this will take us off the end of the buffers, stop short! - // we check by computing the length of the virtual interleaved - // buffer (len*ch), our current offset within it (p_inter*ch)+(c_inter), - // and the length we'll be using (effective) - if (c_inter + p_inter*ch + effective > len * ch) { - effective = len*ch - (p_inter*ch - c_inter); - } - - #ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (c->lookup_type == 1) { - int div = 1; - for (i=0; i < effective; ++i) { - int off = (z / div) % c->lookup_values; - float val = CODEBOOK_ELEMENT_FAST(c,off) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - if (++c_inter == ch) { c_inter = 0; ++p_inter; } - if (c->sequence_p) last = val; - div *= c->lookup_values; - } - } else - #endif - { - z *= c->dimensions; - if (c->sequence_p) { - for (i=0; i < effective; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - if (++c_inter == ch) { c_inter = 0; ++p_inter; } - last = val; - } - } else { - for (i=0; i < effective; ++i) { - float val = CODEBOOK_ELEMENT_FAST(c,z+i) + last; - if (outputs[c_inter]) - outputs[c_inter][p_inter] += val; - if (++c_inter == ch) { c_inter = 0; ++p_inter; } - } - } - } - - total_decode -= effective; - } - *c_inter_p = c_inter; - *p_inter_p = p_inter; - return TRUE; -} - -static int predict_point(int x, int x0, int x1, int y0, int y1) -{ - int dy = y1 - y0; - int adx = x1 - x0; - // @OPTIMIZE: force int division to round in the right direction... is this necessary on x86? - int err = abs(dy) * (x - x0); - int off = err / adx; - return dy < 0 ? y0 - off : y0 + off; -} - -// the following table is block-copied from the specification -static float inverse_db_table[256] = -{ - 1.0649863e-07f, 1.1341951e-07f, 1.2079015e-07f, 1.2863978e-07f, - 1.3699951e-07f, 1.4590251e-07f, 1.5538408e-07f, 1.6548181e-07f, - 1.7623575e-07f, 1.8768855e-07f, 1.9988561e-07f, 2.1287530e-07f, - 2.2670913e-07f, 2.4144197e-07f, 2.5713223e-07f, 2.7384213e-07f, - 2.9163793e-07f, 3.1059021e-07f, 3.3077411e-07f, 3.5226968e-07f, - 3.7516214e-07f, 3.9954229e-07f, 4.2550680e-07f, 4.5315863e-07f, - 4.8260743e-07f, 5.1396998e-07f, 5.4737065e-07f, 5.8294187e-07f, - 6.2082472e-07f, 6.6116941e-07f, 7.0413592e-07f, 7.4989464e-07f, - 7.9862701e-07f, 8.5052630e-07f, 9.0579828e-07f, 9.6466216e-07f, - 1.0273513e-06f, 1.0941144e-06f, 1.1652161e-06f, 1.2409384e-06f, - 1.3215816e-06f, 1.4074654e-06f, 1.4989305e-06f, 1.5963394e-06f, - 1.7000785e-06f, 1.8105592e-06f, 1.9282195e-06f, 2.0535261e-06f, - 2.1869758e-06f, 2.3290978e-06f, 2.4804557e-06f, 2.6416497e-06f, - 2.8133190e-06f, 2.9961443e-06f, 3.1908506e-06f, 3.3982101e-06f, - 3.6190449e-06f, 3.8542308e-06f, 4.1047004e-06f, 4.3714470e-06f, - 4.6555282e-06f, 4.9580707e-06f, 5.2802740e-06f, 5.6234160e-06f, - 5.9888572e-06f, 6.3780469e-06f, 6.7925283e-06f, 7.2339451e-06f, - 7.7040476e-06f, 8.2047000e-06f, 8.7378876e-06f, 9.3057248e-06f, - 9.9104632e-06f, 1.0554501e-05f, 1.1240392e-05f, 1.1970856e-05f, - 1.2748789e-05f, 1.3577278e-05f, 1.4459606e-05f, 1.5399272e-05f, - 1.6400004e-05f, 1.7465768e-05f, 1.8600792e-05f, 1.9809576e-05f, - 2.1096914e-05f, 2.2467911e-05f, 2.3928002e-05f, 2.5482978e-05f, - 2.7139006e-05f, 2.8902651e-05f, 3.0780908e-05f, 3.2781225e-05f, - 3.4911534e-05f, 3.7180282e-05f, 3.9596466e-05f, 4.2169667e-05f, - 4.4910090e-05f, 4.7828601e-05f, 5.0936773e-05f, 5.4246931e-05f, - 5.7772202e-05f, 6.1526565e-05f, 6.5524908e-05f, 6.9783085e-05f, - 7.4317983e-05f, 7.9147585e-05f, 8.4291040e-05f, 8.9768747e-05f, - 9.5602426e-05f, 0.00010181521f, 0.00010843174f, 0.00011547824f, - 0.00012298267f, 0.00013097477f, 0.00013948625f, 0.00014855085f, - 0.00015820453f, 0.00016848555f, 0.00017943469f, 0.00019109536f, - 0.00020351382f, 0.00021673929f, 0.00023082423f, 0.00024582449f, - 0.00026179955f, 0.00027881276f, 0.00029693158f, 0.00031622787f, - 0.00033677814f, 0.00035866388f, 0.00038197188f, 0.00040679456f, - 0.00043323036f, 0.00046138411f, 0.00049136745f, 0.00052329927f, - 0.00055730621f, 0.00059352311f, 0.00063209358f, 0.00067317058f, - 0.00071691700f, 0.00076350630f, 0.00081312324f, 0.00086596457f, - 0.00092223983f, 0.00098217216f, 0.0010459992f, 0.0011139742f, - 0.0011863665f, 0.0012634633f, 0.0013455702f, 0.0014330129f, - 0.0015261382f, 0.0016253153f, 0.0017309374f, 0.0018434235f, - 0.0019632195f, 0.0020908006f, 0.0022266726f, 0.0023713743f, - 0.0025254795f, 0.0026895994f, 0.0028643847f, 0.0030505286f, - 0.0032487691f, 0.0034598925f, 0.0036847358f, 0.0039241906f, - 0.0041792066f, 0.0044507950f, 0.0047400328f, 0.0050480668f, - 0.0053761186f, 0.0057254891f, 0.0060975636f, 0.0064938176f, - 0.0069158225f, 0.0073652516f, 0.0078438871f, 0.0083536271f, - 0.0088964928f, 0.009474637f, 0.010090352f, 0.010746080f, - 0.011444421f, 0.012188144f, 0.012980198f, 0.013823725f, - 0.014722068f, 0.015678791f, 0.016697687f, 0.017782797f, - 0.018938423f, 0.020169149f, 0.021479854f, 0.022875735f, - 0.024362330f, 0.025945531f, 0.027631618f, 0.029427276f, - 0.031339626f, 0.033376252f, 0.035545228f, 0.037855157f, - 0.040315199f, 0.042935108f, 0.045725273f, 0.048696758f, - 0.051861348f, 0.055231591f, 0.058820850f, 0.062643361f, - 0.066714279f, 0.071049749f, 0.075666962f, 0.080584227f, - 0.085821044f, 0.091398179f, 0.097337747f, 0.10366330f, - 0.11039993f, 0.11757434f, 0.12521498f, 0.13335215f, - 0.14201813f, 0.15124727f, 0.16107617f, 0.17154380f, - 0.18269168f, 0.19456402f, 0.20720788f, 0.22067342f, - 0.23501402f, 0.25028656f, 0.26655159f, 0.28387361f, - 0.30232132f, 0.32196786f, 0.34289114f, 0.36517414f, - 0.38890521f, 0.41417847f, 0.44109412f, 0.46975890f, - 0.50028648f, 0.53279791f, 0.56742212f, 0.60429640f, - 0.64356699f, 0.68538959f, 0.72993007f, 0.77736504f, - 0.82788260f, 0.88168307f, 0.9389798f, 1.0f -}; - - -// @OPTIMIZE: if you want to replace this bresenham line-drawing routine, -// note that you must produce bit-identical output to decode correctly; -// this specific sequence of operations is specified in the spec (it's -// drawing integer-quantized frequency-space lines that the encoder -// expects to be exactly the same) -// ... also, isn't the whole point of Bresenham's algorithm to NOT -// have to divide in the setup? sigh. -#ifndef STB_VORBIS_NO_DEFER_FLOOR -#define LINE_OP(a,b) a *= b -#else -#define LINE_OP(a,b) a = b -#endif - -#ifdef STB_VORBIS_DIVIDE_TABLE -#define DIVTAB_NUMER 32 -#define DIVTAB_DENOM 64 -int8 integer_divide_table[DIVTAB_NUMER][DIVTAB_DENOM]; // 2KB -#endif - -static __forceinline void draw_line(float *output, int x0, int y0, int x1, int y1, int n) -{ - int dy = y1 - y0; - int adx = x1 - x0; - int ady = abs(dy); - int base; - int x=x0,y=y0; - int err = 0; - int sy; - -#ifdef STB_VORBIS_DIVIDE_TABLE - if (adx < DIVTAB_DENOM && ady < DIVTAB_NUMER) { - if (dy < 0) { - base = -integer_divide_table[ady][adx]; - sy = base-1; - } else { - base = integer_divide_table[ady][adx]; - sy = base+1; - } - } else { - base = dy / adx; - if (dy < 0) - sy = base - 1; - else - sy = base+1; - } -#else - base = dy / adx; - if (dy < 0) - sy = base - 1; - else - sy = base+1; -#endif - ady -= abs(base) * adx; - if (x1 > n) x1 = n; - if (x < x1) { - LINE_OP(output[x], inverse_db_table[y&255]); - for (++x; x < x1; ++x) { - err += ady; - if (err >= adx) { - err -= adx; - y += sy; - } else - y += base; - LINE_OP(output[x], inverse_db_table[y&255]); - } - } -} - -static int residue_decode(vorb *f, Codebook *book, float *target, int offset, int n, int rtype) -{ - int k; - if (rtype == 0) { - int step = n / book->dimensions; - for (k=0; k < step; ++k) - if (!codebook_decode_step(f, book, target+offset+k, n-offset-k, step)) - return FALSE; - } else { - for (k=0; k < n; ) { - if (!codebook_decode(f, book, target+offset, n-k)) - return FALSE; - k += book->dimensions; - offset += book->dimensions; - } - } - return TRUE; -} - -// n is 1/2 of the blocksize -- -// specification: "Correct per-vector decode length is [n]/2" -static void decode_residue(vorb *f, float *residue_buffers[], int ch, int n, int rn, uint8 *do_not_decode) -{ - int i,j,pass; - Residue *r = f->residue_config + rn; - int rtype = f->residue_types[rn]; - int c = r->classbook; - int classwords = f->codebooks[c].dimensions; - unsigned int actual_size = rtype == 2 ? n*2 : n; - unsigned int limit_r_begin = (r->begin < actual_size ? r->begin : actual_size); - unsigned int limit_r_end = (r->end < actual_size ? r->end : actual_size); - int n_read = limit_r_end - limit_r_begin; - int part_read = n_read / r->part_size; - int temp_alloc_point = temp_alloc_save(f); - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - uint8 ***part_classdata = (uint8 ***) temp_block_array(f,f->channels, part_read * sizeof(**part_classdata)); - #else - int **classifications = (int **) temp_block_array(f,f->channels, part_read * sizeof(**classifications)); - #endif - - CHECK(f); - - for (i=0; i < ch; ++i) - if (!do_not_decode[i]) - memset(residue_buffers[i], 0, sizeof(float) * n); - - if (rtype == 2 && ch != 1) { - for (j=0; j < ch; ++j) - if (!do_not_decode[j]) - break; - if (j == ch) - goto done; - - for (pass=0; pass < 8; ++pass) { - int pcount = 0, class_set = 0; - if (ch == 2) { - while (pcount < part_read) { - int z = r->begin + pcount*r->part_size; - int c_inter = (z & 1), p_inter = z>>1; - if (pass == 0) { - Codebook *c = f->codebooks+r->classbook; - int q; - DECODE(q,f,c); - if (q == EOP) goto done; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - part_classdata[0][class_set] = r->classdata[q]; - #else - for (i=classwords-1; i >= 0; --i) { - classifications[0][i+pcount] = q % r->classifications; - q /= r->classifications; - } - #endif - } - for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { - int z = r->begin + pcount*r->part_size; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - int c = part_classdata[0][class_set][i]; - #else - int c = classifications[0][pcount]; - #endif - int b = r->residue_books[c][pass]; - if (b >= 0) { - Codebook *book = f->codebooks + b; - #ifdef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) - goto done; - #else - // saves 1% - if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) - goto done; - #endif - } else { - z += r->part_size; - c_inter = z & 1; - p_inter = z >> 1; - } - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - ++class_set; - #endif - } - } else if (ch > 2) { - while (pcount < part_read) { - int z = r->begin + pcount*r->part_size; - int c_inter = z % ch, p_inter = z/ch; - if (pass == 0) { - Codebook *c = f->codebooks+r->classbook; - int q; - DECODE(q,f,c); - if (q == EOP) goto done; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - part_classdata[0][class_set] = r->classdata[q]; - #else - for (i=classwords-1; i >= 0; --i) { - classifications[0][i+pcount] = q % r->classifications; - q /= r->classifications; - } - #endif - } - for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { - int z = r->begin + pcount*r->part_size; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - int c = part_classdata[0][class_set][i]; - #else - int c = classifications[0][pcount]; - #endif - int b = r->residue_books[c][pass]; - if (b >= 0) { - Codebook *book = f->codebooks + b; - if (!codebook_decode_deinterleave_repeat(f, book, residue_buffers, ch, &c_inter, &p_inter, n, r->part_size)) - goto done; - } else { - z += r->part_size; - c_inter = z % ch; - p_inter = z / ch; - } - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - ++class_set; - #endif - } - } - } - goto done; - } - CHECK(f); - - for (pass=0; pass < 8; ++pass) { - int pcount = 0, class_set=0; - while (pcount < part_read) { - if (pass == 0) { - for (j=0; j < ch; ++j) { - if (!do_not_decode[j]) { - Codebook *c = f->codebooks+r->classbook; - int temp; - DECODE(temp,f,c); - if (temp == EOP) goto done; - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - part_classdata[j][class_set] = r->classdata[temp]; - #else - for (i=classwords-1; i >= 0; --i) { - classifications[j][i+pcount] = temp % r->classifications; - temp /= r->classifications; - } - #endif - } - } - } - for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) { - for (j=0; j < ch; ++j) { - if (!do_not_decode[j]) { - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - int c = part_classdata[j][class_set][i]; - #else - int c = classifications[j][pcount]; - #endif - int b = r->residue_books[c][pass]; - if (b >= 0) { - float *target = residue_buffers[j]; - int offset = r->begin + pcount * r->part_size; - int n = r->part_size; - Codebook *book = f->codebooks + b; - if (!residue_decode(f, book, target, offset, n, rtype)) - goto done; - } - } - } - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - ++class_set; - #endif - } - } - done: - CHECK(f); - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - temp_free(f,part_classdata); - #else - temp_free(f,classifications); - #endif - temp_alloc_restore(f,temp_alloc_point); -} - - -#if 0 -// slow way for debugging -void inverse_mdct_slow(float *buffer, int n) -{ - int i,j; - int n2 = n >> 1; - float *x = (float *) malloc(sizeof(*x) * n2); - memcpy(x, buffer, sizeof(*x) * n2); - for (i=0; i < n; ++i) { - float acc = 0; - for (j=0; j < n2; ++j) - // formula from paper: - //acc += n/4.0f * x[j] * (float) cos(M_PI / 2 / n * (2 * i + 1 + n/2.0)*(2*j+1)); - // formula from wikipedia - //acc += 2.0f / n2 * x[j] * (float) cos(M_PI/n2 * (i + 0.5 + n2/2)*(j + 0.5)); - // these are equivalent, except the formula from the paper inverts the multiplier! - // however, what actually works is NO MULTIPLIER!?! - //acc += 64 * 2.0f / n2 * x[j] * (float) cos(M_PI/n2 * (i + 0.5 + n2/2)*(j + 0.5)); - acc += x[j] * (float) cos(M_PI / 2 / n * (2 * i + 1 + n/2.0)*(2*j+1)); - buffer[i] = acc; - } - free(x); -} -#elif 0 -// same as above, but just barely able to run in real time on modern machines -void inverse_mdct_slow(float *buffer, int n, vorb *f, int blocktype) -{ - float mcos[16384]; - int i,j; - int n2 = n >> 1, nmask = (n << 2) -1; - float *x = (float *) malloc(sizeof(*x) * n2); - memcpy(x, buffer, sizeof(*x) * n2); - for (i=0; i < 4*n; ++i) - mcos[i] = (float) cos(M_PI / 2 * i / n); - - for (i=0; i < n; ++i) { - float acc = 0; - for (j=0; j < n2; ++j) - acc += x[j] * mcos[(2 * i + 1 + n2)*(2*j+1) & nmask]; - buffer[i] = acc; - } - free(x); -} -#elif 0 -// transform to use a slow dct-iv; this is STILL basically trivial, -// but only requires half as many ops -void dct_iv_slow(float *buffer, int n) -{ - float mcos[16384]; - float x[2048]; - int i,j; - int n2 = n >> 1, nmask = (n << 3) - 1; - memcpy(x, buffer, sizeof(*x) * n); - for (i=0; i < 8*n; ++i) - mcos[i] = (float) cos(M_PI / 4 * i / n); - for (i=0; i < n; ++i) { - float acc = 0; - for (j=0; j < n; ++j) - acc += x[j] * mcos[((2 * i + 1)*(2*j+1)) & nmask]; - buffer[i] = acc; - } -} - -void inverse_mdct_slow(float *buffer, int n, vorb *f, int blocktype) -{ - int i, n4 = n >> 2, n2 = n >> 1, n3_4 = n - n4; - float temp[4096]; - - memcpy(temp, buffer, n2 * sizeof(float)); - dct_iv_slow(temp, n2); // returns -c'-d, a-b' - - for (i=0; i < n4 ; ++i) buffer[i] = temp[i+n4]; // a-b' - for ( ; i < n3_4; ++i) buffer[i] = -temp[n3_4 - i - 1]; // b-a', c+d' - for ( ; i < n ; ++i) buffer[i] = -temp[i - n3_4]; // c'+d -} -#endif - -#ifndef LIBVORBIS_MDCT -#define LIBVORBIS_MDCT 0 -#endif - -#if LIBVORBIS_MDCT -// directly call the vorbis MDCT using an interface documented -// by Jeff Roberts... useful for performance comparison -typedef struct -{ - int n; - int log2n; - - float *trig; - int *bitrev; - - float scale; -} mdct_lookup; - -extern void mdct_init(mdct_lookup *lookup, int n); -extern void mdct_clear(mdct_lookup *l); -extern void mdct_backward(mdct_lookup *init, float *in, float *out); - -mdct_lookup M1,M2; - -void inverse_mdct(float *buffer, int n, vorb *f, int blocktype) -{ - mdct_lookup *M; - if (M1.n == n) M = &M1; - else if (M2.n == n) M = &M2; - else if (M1.n == 0) { mdct_init(&M1, n); M = &M1; } - else { - if (M2.n) __asm int 3; - mdct_init(&M2, n); - M = &M2; - } - - mdct_backward(M, buffer, buffer); -} -#endif - - -// the following were split out into separate functions while optimizing; -// they could be pushed back up but eh. __forceinline showed no change; -// they're probably already being inlined. -static void imdct_step3_iter0_loop(int n, float *e, int i_off, int k_off, float *A) -{ - float *ee0 = e + i_off; - float *ee2 = ee0 + k_off; - int i; - - assert((n & 3) == 0); - for (i=(n>>2); i > 0; --i) { - float k00_20, k01_21; - k00_20 = ee0[ 0] - ee2[ 0]; - k01_21 = ee0[-1] - ee2[-1]; - ee0[ 0] += ee2[ 0];//ee0[ 0] = ee0[ 0] + ee2[ 0]; - ee0[-1] += ee2[-1];//ee0[-1] = ee0[-1] + ee2[-1]; - ee2[ 0] = k00_20 * A[0] - k01_21 * A[1]; - ee2[-1] = k01_21 * A[0] + k00_20 * A[1]; - A += 8; - - k00_20 = ee0[-2] - ee2[-2]; - k01_21 = ee0[-3] - ee2[-3]; - ee0[-2] += ee2[-2];//ee0[-2] = ee0[-2] + ee2[-2]; - ee0[-3] += ee2[-3];//ee0[-3] = ee0[-3] + ee2[-3]; - ee2[-2] = k00_20 * A[0] - k01_21 * A[1]; - ee2[-3] = k01_21 * A[0] + k00_20 * A[1]; - A += 8; - - k00_20 = ee0[-4] - ee2[-4]; - k01_21 = ee0[-5] - ee2[-5]; - ee0[-4] += ee2[-4];//ee0[-4] = ee0[-4] + ee2[-4]; - ee0[-5] += ee2[-5];//ee0[-5] = ee0[-5] + ee2[-5]; - ee2[-4] = k00_20 * A[0] - k01_21 * A[1]; - ee2[-5] = k01_21 * A[0] + k00_20 * A[1]; - A += 8; - - k00_20 = ee0[-6] - ee2[-6]; - k01_21 = ee0[-7] - ee2[-7]; - ee0[-6] += ee2[-6];//ee0[-6] = ee0[-6] + ee2[-6]; - ee0[-7] += ee2[-7];//ee0[-7] = ee0[-7] + ee2[-7]; - ee2[-6] = k00_20 * A[0] - k01_21 * A[1]; - ee2[-7] = k01_21 * A[0] + k00_20 * A[1]; - A += 8; - ee0 -= 8; - ee2 -= 8; - } -} - -static void imdct_step3_inner_r_loop(int lim, float *e, int d0, int k_off, float *A, int k1) -{ - int i; - float k00_20, k01_21; - - float *e0 = e + d0; - float *e2 = e0 + k_off; - - for (i=lim >> 2; i > 0; --i) { - k00_20 = e0[-0] - e2[-0]; - k01_21 = e0[-1] - e2[-1]; - e0[-0] += e2[-0];//e0[-0] = e0[-0] + e2[-0]; - e0[-1] += e2[-1];//e0[-1] = e0[-1] + e2[-1]; - e2[-0] = (k00_20)*A[0] - (k01_21) * A[1]; - e2[-1] = (k01_21)*A[0] + (k00_20) * A[1]; - - A += k1; - - k00_20 = e0[-2] - e2[-2]; - k01_21 = e0[-3] - e2[-3]; - e0[-2] += e2[-2];//e0[-2] = e0[-2] + e2[-2]; - e0[-3] += e2[-3];//e0[-3] = e0[-3] + e2[-3]; - e2[-2] = (k00_20)*A[0] - (k01_21) * A[1]; - e2[-3] = (k01_21)*A[0] + (k00_20) * A[1]; - - A += k1; - - k00_20 = e0[-4] - e2[-4]; - k01_21 = e0[-5] - e2[-5]; - e0[-4] += e2[-4];//e0[-4] = e0[-4] + e2[-4]; - e0[-5] += e2[-5];//e0[-5] = e0[-5] + e2[-5]; - e2[-4] = (k00_20)*A[0] - (k01_21) * A[1]; - e2[-5] = (k01_21)*A[0] + (k00_20) * A[1]; - - A += k1; - - k00_20 = e0[-6] - e2[-6]; - k01_21 = e0[-7] - e2[-7]; - e0[-6] += e2[-6];//e0[-6] = e0[-6] + e2[-6]; - e0[-7] += e2[-7];//e0[-7] = e0[-7] + e2[-7]; - e2[-6] = (k00_20)*A[0] - (k01_21) * A[1]; - e2[-7] = (k01_21)*A[0] + (k00_20) * A[1]; - - e0 -= 8; - e2 -= 8; - - A += k1; - } -} - -static void imdct_step3_inner_s_loop(int n, float *e, int i_off, int k_off, float *A, int a_off, int k0) -{ - int i; - float A0 = A[0]; - float A1 = A[0+1]; - float A2 = A[0+a_off]; - float A3 = A[0+a_off+1]; - float A4 = A[0+a_off*2+0]; - float A5 = A[0+a_off*2+1]; - float A6 = A[0+a_off*3+0]; - float A7 = A[0+a_off*3+1]; - - float k00,k11; - - float *ee0 = e +i_off; - float *ee2 = ee0+k_off; - - for (i=n; i > 0; --i) { - k00 = ee0[ 0] - ee2[ 0]; - k11 = ee0[-1] - ee2[-1]; - ee0[ 0] = ee0[ 0] + ee2[ 0]; - ee0[-1] = ee0[-1] + ee2[-1]; - ee2[ 0] = (k00) * A0 - (k11) * A1; - ee2[-1] = (k11) * A0 + (k00) * A1; - - k00 = ee0[-2] - ee2[-2]; - k11 = ee0[-3] - ee2[-3]; - ee0[-2] = ee0[-2] + ee2[-2]; - ee0[-3] = ee0[-3] + ee2[-3]; - ee2[-2] = (k00) * A2 - (k11) * A3; - ee2[-3] = (k11) * A2 + (k00) * A3; - - k00 = ee0[-4] - ee2[-4]; - k11 = ee0[-5] - ee2[-5]; - ee0[-4] = ee0[-4] + ee2[-4]; - ee0[-5] = ee0[-5] + ee2[-5]; - ee2[-4] = (k00) * A4 - (k11) * A5; - ee2[-5] = (k11) * A4 + (k00) * A5; - - k00 = ee0[-6] - ee2[-6]; - k11 = ee0[-7] - ee2[-7]; - ee0[-6] = ee0[-6] + ee2[-6]; - ee0[-7] = ee0[-7] + ee2[-7]; - ee2[-6] = (k00) * A6 - (k11) * A7; - ee2[-7] = (k11) * A6 + (k00) * A7; - - ee0 -= k0; - ee2 -= k0; - } -} - -static __forceinline void iter_54(float *z) -{ - float k00,k11,k22,k33; - float y0,y1,y2,y3; - - k00 = z[ 0] - z[-4]; - y0 = z[ 0] + z[-4]; - y2 = z[-2] + z[-6]; - k22 = z[-2] - z[-6]; - - z[-0] = y0 + y2; // z0 + z4 + z2 + z6 - z[-2] = y0 - y2; // z0 + z4 - z2 - z6 - - // done with y0,y2 - - k33 = z[-3] - z[-7]; - - z[-4] = k00 + k33; // z0 - z4 + z3 - z7 - z[-6] = k00 - k33; // z0 - z4 - z3 + z7 - - // done with k33 - - k11 = z[-1] - z[-5]; - y1 = z[-1] + z[-5]; - y3 = z[-3] + z[-7]; - - z[-1] = y1 + y3; // z1 + z5 + z3 + z7 - z[-3] = y1 - y3; // z1 + z5 - z3 - z7 - z[-5] = k11 - k22; // z1 - z5 + z2 - z6 - z[-7] = k11 + k22; // z1 - z5 - z2 + z6 -} - -static void imdct_step3_inner_s_loop_ld654(int n, float *e, int i_off, float *A, int base_n) -{ - int a_off = base_n >> 3; - float A2 = A[0+a_off]; - float *z = e + i_off; - float *base = z - 16 * n; - - while (z > base) { - float k00,k11; - float l00,l11; - - k00 = z[-0] - z[ -8]; - k11 = z[-1] - z[ -9]; - l00 = z[-2] - z[-10]; - l11 = z[-3] - z[-11]; - z[ -0] = z[-0] + z[ -8]; - z[ -1] = z[-1] + z[ -9]; - z[ -2] = z[-2] + z[-10]; - z[ -3] = z[-3] + z[-11]; - z[ -8] = k00; - z[ -9] = k11; - z[-10] = (l00+l11) * A2; - z[-11] = (l11-l00) * A2; - - k00 = z[ -4] - z[-12]; - k11 = z[ -5] - z[-13]; - l00 = z[ -6] - z[-14]; - l11 = z[ -7] - z[-15]; - z[ -4] = z[ -4] + z[-12]; - z[ -5] = z[ -5] + z[-13]; - z[ -6] = z[ -6] + z[-14]; - z[ -7] = z[ -7] + z[-15]; - z[-12] = k11; - z[-13] = -k00; - z[-14] = (l11-l00) * A2; - z[-15] = (l00+l11) * -A2; - - iter_54(z); - iter_54(z-8); - z -= 16; - } -} - -static void inverse_mdct(float *buffer, int n, vorb *f, int blocktype) -{ - int n2 = n >> 1, n4 = n >> 2, n8 = n >> 3, l; - int ld; - // @OPTIMIZE: reduce register pressure by using fewer variables? - int save_point = temp_alloc_save(f); - float *buf2 = (float *) temp_alloc(f, n2 * sizeof(*buf2)); - float *u=NULL,*v=NULL; - // twiddle factors - float *A = f->A[blocktype]; - - // IMDCT algorithm from "The use of multirate filter banks for coding of high quality digital audio" - // See notes about bugs in that paper in less-optimal implementation 'inverse_mdct_old' after this function. - - // kernel from paper - - - // merged: - // copy and reflect spectral data - // step 0 - - // note that it turns out that the items added together during - // this step are, in fact, being added to themselves (as reflected - // by step 0). inexplicable inefficiency! this became obvious - // once I combined the passes. - - // so there's a missing 'times 2' here (for adding X to itself). - // this propagates through linearly to the end, where the numbers - // are 1/2 too small, and need to be compensated for. - - { - float *d,*e, *AA, *e_stop; - d = &buf2[n2-2]; - AA = A; - e = &buffer[0]; - e_stop = &buffer[n2]; - while (e != e_stop) { - d[1] = (e[0] * AA[0] - e[2]*AA[1]); - d[0] = (e[0] * AA[1] + e[2]*AA[0]); - d -= 2; - AA += 2; - e += 4; - } - - e = &buffer[n2-3]; - while (d >= buf2) { - d[1] = (-e[2] * AA[0] - -e[0]*AA[1]); - d[0] = (-e[2] * AA[1] + -e[0]*AA[0]); - d -= 2; - AA += 2; - e -= 4; - } - } - - // now we use symbolic names for these, so that we can - // possibly swap their meaning as we change which operations - // are in place - - u = buffer; - v = buf2; - - // step 2 (paper output is w, now u) - // this could be in place, but the data ends up in the wrong - // place... _somebody_'s got to swap it, so this is nominated - { - float *AA = &A[n2-8]; - float *d0,*d1, *e0, *e1; - - e0 = &v[n4]; - e1 = &v[0]; - - d0 = &u[n4]; - d1 = &u[0]; - - while (AA >= A) { - float v40_20, v41_21; - - v41_21 = e0[1] - e1[1]; - v40_20 = e0[0] - e1[0]; - d0[1] = e0[1] + e1[1]; - d0[0] = e0[0] + e1[0]; - d1[1] = v41_21*AA[4] - v40_20*AA[5]; - d1[0] = v40_20*AA[4] + v41_21*AA[5]; - - v41_21 = e0[3] - e1[3]; - v40_20 = e0[2] - e1[2]; - d0[3] = e0[3] + e1[3]; - d0[2] = e0[2] + e1[2]; - d1[3] = v41_21*AA[0] - v40_20*AA[1]; - d1[2] = v40_20*AA[0] + v41_21*AA[1]; - - AA -= 8; - - d0 += 4; - d1 += 4; - e0 += 4; - e1 += 4; - } - } - - // step 3 - ld = ilog(n) - 1; // ilog is off-by-one from normal definitions - - // optimized step 3: - - // the original step3 loop can be nested r inside s or s inside r; - // it's written originally as s inside r, but this is dumb when r - // iterates many times, and s few. So I have two copies of it and - // switch between them halfway. - - // this is iteration 0 of step 3 - imdct_step3_iter0_loop(n >> 4, u, n2-1-n4*0, -(n >> 3), A); - imdct_step3_iter0_loop(n >> 4, u, n2-1-n4*1, -(n >> 3), A); - - // this is iteration 1 of step 3 - imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*0, -(n >> 4), A, 16); - imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*1, -(n >> 4), A, 16); - imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*2, -(n >> 4), A, 16); - imdct_step3_inner_r_loop(n >> 5, u, n2-1 - n8*3, -(n >> 4), A, 16); - - l=2; - for (; l < (ld-3)>>1; ++l) { - int k0 = n >> (l+2), k0_2 = k0>>1; - int lim = 1 << (l+1); - int i; - for (i=0; i < lim; ++i) - imdct_step3_inner_r_loop(n >> (l+4), u, n2-1 - k0*i, -k0_2, A, 1 << (l+3)); - } - - for (; l < ld-6; ++l) { - int k0 = n >> (l+2), k1 = 1 << (l+3), k0_2 = k0>>1; - int rlim = n >> (l+6), r; - int lim = 1 << (l+1); - int i_off; - float *A0 = A; - i_off = n2-1; - for (r=rlim; r > 0; --r) { - imdct_step3_inner_s_loop(lim, u, i_off, -k0_2, A0, k1, k0); - A0 += k1*4; - i_off -= 8; - } - } - - // iterations with count: - // ld-6,-5,-4 all interleaved together - // the big win comes from getting rid of needless flops - // due to the constants on pass 5 & 4 being all 1 and 0; - // combining them to be simultaneous to improve cache made little difference - imdct_step3_inner_s_loop_ld654(n >> 5, u, n2-1, A, n); - - // output is u - - // step 4, 5, and 6 - // cannot be in-place because of step 5 - { - uint16 *bitrev = f->bit_reverse[blocktype]; - // weirdly, I'd have thought reading sequentially and writing - // erratically would have been better than vice-versa, but in - // fact that's not what my testing showed. (That is, with - // j = bitreverse(i), do you read i and write j, or read j and write i.) - - float *d0 = &v[n4-4]; - float *d1 = &v[n2-4]; - while (d0 >= v) { - int k4; - - k4 = bitrev[0]; - d1[3] = u[k4+0]; - d1[2] = u[k4+1]; - d0[3] = u[k4+2]; - d0[2] = u[k4+3]; - - k4 = bitrev[1]; - d1[1] = u[k4+0]; - d1[0] = u[k4+1]; - d0[1] = u[k4+2]; - d0[0] = u[k4+3]; - - d0 -= 4; - d1 -= 4; - bitrev += 2; - } - } - // (paper output is u, now v) - - - // data must be in buf2 - assert(v == buf2); - - // step 7 (paper output is v, now v) - // this is now in place - { - float *C = f->C[blocktype]; - float *d, *e; - - d = v; - e = v + n2 - 4; - - while (d < e) { - float a02,a11,b0,b1,b2,b3; - - a02 = d[0] - e[2]; - a11 = d[1] + e[3]; - - b0 = C[1]*a02 + C[0]*a11; - b1 = C[1]*a11 - C[0]*a02; - - b2 = d[0] + e[ 2]; - b3 = d[1] - e[ 3]; - - d[0] = b2 + b0; - d[1] = b3 + b1; - e[2] = b2 - b0; - e[3] = b1 - b3; - - a02 = d[2] - e[0]; - a11 = d[3] + e[1]; - - b0 = C[3]*a02 + C[2]*a11; - b1 = C[3]*a11 - C[2]*a02; - - b2 = d[2] + e[ 0]; - b3 = d[3] - e[ 1]; - - d[2] = b2 + b0; - d[3] = b3 + b1; - e[0] = b2 - b0; - e[1] = b1 - b3; - - C += 4; - d += 4; - e -= 4; - } - } - - // data must be in buf2 - - - // step 8+decode (paper output is X, now buffer) - // this generates pairs of data a la 8 and pushes them directly through - // the decode kernel (pushing rather than pulling) to avoid having - // to make another pass later - - // this cannot POSSIBLY be in place, so we refer to the buffers directly - - { - float *d0,*d1,*d2,*d3; - - float *B = f->B[blocktype] + n2 - 8; - float *e = buf2 + n2 - 8; - d0 = &buffer[0]; - d1 = &buffer[n2-4]; - d2 = &buffer[n2]; - d3 = &buffer[n-4]; - while (e >= v) { - float p0,p1,p2,p3; - - p3 = e[6]*B[7] - e[7]*B[6]; - p2 = -e[6]*B[6] - e[7]*B[7]; - - d0[0] = p3; - d1[3] = - p3; - d2[0] = p2; - d3[3] = p2; - - p1 = e[4]*B[5] - e[5]*B[4]; - p0 = -e[4]*B[4] - e[5]*B[5]; - - d0[1] = p1; - d1[2] = - p1; - d2[1] = p0; - d3[2] = p0; - - p3 = e[2]*B[3] - e[3]*B[2]; - p2 = -e[2]*B[2] - e[3]*B[3]; - - d0[2] = p3; - d1[1] = - p3; - d2[2] = p2; - d3[1] = p2; - - p1 = e[0]*B[1] - e[1]*B[0]; - p0 = -e[0]*B[0] - e[1]*B[1]; - - d0[3] = p1; - d1[0] = - p1; - d2[3] = p0; - d3[0] = p0; - - B -= 8; - e -= 8; - d0 += 4; - d2 += 4; - d1 -= 4; - d3 -= 4; - } - } - - temp_free(f,buf2); - temp_alloc_restore(f,save_point); -} - -#if 0 -// this is the original version of the above code, if you want to optimize it from scratch -void inverse_mdct_naive(float *buffer, int n) -{ - float s; - float A[1 << 12], B[1 << 12], C[1 << 11]; - int i,k,k2,k4, n2 = n >> 1, n4 = n >> 2, n8 = n >> 3, l; - int n3_4 = n - n4, ld; - // how can they claim this only uses N words?! - // oh, because they're only used sparsely, whoops - float u[1 << 13], X[1 << 13], v[1 << 13], w[1 << 13]; - // set up twiddle factors - - for (k=k2=0; k < n4; ++k,k2+=2) { - A[k2 ] = (float) cos(4*k*M_PI/n); - A[k2+1] = (float) -sin(4*k*M_PI/n); - B[k2 ] = (float) cos((k2+1)*M_PI/n/2); - B[k2+1] = (float) sin((k2+1)*M_PI/n/2); - } - for (k=k2=0; k < n8; ++k,k2+=2) { - C[k2 ] = (float) cos(2*(k2+1)*M_PI/n); - C[k2+1] = (float) -sin(2*(k2+1)*M_PI/n); - } - - // IMDCT algorithm from "The use of multirate filter banks for coding of high quality digital audio" - // Note there are bugs in that pseudocode, presumably due to them attempting - // to rename the arrays nicely rather than representing the way their actual - // implementation bounces buffers back and forth. As a result, even in the - // "some formulars corrected" version, a direct implementation fails. These - // are noted below as "paper bug". - - // copy and reflect spectral data - for (k=0; k < n2; ++k) u[k] = buffer[k]; - for ( ; k < n ; ++k) u[k] = -buffer[n - k - 1]; - // kernel from paper - // step 1 - for (k=k2=k4=0; k < n4; k+=1, k2+=2, k4+=4) { - v[n-k4-1] = (u[k4] - u[n-k4-1]) * A[k2] - (u[k4+2] - u[n-k4-3])*A[k2+1]; - v[n-k4-3] = (u[k4] - u[n-k4-1]) * A[k2+1] + (u[k4+2] - u[n-k4-3])*A[k2]; - } - // step 2 - for (k=k4=0; k < n8; k+=1, k4+=4) { - w[n2+3+k4] = v[n2+3+k4] + v[k4+3]; - w[n2+1+k4] = v[n2+1+k4] + v[k4+1]; - w[k4+3] = (v[n2+3+k4] - v[k4+3])*A[n2-4-k4] - (v[n2+1+k4]-v[k4+1])*A[n2-3-k4]; - w[k4+1] = (v[n2+1+k4] - v[k4+1])*A[n2-4-k4] + (v[n2+3+k4]-v[k4+3])*A[n2-3-k4]; - } - // step 3 - ld = ilog(n) - 1; // ilog is off-by-one from normal definitions - for (l=0; l < ld-3; ++l) { - int k0 = n >> (l+2), k1 = 1 << (l+3); - int rlim = n >> (l+4), r4, r; - int s2lim = 1 << (l+2), s2; - for (r=r4=0; r < rlim; r4+=4,++r) { - for (s2=0; s2 < s2lim; s2+=2) { - u[n-1-k0*s2-r4] = w[n-1-k0*s2-r4] + w[n-1-k0*(s2+1)-r4]; - u[n-3-k0*s2-r4] = w[n-3-k0*s2-r4] + w[n-3-k0*(s2+1)-r4]; - u[n-1-k0*(s2+1)-r4] = (w[n-1-k0*s2-r4] - w[n-1-k0*(s2+1)-r4]) * A[r*k1] - - (w[n-3-k0*s2-r4] - w[n-3-k0*(s2+1)-r4]) * A[r*k1+1]; - u[n-3-k0*(s2+1)-r4] = (w[n-3-k0*s2-r4] - w[n-3-k0*(s2+1)-r4]) * A[r*k1] - + (w[n-1-k0*s2-r4] - w[n-1-k0*(s2+1)-r4]) * A[r*k1+1]; - } - } - if (l+1 < ld-3) { - // paper bug: ping-ponging of u&w here is omitted - memcpy(w, u, sizeof(u)); - } - } - - // step 4 - for (i=0; i < n8; ++i) { - int j = bit_reverse(i) >> (32-ld+3); - assert(j < n8); - if (i == j) { - // paper bug: original code probably swapped in place; if copying, - // need to directly copy in this case - int i8 = i << 3; - v[i8+1] = u[i8+1]; - v[i8+3] = u[i8+3]; - v[i8+5] = u[i8+5]; - v[i8+7] = u[i8+7]; - } else if (i < j) { - int i8 = i << 3, j8 = j << 3; - v[j8+1] = u[i8+1], v[i8+1] = u[j8 + 1]; - v[j8+3] = u[i8+3], v[i8+3] = u[j8 + 3]; - v[j8+5] = u[i8+5], v[i8+5] = u[j8 + 5]; - v[j8+7] = u[i8+7], v[i8+7] = u[j8 + 7]; - } - } - // step 5 - for (k=0; k < n2; ++k) { - w[k] = v[k*2+1]; - } - // step 6 - for (k=k2=k4=0; k < n8; ++k, k2 += 2, k4 += 4) { - u[n-1-k2] = w[k4]; - u[n-2-k2] = w[k4+1]; - u[n3_4 - 1 - k2] = w[k4+2]; - u[n3_4 - 2 - k2] = w[k4+3]; - } - // step 7 - for (k=k2=0; k < n8; ++k, k2 += 2) { - v[n2 + k2 ] = ( u[n2 + k2] + u[n-2-k2] + C[k2+1]*(u[n2+k2]-u[n-2-k2]) + C[k2]*(u[n2+k2+1]+u[n-2-k2+1]))/2; - v[n-2 - k2] = ( u[n2 + k2] + u[n-2-k2] - C[k2+1]*(u[n2+k2]-u[n-2-k2]) - C[k2]*(u[n2+k2+1]+u[n-2-k2+1]))/2; - v[n2+1+ k2] = ( u[n2+1+k2] - u[n-1-k2] + C[k2+1]*(u[n2+1+k2]+u[n-1-k2]) - C[k2]*(u[n2+k2]-u[n-2-k2]))/2; - v[n-1 - k2] = (-u[n2+1+k2] + u[n-1-k2] + C[k2+1]*(u[n2+1+k2]+u[n-1-k2]) - C[k2]*(u[n2+k2]-u[n-2-k2]))/2; - } - // step 8 - for (k=k2=0; k < n4; ++k,k2 += 2) { - X[k] = v[k2+n2]*B[k2 ] + v[k2+1+n2]*B[k2+1]; - X[n2-1-k] = v[k2+n2]*B[k2+1] - v[k2+1+n2]*B[k2 ]; - } - - // decode kernel to output - // determined the following value experimentally - // (by first figuring out what made inverse_mdct_slow work); then matching that here - // (probably vorbis encoder premultiplies by n or n/2, to save it on the decoder?) - s = 0.5; // theoretically would be n4 - - // [[[ note! the s value of 0.5 is compensated for by the B[] in the current code, - // so it needs to use the "old" B values to behave correctly, or else - // set s to 1.0 ]]] - for (i=0; i < n4 ; ++i) buffer[i] = s * X[i+n4]; - for ( ; i < n3_4; ++i) buffer[i] = -s * X[n3_4 - i - 1]; - for ( ; i < n ; ++i) buffer[i] = -s * X[i - n3_4]; -} -#endif - -static float *get_window(vorb *f, int len) -{ - len <<= 1; - if (len == f->blocksize_0) return f->window[0]; - if (len == f->blocksize_1) return f->window[1]; - return NULL; -} - -#ifndef STB_VORBIS_NO_DEFER_FLOOR -typedef int16 YTYPE; -#else -typedef int YTYPE; -#endif -static int do_floor(vorb *f, Mapping *map, int i, int n, float *target, YTYPE *finalY, uint8 *step2_flag) -{ - int n2 = n >> 1; - int s = map->chan[i].mux, floor; - floor = map->submap_floor[s]; - if (f->floor_types[floor] == 0) { - return error(f, VORBIS_invalid_stream); - } else { - Floor1 *g = &f->floor_config[floor].floor1; - int j,q; - int lx = 0, ly = finalY[0] * g->floor1_multiplier; - for (q=1; q < g->values; ++q) { - j = g->sorted_order[q]; - #ifndef STB_VORBIS_NO_DEFER_FLOOR - STBV_NOTUSED(step2_flag); - if (finalY[j] >= 0) - #else - if (step2_flag[j]) - #endif - { - int hy = finalY[j] * g->floor1_multiplier; - int hx = g->Xlist[j]; - if (lx != hx) - draw_line(target, lx,ly, hx,hy, n2); - CHECK(f); - lx = hx, ly = hy; - } - } - if (lx < n2) { - // optimization of: draw_line(target, lx,ly, n,ly, n2); - for (j=lx; j < n2; ++j) - LINE_OP(target[j], inverse_db_table[ly]); - CHECK(f); - } - } - return TRUE; -} - -// The meaning of "left" and "right" -// -// For a given frame: -// we compute samples from 0..n -// window_center is n/2 -// we'll window and mix the samples from left_start to left_end with data from the previous frame -// all of the samples from left_end to right_start can be output without mixing; however, -// this interval is 0-length except when transitioning between short and long frames -// all of the samples from right_start to right_end need to be mixed with the next frame, -// which we don't have, so those get saved in a buffer -// frame N's right_end-right_start, the number of samples to mix with the next frame, -// has to be the same as frame N+1's left_end-left_start (which they are by -// construction) - -static int vorbis_decode_initial(vorb *f, int *p_left_start, int *p_left_end, int *p_right_start, int *p_right_end, int *mode) -{ - Mode *m; - int i, n, prev, next, window_center; - f->channel_buffer_start = f->channel_buffer_end = 0; - - retry: - if (f->eof) return FALSE; - if (!maybe_start_packet(f)) - return FALSE; - // check packet type - if (get_bits(f,1) != 0) { - if (IS_PUSH_MODE(f)) - return error(f,VORBIS_bad_packet_type); - while (EOP != get8_packet(f)); - goto retry; - } - - if (f->alloc.alloc_buffer) - assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); - - i = get_bits(f, ilog(f->mode_count-1)); - if (i == EOP) return FALSE; - if (i >= f->mode_count) return FALSE; - *mode = i; - m = f->mode_config + i; - if (m->blockflag) { - n = f->blocksize_1; - prev = get_bits(f,1); - next = get_bits(f,1); - } else { - prev = next = 0; - n = f->blocksize_0; - } - -// WINDOWING - - window_center = n >> 1; - if (m->blockflag && !prev) { - *p_left_start = (n - f->blocksize_0) >> 2; - *p_left_end = (n + f->blocksize_0) >> 2; - } else { - *p_left_start = 0; - *p_left_end = window_center; - } - if (m->blockflag && !next) { - *p_right_start = (n*3 - f->blocksize_0) >> 2; - *p_right_end = (n*3 + f->blocksize_0) >> 2; - } else { - *p_right_start = window_center; - *p_right_end = n; - } - - return TRUE; -} - -static int vorbis_decode_packet_rest(vorb *f, int *len, Mode *m, int left_start, int left_end, int right_start, int right_end, int *p_left) -{ - Mapping *map; - int i,j,k,n,n2; - int zero_channel[256]; - int really_zero_channel[256]; - -// WINDOWING - - STBV_NOTUSED(left_end); - n = f->blocksize[m->blockflag]; - map = &f->mapping[m->mapping]; - -// FLOORS - n2 = n >> 1; - - CHECK(f); - - for (i=0; i < f->channels; ++i) { - int s = map->chan[i].mux, floor; - zero_channel[i] = FALSE; - floor = map->submap_floor[s]; - if (f->floor_types[floor] == 0) { - return error(f, VORBIS_invalid_stream); - } else { - Floor1 *g = &f->floor_config[floor].floor1; - if (get_bits(f, 1)) { - short *finalY; - uint8 step2_flag[256]; - static int range_list[4] = { 256, 128, 86, 64 }; - int range = range_list[g->floor1_multiplier-1]; - int offset = 2; - finalY = f->finalY[i]; - finalY[0] = get_bits(f, ilog(range)-1); - finalY[1] = get_bits(f, ilog(range)-1); - for (j=0; j < g->partitions; ++j) { - int pclass = g->partition_class_list[j]; - int cdim = g->class_dimensions[pclass]; - int cbits = g->class_subclasses[pclass]; - int csub = (1 << cbits)-1; - int cval = 0; - if (cbits) { - Codebook *c = f->codebooks + g->class_masterbooks[pclass]; - DECODE(cval,f,c); - } - for (k=0; k < cdim; ++k) { - int book = g->subclass_books[pclass][cval & csub]; - cval = cval >> cbits; - if (book >= 0) { - int temp; - Codebook *c = f->codebooks + book; - DECODE(temp,f,c); - finalY[offset++] = temp; - } else - finalY[offset++] = 0; - } - } - if (f->valid_bits == INVALID_BITS) goto error; // behavior according to spec - step2_flag[0] = step2_flag[1] = 1; - for (j=2; j < g->values; ++j) { - int low, high, pred, highroom, lowroom, room, val; - low = g->neighbors[j][0]; - high = g->neighbors[j][1]; - //neighbors(g->Xlist, j, &low, &high); - pred = predict_point(g->Xlist[j], g->Xlist[low], g->Xlist[high], finalY[low], finalY[high]); - val = finalY[j]; - highroom = range - pred; - lowroom = pred; - if (highroom < lowroom) - room = highroom * 2; - else - room = lowroom * 2; - if (val) { - step2_flag[low] = step2_flag[high] = 1; - step2_flag[j] = 1; - if (val >= room) - if (highroom > lowroom) - finalY[j] = val - lowroom + pred; - else - finalY[j] = pred - val + highroom - 1; - else - if (val & 1) - finalY[j] = pred - ((val+1)>>1); - else - finalY[j] = pred + (val>>1); - } else { - step2_flag[j] = 0; - finalY[j] = pred; - } - } - -#ifdef STB_VORBIS_NO_DEFER_FLOOR - do_floor(f, map, i, n, f->floor_buffers[i], finalY, step2_flag); -#else - // defer final floor computation until _after_ residue - for (j=0; j < g->values; ++j) { - if (!step2_flag[j]) - finalY[j] = -1; - } -#endif - } else { - error: - zero_channel[i] = TRUE; - } - // So we just defer everything else to later - - // at this point we've decoded the floor into buffer - } - } - CHECK(f); - // at this point we've decoded all floors - - if (f->alloc.alloc_buffer) - assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); - - // re-enable coupled channels if necessary - memcpy(really_zero_channel, zero_channel, sizeof(really_zero_channel[0]) * f->channels); - for (i=0; i < map->coupling_steps; ++i) - if (!zero_channel[map->chan[i].magnitude] || !zero_channel[map->chan[i].angle]) { - zero_channel[map->chan[i].magnitude] = zero_channel[map->chan[i].angle] = FALSE; - } - - CHECK(f); -// RESIDUE DECODE - for (i=0; i < map->submaps; ++i) { - float *residue_buffers[STB_VORBIS_MAX_CHANNELS]; - int r; - uint8 do_not_decode[256]; - int ch = 0; - for (j=0; j < f->channels; ++j) { - if (map->chan[j].mux == i) { - if (zero_channel[j]) { - do_not_decode[ch] = TRUE; - residue_buffers[ch] = NULL; - } else { - do_not_decode[ch] = FALSE; - residue_buffers[ch] = f->channel_buffers[j]; - } - ++ch; - } - } - r = map->submap_residue[i]; - decode_residue(f, residue_buffers, ch, n2, r, do_not_decode); - } - - if (f->alloc.alloc_buffer) - assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); - CHECK(f); - -// INVERSE COUPLING - for (i = map->coupling_steps-1; i >= 0; --i) { - int n2 = n >> 1; - float *m = f->channel_buffers[map->chan[i].magnitude]; - float *a = f->channel_buffers[map->chan[i].angle ]; - for (j=0; j < n2; ++j) { - float a2,m2; - if (m[j] > 0) - if (a[j] > 0) - m2 = m[j], a2 = m[j] - a[j]; - else - a2 = m[j], m2 = m[j] + a[j]; - else - if (a[j] > 0) - m2 = m[j], a2 = m[j] + a[j]; - else - a2 = m[j], m2 = m[j] - a[j]; - m[j] = m2; - a[j] = a2; - } - } - CHECK(f); - - // finish decoding the floors -#ifndef STB_VORBIS_NO_DEFER_FLOOR - for (i=0; i < f->channels; ++i) { - if (really_zero_channel[i]) { - memset(f->channel_buffers[i], 0, sizeof(*f->channel_buffers[i]) * n2); - } else { - do_floor(f, map, i, n, f->channel_buffers[i], f->finalY[i], NULL); - } - } -#else - for (i=0; i < f->channels; ++i) { - if (really_zero_channel[i]) { - memset(f->channel_buffers[i], 0, sizeof(*f->channel_buffers[i]) * n2); - } else { - for (j=0; j < n2; ++j) - f->channel_buffers[i][j] *= f->floor_buffers[i][j]; - } - } -#endif - -// INVERSE MDCT - CHECK(f); - for (i=0; i < f->channels; ++i) - inverse_mdct(f->channel_buffers[i], n, f, m->blockflag); - CHECK(f); - - // this shouldn't be necessary, unless we exited on an error - // and want to flush to get to the next packet - flush_packet(f); - - if (f->first_decode) { - // assume we start so first non-discarded sample is sample 0 - // this isn't to spec, but spec would require us to read ahead - // and decode the size of all current frames--could be done, - // but presumably it's not a commonly used feature - f->current_loc = 0u - n2; // start of first frame is positioned for discard (NB this is an intentional unsigned overflow/wrap-around) - // we might have to discard samples "from" the next frame too, - // if we're lapping a large block then a small at the start? - f->discard_samples_deferred = n - right_end; - f->current_loc_valid = TRUE; - f->first_decode = FALSE; - } else if (f->discard_samples_deferred) { - if (f->discard_samples_deferred >= right_start - left_start) { - f->discard_samples_deferred -= (right_start - left_start); - left_start = right_start; - *p_left = left_start; - } else { - left_start += f->discard_samples_deferred; - *p_left = left_start; - f->discard_samples_deferred = 0; - } - } else if (f->previous_length == 0 && f->current_loc_valid) { - // we're recovering from a seek... that means we're going to discard - // the samples from this packet even though we know our position from - // the last page header, so we need to update the position based on - // the discarded samples here - // but wait, the code below is going to add this in itself even - // on a discard, so we don't need to do it here... - } - - // check if we have ogg information about the sample # for this packet - if (f->last_seg_which == f->end_seg_with_known_loc) { - // if we have a valid current loc, and this is final: - if (f->current_loc_valid && (f->page_flag & PAGEFLAG_last_page)) { - uint32 current_end = f->known_loc_for_packet; - // then let's infer the size of the (probably) short final frame - if (current_end < f->current_loc + (right_end-left_start)) { - if (current_end < f->current_loc) { - // negative truncation, that's impossible! - *len = 0; - } else { - *len = current_end - f->current_loc; - } - *len += left_start; // this doesn't seem right, but has no ill effect on my test files - if (*len > right_end) *len = right_end; // this should never happen - f->current_loc += *len; - return TRUE; - } - } - // otherwise, just set our sample loc - // guess that the ogg granule pos refers to the _middle_ of the - // last frame? - // set f->current_loc to the position of left_start - f->current_loc = f->known_loc_for_packet - (n2-left_start); - f->current_loc_valid = TRUE; - } - if (f->current_loc_valid) - f->current_loc += (right_start - left_start); - - if (f->alloc.alloc_buffer) - assert(f->alloc.alloc_buffer_length_in_bytes == f->temp_offset); - *len = right_end; // ignore samples after the window goes to 0 - CHECK(f); - - return TRUE; -} - -static int vorbis_decode_packet(vorb *f, int *len, int *p_left, int *p_right) -{ - int mode, left_end, right_end; - if (!vorbis_decode_initial(f, p_left, &left_end, p_right, &right_end, &mode)) return 0; - return vorbis_decode_packet_rest(f, len, f->mode_config + mode, *p_left, left_end, *p_right, right_end, p_left); -} - -static int vorbis_finish_frame(stb_vorbis *f, int len, int left, int right) -{ - int prev,i,j; - // we use right&left (the start of the right- and left-window sin()-regions) - // to determine how much to return, rather than inferring from the rules - // (same result, clearer code); 'left' indicates where our sin() window - // starts, therefore where the previous window's right edge starts, and - // therefore where to start mixing from the previous buffer. 'right' - // indicates where our sin() ending-window starts, therefore that's where - // we start saving, and where our returned-data ends. - - // mixin from previous window - if (f->previous_length) { - int i,j, n = f->previous_length; - float *w = get_window(f, n); - if (w == NULL) return 0; - for (i=0; i < f->channels; ++i) { - for (j=0; j < n; ++j) - f->channel_buffers[i][left+j] = - f->channel_buffers[i][left+j]*w[ j] + - f->previous_window[i][ j]*w[n-1-j]; - } - } - - prev = f->previous_length; - - // last half of this data becomes previous window - f->previous_length = len - right; - - // @OPTIMIZE: could avoid this copy by double-buffering the - // output (flipping previous_window with channel_buffers), but - // then previous_window would have to be 2x as large, and - // channel_buffers couldn't be temp mem (although they're NOT - // currently temp mem, they could be (unless we want to level - // performance by spreading out the computation)) - for (i=0; i < f->channels; ++i) - for (j=0; right+j < len; ++j) - f->previous_window[i][j] = f->channel_buffers[i][right+j]; - - if (!prev) - // there was no previous packet, so this data isn't valid... - // this isn't entirely true, only the would-have-overlapped data - // isn't valid, but this seems to be what the spec requires - return 0; - - // truncate a short frame - if (len < right) right = len; - - f->samples_output += right-left; - - return right - left; -} - -static int vorbis_pump_first_frame(stb_vorbis *f) -{ - int len, right, left, res; - res = vorbis_decode_packet(f, &len, &left, &right); - if (res) - vorbis_finish_frame(f, len, left, right); - return res; -} - -#ifndef STB_VORBIS_NO_PUSHDATA_API -static int is_whole_packet_present(stb_vorbis *f) -{ - // make sure that we have the packet available before continuing... - // this requires a full ogg parse, but we know we can fetch from f->stream - - // instead of coding this out explicitly, we could save the current read state, - // read the next packet with get8() until end-of-packet, check f->eof, then - // reset the state? but that would be slower, esp. since we'd have over 256 bytes - // of state to restore (primarily the page segment table) - - int s = f->next_seg, first = TRUE; - uint8 *p = f->stream; - - if (s != -1) { // if we're not starting the packet with a 'continue on next page' flag - for (; s < f->segment_count; ++s) { - p += f->segments[s]; - if (f->segments[s] < 255) // stop at first short segment - break; - } - // either this continues, or it ends it... - if (s == f->segment_count) - s = -1; // set 'crosses page' flag - if (p > f->stream_end) return error(f, VORBIS_need_more_data); - first = FALSE; - } - for (; s == -1;) { - uint8 *q; - int n; - - // check that we have the page header ready - if (p + 26 >= f->stream_end) return error(f, VORBIS_need_more_data); - // validate the page - if (memcmp(p, ogg_page_header, 4)) return error(f, VORBIS_invalid_stream); - if (p[4] != 0) return error(f, VORBIS_invalid_stream); - if (first) { // the first segment must NOT have 'continued_packet', later ones MUST - if (f->previous_length) - if ((p[5] & PAGEFLAG_continued_packet)) return error(f, VORBIS_invalid_stream); - // if no previous length, we're resynching, so we can come in on a continued-packet, - // which we'll just drop - } else { - if (!(p[5] & PAGEFLAG_continued_packet)) return error(f, VORBIS_invalid_stream); - } - n = p[26]; // segment counts - q = p+27; // q points to segment table - p = q + n; // advance past header - // make sure we've read the segment table - if (p > f->stream_end) return error(f, VORBIS_need_more_data); - for (s=0; s < n; ++s) { - p += q[s]; - if (q[s] < 255) - break; - } - if (s == n) - s = -1; // set 'crosses page' flag - if (p > f->stream_end) return error(f, VORBIS_need_more_data); - first = FALSE; - } - return TRUE; -} -#endif // !STB_VORBIS_NO_PUSHDATA_API - -static int start_decoder(vorb *f) -{ - uint8 header[6], x,y; - int len,i,j,k, max_submaps = 0; - int longest_floorlist=0; - - // first page, first packet - f->first_decode = TRUE; - - if (!start_page(f)) return FALSE; - // validate page flag - if (!(f->page_flag & PAGEFLAG_first_page)) return error(f, VORBIS_invalid_first_page); - if (f->page_flag & PAGEFLAG_last_page) return error(f, VORBIS_invalid_first_page); - if (f->page_flag & PAGEFLAG_continued_packet) return error(f, VORBIS_invalid_first_page); - // check for expected packet length - if (f->segment_count != 1) return error(f, VORBIS_invalid_first_page); - if (f->segments[0] != 30) { - // check for the Ogg skeleton fishead identifying header to refine our error - if (f->segments[0] == 64 && - getn(f, header, 6) && - header[0] == 'f' && - header[1] == 'i' && - header[2] == 's' && - header[3] == 'h' && - header[4] == 'e' && - header[5] == 'a' && - get8(f) == 'd' && - get8(f) == '\0') return error(f, VORBIS_ogg_skeleton_not_supported); - else - return error(f, VORBIS_invalid_first_page); - } - - // read packet - // check packet header - if (get8(f) != VORBIS_packet_id) return error(f, VORBIS_invalid_first_page); - if (!getn(f, header, 6)) return error(f, VORBIS_unexpected_eof); - if (!vorbis_validate(header)) return error(f, VORBIS_invalid_first_page); - // vorbis_version - if (get32(f) != 0) return error(f, VORBIS_invalid_first_page); - f->channels = get8(f); if (!f->channels) return error(f, VORBIS_invalid_first_page); - if (f->channels > STB_VORBIS_MAX_CHANNELS) return error(f, VORBIS_too_many_channels); - f->sample_rate = get32(f); if (!f->sample_rate) return error(f, VORBIS_invalid_first_page); - get32(f); // bitrate_maximum - get32(f); // bitrate_nominal - get32(f); // bitrate_minimum - x = get8(f); - { - int log0,log1; - log0 = x & 15; - log1 = x >> 4; - f->blocksize_0 = 1 << log0; - f->blocksize_1 = 1 << log1; - if (log0 < 6 || log0 > 13) return error(f, VORBIS_invalid_setup); - if (log1 < 6 || log1 > 13) return error(f, VORBIS_invalid_setup); - if (log0 > log1) return error(f, VORBIS_invalid_setup); - } - - // framing_flag - x = get8(f); - if (!(x & 1)) return error(f, VORBIS_invalid_first_page); - - // second packet! - if (!start_page(f)) return FALSE; - - if (!start_packet(f)) return FALSE; - - if (!next_segment(f)) return FALSE; - - if (get8_packet(f) != VORBIS_packet_comment) return error(f, VORBIS_invalid_setup); - for (i=0; i < 6; ++i) header[i] = get8_packet(f); - if (!vorbis_validate(header)) return error(f, VORBIS_invalid_setup); - //file vendor - len = get32_packet(f); - f->vendor = (char*)setup_malloc(f, sizeof(char) * (len+1)); - if (f->vendor == NULL) return error(f, VORBIS_outofmem); - for(i=0; i < len; ++i) { - f->vendor[i] = get8_packet(f); - } - f->vendor[len] = (char)'\0'; - //user comments - f->comment_list_length = get32_packet(f); - f->comment_list = NULL; - if (f->comment_list_length > 0) - { - f->comment_list = (char**) setup_malloc(f, sizeof(char*) * (f->comment_list_length)); - if (f->comment_list == NULL) return error(f, VORBIS_outofmem); - } - - for(i=0; i < f->comment_list_length; ++i) { - len = get32_packet(f); - f->comment_list[i] = (char*)setup_malloc(f, sizeof(char) * (len+1)); - if (f->comment_list[i] == NULL) return error(f, VORBIS_outofmem); - - for(j=0; j < len; ++j) { - f->comment_list[i][j] = get8_packet(f); - } - f->comment_list[i][len] = (char)'\0'; - } - - // framing_flag - x = get8_packet(f); - if (!(x & 1)) return error(f, VORBIS_invalid_setup); - - - skip(f, f->bytes_in_seg); - f->bytes_in_seg = 0; - - do { - len = next_segment(f); - skip(f, len); - f->bytes_in_seg = 0; - } while (len); - - // third packet! - if (!start_packet(f)) return FALSE; - - #ifndef STB_VORBIS_NO_PUSHDATA_API - if (IS_PUSH_MODE(f)) { - if (!is_whole_packet_present(f)) { - // convert error in ogg header to write type - if (f->error == VORBIS_invalid_stream) - f->error = VORBIS_invalid_setup; - return FALSE; - } - } - #endif - - crc32_init(); // always init it, to avoid multithread race conditions - - if (get8_packet(f) != VORBIS_packet_setup) return error(f, VORBIS_invalid_setup); - for (i=0; i < 6; ++i) header[i] = get8_packet(f); - if (!vorbis_validate(header)) return error(f, VORBIS_invalid_setup); - - // codebooks - - f->codebook_count = get_bits(f,8) + 1; - f->codebooks = (Codebook *) setup_malloc(f, sizeof(*f->codebooks) * f->codebook_count); - if (f->codebooks == NULL) return error(f, VORBIS_outofmem); - memset(f->codebooks, 0, sizeof(*f->codebooks) * f->codebook_count); - for (i=0; i < f->codebook_count; ++i) { - uint32 *values; - int ordered, sorted_count; - int total=0; - uint8 *lengths; - Codebook *c = f->codebooks+i; - CHECK(f); - x = get_bits(f, 8); if (x != 0x42) return error(f, VORBIS_invalid_setup); - x = get_bits(f, 8); if (x != 0x43) return error(f, VORBIS_invalid_setup); - x = get_bits(f, 8); if (x != 0x56) return error(f, VORBIS_invalid_setup); - x = get_bits(f, 8); - c->dimensions = (get_bits(f, 8)<<8) + x; - x = get_bits(f, 8); - y = get_bits(f, 8); - c->entries = (get_bits(f, 8)<<16) + (y<<8) + x; - ordered = get_bits(f,1); - c->sparse = ordered ? 0 : get_bits(f,1); - - if (c->dimensions == 0 && c->entries != 0) return error(f, VORBIS_invalid_setup); - - if (c->sparse) - lengths = (uint8 *) setup_temp_malloc(f, c->entries); - else - lengths = c->codeword_lengths = (uint8 *) setup_malloc(f, c->entries); - - if (!lengths) return error(f, VORBIS_outofmem); - - if (ordered) { - int current_entry = 0; - int current_length = get_bits(f,5) + 1; - while (current_entry < c->entries) { - int limit = c->entries - current_entry; - int n = get_bits(f, ilog(limit)); - if (current_length >= 32) return error(f, VORBIS_invalid_setup); - if (current_entry + n > (int) c->entries) { return error(f, VORBIS_invalid_setup); } - memset(lengths + current_entry, current_length, n); - current_entry += n; - ++current_length; - } - } else { - for (j=0; j < c->entries; ++j) { - int present = c->sparse ? get_bits(f,1) : 1; - if (present) { - lengths[j] = get_bits(f, 5) + 1; - ++total; - if (lengths[j] == 32) - return error(f, VORBIS_invalid_setup); - } else { - lengths[j] = NO_CODE; - } - } - } - - if (c->sparse && total >= c->entries >> 2) { - // convert sparse items to non-sparse! - if (c->entries > (int) f->setup_temp_memory_required) - f->setup_temp_memory_required = c->entries; - - c->codeword_lengths = (uint8 *) setup_malloc(f, c->entries); - if (c->codeword_lengths == NULL) return error(f, VORBIS_outofmem); - memcpy(c->codeword_lengths, lengths, c->entries); - setup_temp_free(f, lengths, c->entries); // note this is only safe if there have been no intervening temp mallocs! - lengths = c->codeword_lengths; - c->sparse = 0; - } - - // compute the size of the sorted tables - if (c->sparse) { - sorted_count = total; - } else { - sorted_count = 0; - #ifndef STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH - for (j=0; j < c->entries; ++j) - if (lengths[j] > STB_VORBIS_FAST_HUFFMAN_LENGTH && lengths[j] != NO_CODE) - ++sorted_count; - #endif - } - - c->sorted_entries = sorted_count; - values = NULL; - - CHECK(f); - if (!c->sparse) { - c->codewords = (uint32 *) setup_malloc(f, sizeof(c->codewords[0]) * c->entries); - if (!c->codewords) return error(f, VORBIS_outofmem); - } else { - unsigned int size; - if (c->sorted_entries) { - c->codeword_lengths = (uint8 *) setup_malloc(f, c->sorted_entries); - if (!c->codeword_lengths) return error(f, VORBIS_outofmem); - c->codewords = (uint32 *) setup_temp_malloc(f, sizeof(*c->codewords) * c->sorted_entries); - if (!c->codewords) return error(f, VORBIS_outofmem); - values = (uint32 *) setup_temp_malloc(f, sizeof(*values) * c->sorted_entries); - if (!values) return error(f, VORBIS_outofmem); - } - size = c->entries + (sizeof(*c->codewords) + sizeof(*values)) * c->sorted_entries; - if (size > f->setup_temp_memory_required) - f->setup_temp_memory_required = size; - } - - if (!compute_codewords(c, lengths, c->entries, values)) { - if (c->sparse) setup_temp_free(f, values, 0); - return error(f, VORBIS_invalid_setup); - } - - if (c->sorted_entries) { - // allocate an extra slot for sentinels - c->sorted_codewords = (uint32 *) setup_malloc(f, sizeof(*c->sorted_codewords) * (c->sorted_entries+1)); - if (c->sorted_codewords == NULL) return error(f, VORBIS_outofmem); - // allocate an extra slot at the front so that c->sorted_values[-1] is defined - // so that we can catch that case without an extra if - c->sorted_values = ( int *) setup_malloc(f, sizeof(*c->sorted_values ) * (c->sorted_entries+1)); - if (c->sorted_values == NULL) return error(f, VORBIS_outofmem); - ++c->sorted_values; - c->sorted_values[-1] = -1; - compute_sorted_huffman(c, lengths, values); - } - - if (c->sparse) { - setup_temp_free(f, values, sizeof(*values)*c->sorted_entries); - setup_temp_free(f, c->codewords, sizeof(*c->codewords)*c->sorted_entries); - setup_temp_free(f, lengths, c->entries); - c->codewords = NULL; - } - - compute_accelerated_huffman(c); - - CHECK(f); - c->lookup_type = get_bits(f, 4); - if (c->lookup_type > 2) return error(f, VORBIS_invalid_setup); - if (c->lookup_type > 0) { - uint16 *mults; - c->minimum_value = float32_unpack(get_bits(f, 32)); - c->delta_value = float32_unpack(get_bits(f, 32)); - c->value_bits = get_bits(f, 4)+1; - c->sequence_p = get_bits(f,1); - if (c->lookup_type == 1) { - int values = lookup1_values(c->entries, c->dimensions); - if (values < 0) return error(f, VORBIS_invalid_setup); - c->lookup_values = (uint32) values; - } else { - c->lookup_values = c->entries * c->dimensions; - } - if (c->lookup_values == 0) return error(f, VORBIS_invalid_setup); - mults = (uint16 *) setup_temp_malloc(f, sizeof(mults[0]) * c->lookup_values); - if (mults == NULL) return error(f, VORBIS_outofmem); - for (j=0; j < (int) c->lookup_values; ++j) { - int q = get_bits(f, c->value_bits); - if (q == EOP) { setup_temp_free(f,mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_invalid_setup); } - mults[j] = q; - } - -#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK - if (c->lookup_type == 1) { - int len, sparse = c->sparse; - float last=0; - // pre-expand the lookup1-style multiplicands, to avoid a divide in the inner loop - if (sparse) { - if (c->sorted_entries == 0) goto skip; - c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->sorted_entries * c->dimensions); - } else - c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->entries * c->dimensions); - if (c->multiplicands == NULL) { setup_temp_free(f,mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_outofmem); } - len = sparse ? c->sorted_entries : c->entries; - for (j=0; j < len; ++j) { - unsigned int z = sparse ? c->sorted_values[j] : j; - unsigned int div=1; - for (k=0; k < c->dimensions; ++k) { - int off = (z / div) % c->lookup_values; - float val = mults[off]*c->delta_value + c->minimum_value + last; - c->multiplicands[j*c->dimensions + k] = val; - if (c->sequence_p) - last = val; - if (k+1 < c->dimensions) { - if (div > UINT_MAX / (unsigned int) c->lookup_values) { - setup_temp_free(f, mults,sizeof(mults[0])*c->lookup_values); - return error(f, VORBIS_invalid_setup); - } - div *= c->lookup_values; - } - } - } - c->lookup_type = 2; - } - else -#endif - { - float last=0; - CHECK(f); - c->multiplicands = (codetype *) setup_malloc(f, sizeof(c->multiplicands[0]) * c->lookup_values); - if (c->multiplicands == NULL) { setup_temp_free(f, mults,sizeof(mults[0])*c->lookup_values); return error(f, VORBIS_outofmem); } - for (j=0; j < (int) c->lookup_values; ++j) { - float val = mults[j] * c->delta_value + c->minimum_value + last; - c->multiplicands[j] = val; - if (c->sequence_p) - last = val; - } - } -#ifndef STB_VORBIS_DIVIDES_IN_CODEBOOK - skip:; -#endif - setup_temp_free(f, mults, sizeof(mults[0])*c->lookup_values); - - CHECK(f); - } - CHECK(f); - } - - // time domain transfers (notused) - - x = get_bits(f, 6) + 1; - for (i=0; i < x; ++i) { - uint32 z = get_bits(f, 16); - if (z != 0) return error(f, VORBIS_invalid_setup); - } - - // Floors - f->floor_count = get_bits(f, 6)+1; - f->floor_config = (Floor *) setup_malloc(f, f->floor_count * sizeof(*f->floor_config)); - if (f->floor_config == NULL) return error(f, VORBIS_outofmem); - for (i=0; i < f->floor_count; ++i) { - f->floor_types[i] = get_bits(f, 16); - if (f->floor_types[i] > 1) return error(f, VORBIS_invalid_setup); - if (f->floor_types[i] == 0) { - Floor0 *g = &f->floor_config[i].floor0; - g->order = get_bits(f,8); - g->rate = get_bits(f,16); - g->bark_map_size = get_bits(f,16); - g->amplitude_bits = get_bits(f,6); - g->amplitude_offset = get_bits(f,8); - g->number_of_books = get_bits(f,4) + 1; - for (j=0; j < g->number_of_books; ++j) - g->book_list[j] = get_bits(f,8); - return error(f, VORBIS_feature_not_supported); - } else { - stbv__floor_ordering p[31*8+2]; - Floor1 *g = &f->floor_config[i].floor1; - int max_class = -1; - g->partitions = get_bits(f, 5); - for (j=0; j < g->partitions; ++j) { - g->partition_class_list[j] = get_bits(f, 4); - if (g->partition_class_list[j] > max_class) - max_class = g->partition_class_list[j]; - } - for (j=0; j <= max_class; ++j) { - g->class_dimensions[j] = get_bits(f, 3)+1; - g->class_subclasses[j] = get_bits(f, 2); - if (g->class_subclasses[j]) { - g->class_masterbooks[j] = get_bits(f, 8); - if (g->class_masterbooks[j] >= f->codebook_count) return error(f, VORBIS_invalid_setup); - } - for (k=0; k < 1 << g->class_subclasses[j]; ++k) { - g->subclass_books[j][k] = (int16)get_bits(f,8)-1; - if (g->subclass_books[j][k] >= f->codebook_count) return error(f, VORBIS_invalid_setup); - } - } - g->floor1_multiplier = get_bits(f,2)+1; - g->rangebits = get_bits(f,4); - g->Xlist[0] = 0; - g->Xlist[1] = 1 << g->rangebits; - g->values = 2; - for (j=0; j < g->partitions; ++j) { - int c = g->partition_class_list[j]; - for (k=0; k < g->class_dimensions[c]; ++k) { - g->Xlist[g->values] = get_bits(f, g->rangebits); - ++g->values; - } - } - // precompute the sorting - for (j=0; j < g->values; ++j) { - p[j].x = g->Xlist[j]; - p[j].id = j; - } - qsort(p, g->values, sizeof(p[0]), point_compare); - for (j=0; j < g->values-1; ++j) - if (p[j].x == p[j+1].x) - return error(f, VORBIS_invalid_setup); - for (j=0; j < g->values; ++j) - g->sorted_order[j] = (uint8) p[j].id; - // precompute the neighbors - for (j=2; j < g->values; ++j) { - int low = 0,hi = 0; - neighbors(g->Xlist, j, &low,&hi); - g->neighbors[j][0] = low; - g->neighbors[j][1] = hi; - } - - if (g->values > longest_floorlist) - longest_floorlist = g->values; - } - } - - // Residue - f->residue_count = get_bits(f, 6)+1; - f->residue_config = (Residue *) setup_malloc(f, f->residue_count * sizeof(f->residue_config[0])); - if (f->residue_config == NULL) return error(f, VORBIS_outofmem); - memset(f->residue_config, 0, f->residue_count * sizeof(f->residue_config[0])); - for (i=0; i < f->residue_count; ++i) { - uint8 residue_cascade[64]; - Residue *r = f->residue_config+i; - f->residue_types[i] = get_bits(f, 16); - if (f->residue_types[i] > 2) return error(f, VORBIS_invalid_setup); - r->begin = get_bits(f, 24); - r->end = get_bits(f, 24); - if (r->end < r->begin) return error(f, VORBIS_invalid_setup); - r->part_size = get_bits(f,24)+1; - r->classifications = get_bits(f,6)+1; - r->classbook = get_bits(f,8); - if (r->classbook >= f->codebook_count) return error(f, VORBIS_invalid_setup); - for (j=0; j < r->classifications; ++j) { - uint8 high_bits=0; - uint8 low_bits=get_bits(f,3); - if (get_bits(f,1)) - high_bits = get_bits(f,5); - residue_cascade[j] = high_bits*8 + low_bits; - } - r->residue_books = (short (*)[8]) setup_malloc(f, sizeof(r->residue_books[0]) * r->classifications); - if (r->residue_books == NULL) return error(f, VORBIS_outofmem); - for (j=0; j < r->classifications; ++j) { - for (k=0; k < 8; ++k) { - if (residue_cascade[j] & (1 << k)) { - r->residue_books[j][k] = get_bits(f, 8); - if (r->residue_books[j][k] >= f->codebook_count) return error(f, VORBIS_invalid_setup); - } else { - r->residue_books[j][k] = -1; - } - } - } - // precompute the classifications[] array to avoid inner-loop mod/divide - // call it 'classdata' since we already have r->classifications - r->classdata = (uint8 **) setup_malloc(f, sizeof(*r->classdata) * f->codebooks[r->classbook].entries); - if (!r->classdata) return error(f, VORBIS_outofmem); - memset(r->classdata, 0, sizeof(*r->classdata) * f->codebooks[r->classbook].entries); - for (j=0; j < f->codebooks[r->classbook].entries; ++j) { - int classwords = f->codebooks[r->classbook].dimensions; - int temp = j; - r->classdata[j] = (uint8 *) setup_malloc(f, sizeof(r->classdata[j][0]) * classwords); - if (r->classdata[j] == NULL) return error(f, VORBIS_outofmem); - for (k=classwords-1; k >= 0; --k) { - r->classdata[j][k] = temp % r->classifications; - temp /= r->classifications; - } - } - } - - f->mapping_count = get_bits(f,6)+1; - f->mapping = (Mapping *) setup_malloc(f, f->mapping_count * sizeof(*f->mapping)); - if (f->mapping == NULL) return error(f, VORBIS_outofmem); - memset(f->mapping, 0, f->mapping_count * sizeof(*f->mapping)); - for (i=0; i < f->mapping_count; ++i) { - Mapping *m = f->mapping + i; - int mapping_type = get_bits(f,16); - if (mapping_type != 0) return error(f, VORBIS_invalid_setup); - m->chan = (MappingChannel *) setup_malloc(f, f->channels * sizeof(*m->chan)); - if (m->chan == NULL) return error(f, VORBIS_outofmem); - if (get_bits(f,1)) - m->submaps = get_bits(f,4)+1; - else - m->submaps = 1; - if (m->submaps > max_submaps) - max_submaps = m->submaps; - if (get_bits(f,1)) { - m->coupling_steps = get_bits(f,8)+1; - if (m->coupling_steps > f->channels) return error(f, VORBIS_invalid_setup); - for (k=0; k < m->coupling_steps; ++k) { - m->chan[k].magnitude = get_bits(f, ilog(f->channels-1)); - m->chan[k].angle = get_bits(f, ilog(f->channels-1)); - if (m->chan[k].magnitude >= f->channels) return error(f, VORBIS_invalid_setup); - if (m->chan[k].angle >= f->channels) return error(f, VORBIS_invalid_setup); - if (m->chan[k].magnitude == m->chan[k].angle) return error(f, VORBIS_invalid_setup); - } - } else - m->coupling_steps = 0; - - // reserved field - if (get_bits(f,2)) return error(f, VORBIS_invalid_setup); - if (m->submaps > 1) { - for (j=0; j < f->channels; ++j) { - m->chan[j].mux = get_bits(f, 4); - if (m->chan[j].mux >= m->submaps) return error(f, VORBIS_invalid_setup); - } - } else - // @SPECIFICATION: this case is missing from the spec - for (j=0; j < f->channels; ++j) - m->chan[j].mux = 0; - - for (j=0; j < m->submaps; ++j) { - get_bits(f,8); // discard - m->submap_floor[j] = get_bits(f,8); - m->submap_residue[j] = get_bits(f,8); - if (m->submap_floor[j] >= f->floor_count) return error(f, VORBIS_invalid_setup); - if (m->submap_residue[j] >= f->residue_count) return error(f, VORBIS_invalid_setup); - } - } - - // Modes - f->mode_count = get_bits(f, 6)+1; - for (i=0; i < f->mode_count; ++i) { - Mode *m = f->mode_config+i; - m->blockflag = get_bits(f,1); - m->windowtype = get_bits(f,16); - m->transformtype = get_bits(f,16); - m->mapping = get_bits(f,8); - if (m->windowtype != 0) return error(f, VORBIS_invalid_setup); - if (m->transformtype != 0) return error(f, VORBIS_invalid_setup); - if (m->mapping >= f->mapping_count) return error(f, VORBIS_invalid_setup); - } - - flush_packet(f); - - f->previous_length = 0; - - for (i=0; i < f->channels; ++i) { - f->channel_buffers[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1); - f->previous_window[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1/2); - f->finalY[i] = (int16 *) setup_malloc(f, sizeof(int16) * longest_floorlist); - if (f->channel_buffers[i] == NULL || f->previous_window[i] == NULL || f->finalY[i] == NULL) return error(f, VORBIS_outofmem); - memset(f->channel_buffers[i], 0, sizeof(float) * f->blocksize_1); - #ifdef STB_VORBIS_NO_DEFER_FLOOR - f->floor_buffers[i] = (float *) setup_malloc(f, sizeof(float) * f->blocksize_1/2); - if (f->floor_buffers[i] == NULL) return error(f, VORBIS_outofmem); - #endif - } - - if (!init_blocksize(f, 0, f->blocksize_0)) return FALSE; - if (!init_blocksize(f, 1, f->blocksize_1)) return FALSE; - f->blocksize[0] = f->blocksize_0; - f->blocksize[1] = f->blocksize_1; - -#ifdef STB_VORBIS_DIVIDE_TABLE - if (integer_divide_table[1][1]==0) - for (i=0; i < DIVTAB_NUMER; ++i) - for (j=1; j < DIVTAB_DENOM; ++j) - integer_divide_table[i][j] = i / j; -#endif - - // compute how much temporary memory is needed - - // 1. - { - uint32 imdct_mem = (f->blocksize_1 * sizeof(float) >> 1); - uint32 classify_mem; - int i,max_part_read=0; - for (i=0; i < f->residue_count; ++i) { - Residue *r = f->residue_config + i; - unsigned int actual_size = f->blocksize_1 / 2; - unsigned int limit_r_begin = r->begin < actual_size ? r->begin : actual_size; - unsigned int limit_r_end = r->end < actual_size ? r->end : actual_size; - int n_read = limit_r_end - limit_r_begin; - int part_read = n_read / r->part_size; - if (part_read > max_part_read) - max_part_read = part_read; - } - #ifndef STB_VORBIS_DIVIDES_IN_RESIDUE - classify_mem = f->channels * (sizeof(void*) + max_part_read * sizeof(uint8 *)); - #else - classify_mem = f->channels * (sizeof(void*) + max_part_read * sizeof(int *)); - #endif - - // maximum reasonable partition size is f->blocksize_1 - - f->temp_memory_required = classify_mem; - if (imdct_mem > f->temp_memory_required) - f->temp_memory_required = imdct_mem; - } - - - if (f->alloc.alloc_buffer) { - assert(f->temp_offset == f->alloc.alloc_buffer_length_in_bytes); - // check if there's enough temp memory so we don't error later - if (f->setup_offset + sizeof(*f) + f->temp_memory_required > (unsigned) f->temp_offset) - return error(f, VORBIS_outofmem); - } - - // @TODO: stb_vorbis_seek_start expects first_audio_page_offset to point to a page - // without PAGEFLAG_continued_packet, so this either points to the first page, or - // the page after the end of the headers. It might be cleaner to point to a page - // in the middle of the headers, when that's the page where the first audio packet - // starts, but we'd have to also correctly skip the end of any continued packet in - // stb_vorbis_seek_start. - if (f->next_seg == -1) { - f->first_audio_page_offset = stb_vorbis_get_file_offset(f); - } else { - f->first_audio_page_offset = 0; - } - - return TRUE; -} - -static void vorbis_deinit(stb_vorbis *p) -{ - int i,j; - - setup_free(p, p->vendor); - for (i=0; i < p->comment_list_length; ++i) { - setup_free(p, p->comment_list[i]); - } - setup_free(p, p->comment_list); - - if (p->residue_config) { - for (i=0; i < p->residue_count; ++i) { - Residue *r = p->residue_config+i; - if (r->classdata) { - for (j=0; j < p->codebooks[r->classbook].entries; ++j) - setup_free(p, r->classdata[j]); - setup_free(p, r->classdata); - } - setup_free(p, r->residue_books); - } - } - - if (p->codebooks) { - CHECK(p); - for (i=0; i < p->codebook_count; ++i) { - Codebook *c = p->codebooks + i; - setup_free(p, c->codeword_lengths); - setup_free(p, c->multiplicands); - setup_free(p, c->codewords); - setup_free(p, c->sorted_codewords); - // c->sorted_values[-1] is the first entry in the array - setup_free(p, c->sorted_values ? c->sorted_values-1 : NULL); - } - setup_free(p, p->codebooks); - } - setup_free(p, p->floor_config); - setup_free(p, p->residue_config); - if (p->mapping) { - for (i=0; i < p->mapping_count; ++i) - setup_free(p, p->mapping[i].chan); - setup_free(p, p->mapping); - } - CHECK(p); - for (i=0; i < p->channels && i < STB_VORBIS_MAX_CHANNELS; ++i) { - setup_free(p, p->channel_buffers[i]); - setup_free(p, p->previous_window[i]); - #ifdef STB_VORBIS_NO_DEFER_FLOOR - setup_free(p, p->floor_buffers[i]); - #endif - setup_free(p, p->finalY[i]); - } - for (i=0; i < 2; ++i) { - setup_free(p, p->A[i]); - setup_free(p, p->B[i]); - setup_free(p, p->C[i]); - setup_free(p, p->window[i]); - setup_free(p, p->bit_reverse[i]); - } - #ifndef STB_VORBIS_NO_STDIO - if (p->close_on_free) fclose(p->f); - #endif -} - -void stb_vorbis_close(stb_vorbis *p) -{ - if (p == NULL) return; - vorbis_deinit(p); - setup_free(p,p); -} - -static void vorbis_init(stb_vorbis *p, const stb_vorbis_alloc *z) -{ - memset(p, 0, sizeof(*p)); // NULL out all malloc'd pointers to start - if (z) { - p->alloc = *z; - p->alloc.alloc_buffer_length_in_bytes &= ~7; - p->temp_offset = p->alloc.alloc_buffer_length_in_bytes; - } - p->eof = 0; - p->error = VORBIS__no_error; - p->stream = NULL; - p->codebooks = NULL; - p->page_crc_tests = -1; - #ifndef STB_VORBIS_NO_STDIO - p->close_on_free = FALSE; - p->f = NULL; - #endif -} - -int stb_vorbis_get_sample_offset(stb_vorbis *f) -{ - if (f->current_loc_valid) - return f->current_loc; - else - return -1; -} - -stb_vorbis_info stb_vorbis_get_info(stb_vorbis *f) -{ - stb_vorbis_info d; - d.channels = f->channels; - d.sample_rate = f->sample_rate; - d.setup_memory_required = f->setup_memory_required; - d.setup_temp_memory_required = f->setup_temp_memory_required; - d.temp_memory_required = f->temp_memory_required; - d.max_frame_size = f->blocksize_1 >> 1; - return d; -} - -stb_vorbis_comment stb_vorbis_get_comment(stb_vorbis *f) -{ - stb_vorbis_comment d; - d.vendor = f->vendor; - d.comment_list_length = f->comment_list_length; - d.comment_list = f->comment_list; - return d; -} - -int stb_vorbis_get_error(stb_vorbis *f) -{ - int e = f->error; - f->error = VORBIS__no_error; - return e; -} - -static stb_vorbis * vorbis_alloc(stb_vorbis *f) -{ - stb_vorbis *p = (stb_vorbis *) setup_malloc(f, sizeof(*p)); - return p; -} - -#ifndef STB_VORBIS_NO_PUSHDATA_API - -void stb_vorbis_flush_pushdata(stb_vorbis *f) -{ - f->previous_length = 0; - f->page_crc_tests = 0; - f->discard_samples_deferred = 0; - f->current_loc_valid = FALSE; - f->first_decode = FALSE; - f->samples_output = 0; - f->channel_buffer_start = 0; - f->channel_buffer_end = 0; -} - -static int vorbis_search_for_page_pushdata(vorb *f, uint8 *data, int data_len) -{ - int i,n; - for (i=0; i < f->page_crc_tests; ++i) - f->scan[i].bytes_done = 0; - - // if we have room for more scans, search for them first, because - // they may cause us to stop early if their header is incomplete - if (f->page_crc_tests < STB_VORBIS_PUSHDATA_CRC_COUNT) { - if (data_len < 4) return 0; - data_len -= 3; // need to look for 4-byte sequence, so don't miss - // one that straddles a boundary - for (i=0; i < data_len; ++i) { - if (data[i] == 0x4f) { - if (0==memcmp(data+i, ogg_page_header, 4)) { - int j,len; - uint32 crc; - // make sure we have the whole page header - if (i+26 >= data_len || i+27+data[i+26] >= data_len) { - // only read up to this page start, so hopefully we'll - // have the whole page header start next time - data_len = i; - break; - } - // ok, we have it all; compute the length of the page - len = 27 + data[i+26]; - for (j=0; j < data[i+26]; ++j) - len += data[i+27+j]; - // scan everything up to the embedded crc (which we must 0) - crc = 0; - for (j=0; j < 22; ++j) - crc = crc32_update(crc, data[i+j]); - // now process 4 0-bytes - for ( ; j < 26; ++j) - crc = crc32_update(crc, 0); - // len is the total number of bytes we need to scan - n = f->page_crc_tests++; - f->scan[n].bytes_left = len-j; - f->scan[n].crc_so_far = crc; - f->scan[n].goal_crc = data[i+22] + (data[i+23] << 8) + (data[i+24]<<16) + (data[i+25]<<24); - // if the last frame on a page is continued to the next, then - // we can't recover the sample_loc immediately - if (data[i+27+data[i+26]-1] == 255) - f->scan[n].sample_loc = ~0; - else - f->scan[n].sample_loc = data[i+6] + (data[i+7] << 8) + (data[i+ 8]<<16) + (data[i+ 9]<<24); - f->scan[n].bytes_done = i+j; - if (f->page_crc_tests == STB_VORBIS_PUSHDATA_CRC_COUNT) - break; - // keep going if we still have room for more - } - } - } - } - - for (i=0; i < f->page_crc_tests;) { - uint32 crc; - int j; - int n = f->scan[i].bytes_done; - int m = f->scan[i].bytes_left; - if (m > data_len - n) m = data_len - n; - // m is the bytes to scan in the current chunk - crc = f->scan[i].crc_so_far; - for (j=0; j < m; ++j) - crc = crc32_update(crc, data[n+j]); - f->scan[i].bytes_left -= m; - f->scan[i].crc_so_far = crc; - if (f->scan[i].bytes_left == 0) { - // does it match? - if (f->scan[i].crc_so_far == f->scan[i].goal_crc) { - // Houston, we have page - data_len = n+m; // consumption amount is wherever that scan ended - f->page_crc_tests = -1; // drop out of page scan mode - f->previous_length = 0; // decode-but-don't-output one frame - f->next_seg = -1; // start a new page - f->current_loc = f->scan[i].sample_loc; // set the current sample location - // to the amount we'd have decoded had we decoded this page - f->current_loc_valid = f->current_loc != ~0U; - return data_len; - } - // delete entry - f->scan[i] = f->scan[--f->page_crc_tests]; - } else { - ++i; - } - } - - return data_len; -} - -// return value: number of bytes we used -int stb_vorbis_decode_frame_pushdata( - stb_vorbis *f, // the file we're decoding - const uint8 *data, int data_len, // the memory available for decoding - int *channels, // place to write number of float * buffers - float ***output, // place to write float ** array of float * buffers - int *samples // place to write number of output samples - ) -{ - int i; - int len,right,left; - - if (!IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); - - if (f->page_crc_tests >= 0) { - *samples = 0; - return vorbis_search_for_page_pushdata(f, (uint8 *) data, data_len); - } - - f->stream = (uint8 *) data; - f->stream_end = (uint8 *) data + data_len; - f->error = VORBIS__no_error; - - // check that we have the entire packet in memory - if (!is_whole_packet_present(f)) { - *samples = 0; - return 0; - } - - if (!vorbis_decode_packet(f, &len, &left, &right)) { - // save the actual error we encountered - enum STBVorbisError error = f->error; - if (error == VORBIS_bad_packet_type) { - // flush and resynch - f->error = VORBIS__no_error; - while (get8_packet(f) != EOP) - if (f->eof) break; - *samples = 0; - return (int) (f->stream - data); - } - if (error == VORBIS_continued_packet_flag_invalid) { - if (f->previous_length == 0) { - // we may be resynching, in which case it's ok to hit one - // of these; just discard the packet - f->error = VORBIS__no_error; - while (get8_packet(f) != EOP) - if (f->eof) break; - *samples = 0; - return (int) (f->stream - data); - } - } - // if we get an error while parsing, what to do? - // well, it DEFINITELY won't work to continue from where we are! - stb_vorbis_flush_pushdata(f); - // restore the error that actually made us bail - f->error = error; - *samples = 0; - return 1; - } - - // success! - len = vorbis_finish_frame(f, len, left, right); - for (i=0; i < f->channels; ++i) - f->outputs[i] = f->channel_buffers[i] + left; - - if (channels) *channels = f->channels; - *samples = len; - *output = f->outputs; - return (int) (f->stream - data); -} - -stb_vorbis *stb_vorbis_open_pushdata( - const unsigned char *data, int data_len, // the memory available for decoding - int *data_used, // only defined if result is not NULL - int *error, const stb_vorbis_alloc *alloc) -{ - stb_vorbis *f, p; - vorbis_init(&p, alloc); - p.stream = (uint8 *) data; - p.stream_end = (uint8 *) data + data_len; - p.push_mode = TRUE; - if (!start_decoder(&p)) { - if (p.eof) - *error = VORBIS_need_more_data; - else - *error = p.error; - vorbis_deinit(&p); - return NULL; - } - f = vorbis_alloc(&p); - if (f) { - *f = p; - *data_used = (int) (f->stream - data); - *error = 0; - return f; - } else { - vorbis_deinit(&p); - return NULL; - } -} -#endif // STB_VORBIS_NO_PUSHDATA_API - -unsigned int stb_vorbis_get_file_offset(stb_vorbis *f) -{ - #ifndef STB_VORBIS_NO_PUSHDATA_API - if (f->push_mode) return 0; - #endif - if (USE_MEMORY(f)) return (unsigned int) (f->stream - f->stream_start); - #ifndef STB_VORBIS_NO_STDIO - return (unsigned int) (ftell(f->f) - f->f_start); - #endif -} - -#ifndef STB_VORBIS_NO_PULLDATA_API -// -// DATA-PULLING API -// - -static uint32 vorbis_find_page(stb_vorbis *f, uint32 *end, uint32 *last) -{ - for(;;) { - int n; - if (f->eof) return 0; - n = get8(f); - if (n == 0x4f) { // page header candidate - unsigned int retry_loc = stb_vorbis_get_file_offset(f); - int i; - // check if we're off the end of a file_section stream - if (retry_loc - 25 > f->stream_len) - return 0; - // check the rest of the header - for (i=1; i < 4; ++i) - if (get8(f) != ogg_page_header[i]) - break; - if (f->eof) return 0; - if (i == 4) { - uint8 header[27]; - uint32 i, crc, goal, len; - for (i=0; i < 4; ++i) - header[i] = ogg_page_header[i]; - for (; i < 27; ++i) - header[i] = get8(f); - if (f->eof) return 0; - if (header[4] != 0) goto invalid; - goal = header[22] + (header[23] << 8) + (header[24]<<16) + ((uint32)header[25]<<24); - for (i=22; i < 26; ++i) - header[i] = 0; - crc = 0; - for (i=0; i < 27; ++i) - crc = crc32_update(crc, header[i]); - len = 0; - for (i=0; i < header[26]; ++i) { - int s = get8(f); - crc = crc32_update(crc, s); - len += s; - } - if (len && f->eof) return 0; - for (i=0; i < len; ++i) - crc = crc32_update(crc, get8(f)); - // finished parsing probable page - if (crc == goal) { - // we could now check that it's either got the last - // page flag set, OR it's followed by the capture - // pattern, but I guess TECHNICALLY you could have - // a file with garbage between each ogg page and recover - // from it automatically? So even though that paranoia - // might decrease the chance of an invalid decode by - // another 2^32, not worth it since it would hose those - // invalid-but-useful files? - if (end) - *end = stb_vorbis_get_file_offset(f); - if (last) { - if (header[5] & 0x04) - *last = 1; - else - *last = 0; - } - set_file_offset(f, retry_loc-1); - return 1; - } - } - invalid: - // not a valid page, so rewind and look for next one - set_file_offset(f, retry_loc); - } - } -} - - -#define SAMPLE_unknown 0xffffffff - -// seeking is implemented with a binary search, which narrows down the range to -// 64K, before using a linear search (because finding the synchronization -// pattern can be expensive, and the chance we'd find the end page again is -// relatively high for small ranges) -// -// two initial interpolation-style probes are used at the start of the search -// to try to bound either side of the binary search sensibly, while still -// working in O(log n) time if they fail. - -static int get_seek_page_info(stb_vorbis *f, ProbedPage *z) -{ - uint8 header[27], lacing[255]; - int i,len; - - // record where the page starts - z->page_start = stb_vorbis_get_file_offset(f); - - // parse the header - getn(f, header, 27); - if (header[0] != 'O' || header[1] != 'g' || header[2] != 'g' || header[3] != 'S') - return 0; - getn(f, lacing, header[26]); - - // determine the length of the payload - len = 0; - for (i=0; i < header[26]; ++i) - len += lacing[i]; - - // this implies where the page ends - z->page_end = z->page_start + 27 + header[26] + len; - - // read the last-decoded sample out of the data - z->last_decoded_sample = header[6] + (header[7] << 8) + (header[8] << 16) + (header[9] << 24); - - // restore file state to where we were - set_file_offset(f, z->page_start); - return 1; -} - -// rarely used function to seek back to the preceding page while finding the -// start of a packet -static int go_to_page_before(stb_vorbis *f, unsigned int limit_offset) -{ - unsigned int previous_safe, end; - - // now we want to seek back 64K from the limit - if (limit_offset >= 65536 && limit_offset-65536 >= f->first_audio_page_offset) - previous_safe = limit_offset - 65536; - else - previous_safe = f->first_audio_page_offset; - - set_file_offset(f, previous_safe); - - while (vorbis_find_page(f, &end, NULL)) { - if (end >= limit_offset && stb_vorbis_get_file_offset(f) < limit_offset) - return 1; - set_file_offset(f, end); - } - - return 0; -} - -// implements the search logic for finding a page and starting decoding. if -// the function succeeds, current_loc_valid will be true and current_loc will -// be less than or equal to the provided sample number (the closer the -// better). -static int seek_to_sample_coarse(stb_vorbis *f, uint32 sample_number) -{ - ProbedPage left, right, mid; - int i, start_seg_with_known_loc, end_pos, page_start; - uint32 delta, stream_length, padding, last_sample_limit; - double offset = 0.0, bytes_per_sample = 0.0; - int probe = 0; - - // find the last page and validate the target sample - stream_length = stb_vorbis_stream_length_in_samples(f); - if (stream_length == 0) return error(f, VORBIS_seek_without_length); - if (sample_number > stream_length) return error(f, VORBIS_seek_invalid); - - // this is the maximum difference between the window-center (which is the - // actual granule position value), and the right-start (which the spec - // indicates should be the granule position (give or take one)). - padding = ((f->blocksize_1 - f->blocksize_0) >> 2); - if (sample_number < padding) - last_sample_limit = 0; - else - last_sample_limit = sample_number - padding; - - left = f->p_first; - while (left.last_decoded_sample == ~0U) { - // (untested) the first page does not have a 'last_decoded_sample' - set_file_offset(f, left.page_end); - if (!get_seek_page_info(f, &left)) goto error; - } - - right = f->p_last; - assert(right.last_decoded_sample != ~0U); - - // starting from the start is handled differently - if (last_sample_limit <= left.last_decoded_sample) { - if (stb_vorbis_seek_start(f)) { - if (f->current_loc > sample_number) - return error(f, VORBIS_seek_failed); - return 1; - } - return 0; - } - - while (left.page_end != right.page_start) { - assert(left.page_end < right.page_start); - // search range in bytes - delta = right.page_start - left.page_end; - if (delta <= 65536) { - // there's only 64K left to search - handle it linearly - set_file_offset(f, left.page_end); - } else { - if (probe < 2) { - if (probe == 0) { - // first probe (interpolate) - double data_bytes = right.page_end - left.page_start; - bytes_per_sample = data_bytes / right.last_decoded_sample; - offset = left.page_start + bytes_per_sample * (last_sample_limit - left.last_decoded_sample); - } else { - // second probe (try to bound the other side) - double error = ((double) last_sample_limit - mid.last_decoded_sample) * bytes_per_sample; - if (error >= 0 && error < 8000) error = 8000; - if (error < 0 && error > -8000) error = -8000; - offset += error * 2; - } - - // ensure the offset is valid - if (offset < left.page_end) - offset = left.page_end; - if (offset > right.page_start - 65536) - offset = right.page_start - 65536; - - set_file_offset(f, (unsigned int) offset); - } else { - // binary search for large ranges (offset by 32K to ensure - // we don't hit the right page) - set_file_offset(f, left.page_end + (delta / 2) - 32768); - } - - if (!vorbis_find_page(f, NULL, NULL)) goto error; - } - - for (;;) { - if (!get_seek_page_info(f, &mid)) goto error; - if (mid.last_decoded_sample != ~0U) break; - // (untested) no frames end on this page - set_file_offset(f, mid.page_end); - assert(mid.page_start < right.page_start); - } - - // if we've just found the last page again then we're in a tricky file, - // and we're close enough (if it wasn't an interpolation probe). - if (mid.page_start == right.page_start) { - if (probe >= 2 || delta <= 65536) - break; - } else { - if (last_sample_limit < mid.last_decoded_sample) - right = mid; - else - left = mid; - } - - ++probe; - } - - // seek back to start of the last packet - page_start = left.page_start; - set_file_offset(f, page_start); - if (!start_page(f)) return error(f, VORBIS_seek_failed); - end_pos = f->end_seg_with_known_loc; - assert(end_pos >= 0); - - for (;;) { - for (i = end_pos; i > 0; --i) - if (f->segments[i-1] != 255) - break; - - start_seg_with_known_loc = i; - - if (start_seg_with_known_loc > 0 || !(f->page_flag & PAGEFLAG_continued_packet)) - break; - - // (untested) the final packet begins on an earlier page - if (!go_to_page_before(f, page_start)) - goto error; - - page_start = stb_vorbis_get_file_offset(f); - if (!start_page(f)) goto error; - end_pos = f->segment_count - 1; - } - - // prepare to start decoding - f->current_loc_valid = FALSE; - f->last_seg = FALSE; - f->valid_bits = 0; - f->packet_bytes = 0; - f->bytes_in_seg = 0; - f->previous_length = 0; - f->next_seg = start_seg_with_known_loc; - - for (i = 0; i < start_seg_with_known_loc; i++) - skip(f, f->segments[i]); - - // start decoding (optimizable - this frame is generally discarded) - if (!vorbis_pump_first_frame(f)) - return 0; - if (f->current_loc > sample_number) - return error(f, VORBIS_seek_failed); - return 1; - -error: - // try to restore the file to a valid state - stb_vorbis_seek_start(f); - return error(f, VORBIS_seek_failed); -} - -// the same as vorbis_decode_initial, but without advancing -static int peek_decode_initial(vorb *f, int *p_left_start, int *p_left_end, int *p_right_start, int *p_right_end, int *mode) -{ - int bits_read, bytes_read; - - if (!vorbis_decode_initial(f, p_left_start, p_left_end, p_right_start, p_right_end, mode)) - return 0; - - // either 1 or 2 bytes were read, figure out which so we can rewind - bits_read = 1 + ilog(f->mode_count-1); - if (f->mode_config[*mode].blockflag) - bits_read += 2; - bytes_read = (bits_read + 7) / 8; - - f->bytes_in_seg += bytes_read; - f->packet_bytes -= bytes_read; - skip(f, -bytes_read); - if (f->next_seg == -1) - f->next_seg = f->segment_count - 1; - else - f->next_seg--; - f->valid_bits = 0; - - return 1; -} - -int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number) -{ - uint32 max_frame_samples; - - if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); - - // fast page-level search - if (!seek_to_sample_coarse(f, sample_number)) - return 0; - - assert(f->current_loc_valid); - assert(f->current_loc <= sample_number); - - // linear search for the relevant packet - max_frame_samples = (f->blocksize_1*3 - f->blocksize_0) >> 2; - while (f->current_loc < sample_number) { - int left_start, left_end, right_start, right_end, mode, frame_samples; - if (!peek_decode_initial(f, &left_start, &left_end, &right_start, &right_end, &mode)) - return error(f, VORBIS_seek_failed); - // calculate the number of samples returned by the next frame - frame_samples = right_start - left_start; - if (f->current_loc + frame_samples > sample_number) { - return 1; // the next frame will contain the sample - } else if (f->current_loc + frame_samples + max_frame_samples > sample_number) { - // there's a chance the frame after this could contain the sample - vorbis_pump_first_frame(f); - } else { - // this frame is too early to be relevant - f->current_loc += frame_samples; - f->previous_length = 0; - maybe_start_packet(f); - flush_packet(f); - } - } - // the next frame should start with the sample - if (f->current_loc != sample_number) return error(f, VORBIS_seek_failed); - return 1; -} - -int stb_vorbis_seek(stb_vorbis *f, unsigned int sample_number) -{ - if (!stb_vorbis_seek_frame(f, sample_number)) - return 0; - - if (sample_number != f->current_loc) { - int n; - uint32 frame_start = f->current_loc; - stb_vorbis_get_frame_float(f, &n, NULL); - assert(sample_number > frame_start); - assert(f->channel_buffer_start + (int) (sample_number-frame_start) <= f->channel_buffer_end); - f->channel_buffer_start += (sample_number - frame_start); - } - - return 1; -} - -int stb_vorbis_seek_start(stb_vorbis *f) -{ - if (IS_PUSH_MODE(f)) { return error(f, VORBIS_invalid_api_mixing); } - set_file_offset(f, f->first_audio_page_offset); - f->previous_length = 0; - f->first_decode = TRUE; - f->next_seg = -1; - return vorbis_pump_first_frame(f); -} - -unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f) -{ - unsigned int restore_offset, previous_safe; - unsigned int end, last_page_loc; - - if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); - if (!f->total_samples) { - unsigned int last; - uint32 lo,hi; - char header[6]; - - // first, store the current decode position so we can restore it - restore_offset = stb_vorbis_get_file_offset(f); - - // now we want to seek back 64K from the end (the last page must - // be at most a little less than 64K, but let's allow a little slop) - if (f->stream_len >= 65536 && f->stream_len-65536 >= f->first_audio_page_offset) - previous_safe = f->stream_len - 65536; - else - previous_safe = f->first_audio_page_offset; - - set_file_offset(f, previous_safe); - // previous_safe is now our candidate 'earliest known place that seeking - // to will lead to the final page' - - if (!vorbis_find_page(f, &end, &last)) { - // if we can't find a page, we're hosed! - f->error = VORBIS_cant_find_last_page; - f->total_samples = 0xffffffff; - goto done; - } - - // check if there are more pages - last_page_loc = stb_vorbis_get_file_offset(f); - - // stop when the last_page flag is set, not when we reach eof; - // this allows us to stop short of a 'file_section' end without - // explicitly checking the length of the section - while (!last) { - set_file_offset(f, end); - if (!vorbis_find_page(f, &end, &last)) { - // the last page we found didn't have the 'last page' flag - // set. whoops! - break; - } - //previous_safe = last_page_loc+1; // NOTE: not used after this point, but note for debugging - last_page_loc = stb_vorbis_get_file_offset(f); - } - - set_file_offset(f, last_page_loc); - - // parse the header - getn(f, (unsigned char *)header, 6); - // extract the absolute granule position - lo = get32(f); - hi = get32(f); - if (lo == 0xffffffff && hi == 0xffffffff) { - f->error = VORBIS_cant_find_last_page; - f->total_samples = SAMPLE_unknown; - goto done; - } - if (hi) - lo = 0xfffffffe; // saturate - f->total_samples = lo; - - f->p_last.page_start = last_page_loc; - f->p_last.page_end = end; - f->p_last.last_decoded_sample = lo; - - done: - set_file_offset(f, restore_offset); - } - return f->total_samples == SAMPLE_unknown ? 0 : f->total_samples; -} - -float stb_vorbis_stream_length_in_seconds(stb_vorbis *f) -{ - return stb_vorbis_stream_length_in_samples(f) / (float) f->sample_rate; -} - - - -int stb_vorbis_get_frame_float(stb_vorbis *f, int *channels, float ***output) -{ - int len, right,left,i; - if (IS_PUSH_MODE(f)) return error(f, VORBIS_invalid_api_mixing); - - if (!vorbis_decode_packet(f, &len, &left, &right)) { - f->channel_buffer_start = f->channel_buffer_end = 0; - return 0; - } - - len = vorbis_finish_frame(f, len, left, right); - for (i=0; i < f->channels; ++i) - f->outputs[i] = f->channel_buffers[i] + left; - - f->channel_buffer_start = left; - f->channel_buffer_end = left+len; - - if (channels) *channels = f->channels; - if (output) *output = f->outputs; - return len; -} - -#ifndef STB_VORBIS_NO_STDIO - -stb_vorbis * stb_vorbis_open_file_section(FILE *file, int close_on_free, int *error, const stb_vorbis_alloc *alloc, unsigned int length) -{ - stb_vorbis *f, p; - vorbis_init(&p, alloc); - p.f = file; - p.f_start = (uint32) ftell(file); - p.stream_len = length; - p.close_on_free = close_on_free; - if (start_decoder(&p)) { - f = vorbis_alloc(&p); - if (f) { - *f = p; - vorbis_pump_first_frame(f); - return f; - } - } - if (error) *error = p.error; - vorbis_deinit(&p); - return NULL; -} - -stb_vorbis * stb_vorbis_open_file(FILE *file, int close_on_free, int *error, const stb_vorbis_alloc *alloc) -{ - unsigned int len, start; - start = (unsigned int) ftell(file); - fseek(file, 0, SEEK_END); - len = (unsigned int) (ftell(file) - start); - fseek(file, start, SEEK_SET); - return stb_vorbis_open_file_section(file, close_on_free, error, alloc, len); -} - -stb_vorbis * stb_vorbis_open_filename(const char *filename, int *error, const stb_vorbis_alloc *alloc) -{ - FILE *f; -#if defined(_WIN32) && defined(__STDC_WANT_SECURE_LIB__) - if (0 != fopen_s(&f, filename, "rb")) - f = NULL; -#else - f = fopen(filename, "rb"); -#endif - if (f) - return stb_vorbis_open_file(f, TRUE, error, alloc); - if (error) *error = VORBIS_file_open_failure; - return NULL; -} -#endif // STB_VORBIS_NO_STDIO - -stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, int *error, const stb_vorbis_alloc *alloc) -{ - stb_vorbis *f, p; - if (!data) { - if (error) *error = VORBIS_unexpected_eof; - return NULL; - } - vorbis_init(&p, alloc); - p.stream = (uint8 *) data; - p.stream_end = (uint8 *) data + len; - p.stream_start = (uint8 *) p.stream; - p.stream_len = len; - p.push_mode = FALSE; - if (start_decoder(&p)) { - f = vorbis_alloc(&p); - if (f) { - *f = p; - vorbis_pump_first_frame(f); - if (error) *error = VORBIS__no_error; - return f; - } - } - if (error) *error = p.error; - vorbis_deinit(&p); - return NULL; -} - -#ifndef STB_VORBIS_NO_INTEGER_CONVERSION -#define PLAYBACK_MONO 1 -#define PLAYBACK_LEFT 2 -#define PLAYBACK_RIGHT 4 - -#define L (PLAYBACK_LEFT | PLAYBACK_MONO) -#define C (PLAYBACK_LEFT | PLAYBACK_RIGHT | PLAYBACK_MONO) -#define R (PLAYBACK_RIGHT | PLAYBACK_MONO) - -static int8 channel_position[7][6] = -{ - { 0 }, - { C }, - { L, R }, - { L, C, R }, - { L, R, L, R }, - { L, C, R, L, R }, - { L, C, R, L, R, C }, -}; - - -#ifndef STB_VORBIS_NO_FAST_SCALED_FLOAT - typedef union { - float f; - int i; - } float_conv; - typedef char stb_vorbis_float_size_test[sizeof(float)==4 && sizeof(int) == 4]; - #define FASTDEF(x) float_conv x - // add (1<<23) to convert to int, then divide by 2^SHIFT, then add 0.5/2^SHIFT to round - #define MAGIC(SHIFT) (1.5f * (1 << (23-SHIFT)) + 0.5f/(1 << SHIFT)) - #define ADDEND(SHIFT) (((150-SHIFT) << 23) + (1 << 22)) - #define FAST_SCALED_FLOAT_TO_INT(temp,x,s) (temp.f = (x) + MAGIC(s), temp.i - ADDEND(s)) - #define check_endianness() -#else - #define FAST_SCALED_FLOAT_TO_INT(temp,x,s) ((int) ((x) * (1 << (s)))) - #define check_endianness() - #define FASTDEF(x) -#endif - -static void copy_samples(short *dest, float *src, int len) -{ - int i; - check_endianness(); - for (i=0; i < len; ++i) { - FASTDEF(temp); - int v = FAST_SCALED_FLOAT_TO_INT(temp, src[i],15); - if ((unsigned int) (v + 32768) > 65535) - v = v < 0 ? -32768 : 32767; - dest[i] = v; - } -} - -static void compute_samples(int mask, short *output, int num_c, float **data, int d_offset, int len) -{ - #define STB_BUFFER_SIZE 32 - float buffer[STB_BUFFER_SIZE]; - int i,j,o,n = STB_BUFFER_SIZE; - check_endianness(); - for (o = 0; o < len; o += STB_BUFFER_SIZE) { - memset(buffer, 0, sizeof(buffer)); - if (o + n > len) n = len - o; - for (j=0; j < num_c; ++j) { - if (channel_position[num_c][j] & mask) { - for (i=0; i < n; ++i) - buffer[i] += data[j][d_offset+o+i]; - } - } - for (i=0; i < n; ++i) { - FASTDEF(temp); - int v = FAST_SCALED_FLOAT_TO_INT(temp,buffer[i],15); - if ((unsigned int) (v + 32768) > 65535) - v = v < 0 ? -32768 : 32767; - output[o+i] = v; - } - } - #undef STB_BUFFER_SIZE -} - -static void compute_stereo_samples(short *output, int num_c, float **data, int d_offset, int len) -{ - #define STB_BUFFER_SIZE 32 - float buffer[STB_BUFFER_SIZE]; - int i,j,o,n = STB_BUFFER_SIZE >> 1; - // o is the offset in the source data - check_endianness(); - for (o = 0; o < len; o += STB_BUFFER_SIZE >> 1) { - // o2 is the offset in the output data - int o2 = o << 1; - memset(buffer, 0, sizeof(buffer)); - if (o + n > len) n = len - o; - for (j=0; j < num_c; ++j) { - int m = channel_position[num_c][j] & (PLAYBACK_LEFT | PLAYBACK_RIGHT); - if (m == (PLAYBACK_LEFT | PLAYBACK_RIGHT)) { - for (i=0; i < n; ++i) { - buffer[i*2+0] += data[j][d_offset+o+i]; - buffer[i*2+1] += data[j][d_offset+o+i]; - } - } else if (m == PLAYBACK_LEFT) { - for (i=0; i < n; ++i) { - buffer[i*2+0] += data[j][d_offset+o+i]; - } - } else if (m == PLAYBACK_RIGHT) { - for (i=0; i < n; ++i) { - buffer[i*2+1] += data[j][d_offset+o+i]; - } - } - } - for (i=0; i < (n<<1); ++i) { - FASTDEF(temp); - int v = FAST_SCALED_FLOAT_TO_INT(temp,buffer[i],15); - if ((unsigned int) (v + 32768) > 65535) - v = v < 0 ? -32768 : 32767; - output[o2+i] = v; - } - } - #undef STB_BUFFER_SIZE -} - -static void convert_samples_short(int buf_c, short **buffer, int b_offset, int data_c, float **data, int d_offset, int samples) -{ - int i; - if (buf_c != data_c && buf_c <= 2 && data_c <= 6) { - static int channel_selector[3][2] = { {0}, {PLAYBACK_MONO}, {PLAYBACK_LEFT, PLAYBACK_RIGHT} }; - for (i=0; i < buf_c; ++i) - compute_samples(channel_selector[buf_c][i], buffer[i]+b_offset, data_c, data, d_offset, samples); - } else { - int limit = buf_c < data_c ? buf_c : data_c; - for (i=0; i < limit; ++i) - copy_samples(buffer[i]+b_offset, data[i]+d_offset, samples); - for ( ; i < buf_c; ++i) - memset(buffer[i]+b_offset, 0, sizeof(short) * samples); - } -} - -int stb_vorbis_get_frame_short(stb_vorbis *f, int num_c, short **buffer, int num_samples) -{ - float **output = NULL; - int len = stb_vorbis_get_frame_float(f, NULL, &output); - if (len > num_samples) len = num_samples; - if (len) - convert_samples_short(num_c, buffer, 0, f->channels, output, 0, len); - return len; -} - -static void convert_channels_short_interleaved(int buf_c, short *buffer, int data_c, float **data, int d_offset, int len) -{ - int i; - check_endianness(); - if (buf_c != data_c && buf_c <= 2 && data_c <= 6) { - assert(buf_c == 2); - for (i=0; i < buf_c; ++i) - compute_stereo_samples(buffer, data_c, data, d_offset, len); - } else { - int limit = buf_c < data_c ? buf_c : data_c; - int j; - for (j=0; j < len; ++j) { - for (i=0; i < limit; ++i) { - FASTDEF(temp); - float f = data[i][d_offset+j]; - int v = FAST_SCALED_FLOAT_TO_INT(temp, f,15);//data[i][d_offset+j],15); - if ((unsigned int) (v + 32768) > 65535) - v = v < 0 ? -32768 : 32767; - *buffer++ = v; - } - for ( ; i < buf_c; ++i) - *buffer++ = 0; - } - } -} - -int stb_vorbis_get_frame_short_interleaved(stb_vorbis *f, int num_c, short *buffer, int num_shorts) -{ - float **output; - int len; - if (num_c == 1) return stb_vorbis_get_frame_short(f,num_c,&buffer, num_shorts); - len = stb_vorbis_get_frame_float(f, NULL, &output); - if (len) { - if (len*num_c > num_shorts) len = num_shorts / num_c; - convert_channels_short_interleaved(num_c, buffer, f->channels, output, 0, len); - } - return len; -} - -int stb_vorbis_get_samples_short_interleaved(stb_vorbis *f, int channels, short *buffer, int num_shorts) -{ - float **outputs; - int len = num_shorts / channels; - int n=0; - while (n < len) { - int k = f->channel_buffer_end - f->channel_buffer_start; - if (n+k >= len) k = len - n; - if (k) - convert_channels_short_interleaved(channels, buffer, f->channels, f->channel_buffers, f->channel_buffer_start, k); - buffer += k*channels; - n += k; - f->channel_buffer_start += k; - if (n == len) break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) break; - } - return n; -} - -int stb_vorbis_get_samples_short(stb_vorbis *f, int channels, short **buffer, int len) -{ - float **outputs; - int n=0; - while (n < len) { - int k = f->channel_buffer_end - f->channel_buffer_start; - if (n+k >= len) k = len - n; - if (k) - convert_samples_short(channels, buffer, n, f->channels, f->channel_buffers, f->channel_buffer_start, k); - n += k; - f->channel_buffer_start += k; - if (n == len) break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) break; - } - return n; -} - -#ifndef STB_VORBIS_NO_STDIO -int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output) -{ - int data_len, offset, total, limit, error; - short *data; - stb_vorbis *v = stb_vorbis_open_filename(filename, &error, NULL); - if (v == NULL) return -1; - limit = v->channels * 4096; - *channels = v->channels; - if (sample_rate) - *sample_rate = v->sample_rate; - offset = data_len = 0; - total = limit; - data = (short *) malloc(total * sizeof(*data)); - if (data == NULL) { - stb_vorbis_close(v); - return -2; - } - for (;;) { - int n = stb_vorbis_get_frame_short_interleaved(v, v->channels, data+offset, total-offset); - if (n == 0) break; - data_len += n; - offset += n * v->channels; - if (offset + limit > total) { - short *data2; - total *= 2; - data2 = (short *) realloc(data, total * sizeof(*data)); - if (data2 == NULL) { - free(data); - stb_vorbis_close(v); - return -2; - } - data = data2; - } - } - *output = data; - stb_vorbis_close(v); - return data_len; -} -#endif // NO_STDIO - -int stb_vorbis_decode_memory(const uint8 *mem, int len, int *channels, int *sample_rate, short **output) -{ - int data_len, offset, total, limit, error; - short *data; - stb_vorbis *v = stb_vorbis_open_memory(mem, len, &error, NULL); - if (v == NULL) return -1; - limit = v->channels * 4096; - *channels = v->channels; - if (sample_rate) - *sample_rate = v->sample_rate; - offset = data_len = 0; - total = limit; - data = (short *) malloc(total * sizeof(*data)); - if (data == NULL) { - stb_vorbis_close(v); - return -2; - } - for (;;) { - int n = stb_vorbis_get_frame_short_interleaved(v, v->channels, data+offset, total-offset); - if (n == 0) break; - data_len += n; - offset += n * v->channels; - if (offset + limit > total) { - short *data2; - total *= 2; - data2 = (short *) realloc(data, total * sizeof(*data)); - if (data2 == NULL) { - free(data); - stb_vorbis_close(v); - return -2; - } - data = data2; - } - } - *output = data; - stb_vorbis_close(v); - return data_len; -} -#endif // STB_VORBIS_NO_INTEGER_CONVERSION - -int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats) -{ - float **outputs; - int len = num_floats / channels; - int n=0; - int z = f->channels; - if (z > channels) z = channels; - while (n < len) { - int i,j; - int k = f->channel_buffer_end - f->channel_buffer_start; - if (n+k >= len) k = len - n; - for (j=0; j < k; ++j) { - for (i=0; i < z; ++i) - *buffer++ = f->channel_buffers[i][f->channel_buffer_start+j]; - for ( ; i < channels; ++i) - *buffer++ = 0; - } - n += k; - f->channel_buffer_start += k; - if (n == len) - break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) - break; - } - return n; -} - -int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples) -{ - float **outputs; - int n=0; - int z = f->channels; - if (z > channels) z = channels; - while (n < num_samples) { - int i; - int k = f->channel_buffer_end - f->channel_buffer_start; - if (n+k >= num_samples) k = num_samples - n; - if (k) { - for (i=0; i < z; ++i) - memcpy(buffer[i]+n, f->channel_buffers[i]+f->channel_buffer_start, sizeof(float)*k); - for ( ; i < channels; ++i) - memset(buffer[i]+n, 0, sizeof(float) * k); - } - n += k; - f->channel_buffer_start += k; - if (n == num_samples) - break; - if (!stb_vorbis_get_frame_float(f, NULL, &outputs)) - break; - } - return n; -} -#endif // STB_VORBIS_NO_PULLDATA_API - -/* Version history - 1.17 - 2019-07-08 - fix CVE-2019-13217, -13218, -13219, -13220, -13221, -13222, -13223 - found with Mayhem by ForAllSecure - 1.16 - 2019-03-04 - fix warnings - 1.15 - 2019-02-07 - explicit failure if Ogg Skeleton data is found - 1.14 - 2018-02-11 - delete bogus dealloca usage - 1.13 - 2018-01-29 - fix truncation of last frame (hopefully) - 1.12 - 2017-11-21 - limit residue begin/end to blocksize/2 to avoid large temp allocs in bad/corrupt files - 1.11 - 2017-07-23 - fix MinGW compilation - 1.10 - 2017-03-03 - more robust seeking; fix negative ilog(); clear error in open_memory - 1.09 - 2016-04-04 - back out 'avoid discarding last frame' fix from previous version - 1.08 - 2016-04-02 - fixed multiple warnings; fix setup memory leaks; - avoid discarding last frame of audio data - 1.07 - 2015-01-16 - fixed some warnings, fix mingw, const-correct API - some more crash fixes when out of memory or with corrupt files - 1.06 - 2015-08-31 - full, correct support for seeking API (Dougall Johnson) - some crash fixes when out of memory or with corrupt files - 1.05 - 2015-04-19 - don't define __forceinline if it's redundant - 1.04 - 2014-08-27 - fix missing const-correct case in API - 1.03 - 2014-08-07 - Warning fixes - 1.02 - 2014-07-09 - Declare qsort compare function _cdecl on windows - 1.01 - 2014-06-18 - fix stb_vorbis_get_samples_float - 1.0 - 2014-05-26 - fix memory leaks; fix warnings; fix bugs in multichannel - (API change) report sample rate for decode-full-file funcs - 0.99996 - bracket #include for macintosh compilation by Laurent Gomila - 0.99995 - use union instead of pointer-cast for fast-float-to-int to avoid alias-optimization problem - 0.99994 - change fast-float-to-int to work in single-precision FPU mode, remove endian-dependence - 0.99993 - remove assert that fired on legal files with empty tables - 0.99992 - rewind-to-start - 0.99991 - bugfix to stb_vorbis_get_samples_short by Bernhard Wodo - 0.9999 - (should have been 0.99990) fix no-CRT support, compiling as C++ - 0.9998 - add a full-decode function with a memory source - 0.9997 - fix a bug in the read-from-FILE case in 0.9996 addition - 0.9996 - query length of vorbis stream in samples/seconds - 0.9995 - bugfix to another optimization that only happened in certain files - 0.9994 - bugfix to one of the optimizations that caused significant (but inaudible?) errors - 0.9993 - performance improvements; runs in 99% to 104% of time of reference implementation - 0.9992 - performance improvement of IMDCT; now performs close to reference implementation - 0.9991 - performance improvement of IMDCT - 0.999 - (should have been 0.9990) performance improvement of IMDCT - 0.998 - no-CRT support from Casey Muratori - 0.997 - bugfixes for bugs found by Terje Mathisen - 0.996 - bugfix: fast-huffman decode initialized incorrectly for sparse codebooks; fixing gives 10% speedup - found by Terje Mathisen - 0.995 - bugfix: fix to 'effective' overrun detection - found by Terje Mathisen - 0.994 - bugfix: garbage decode on final VQ symbol of a non-multiple - found by Terje Mathisen - 0.993 - bugfix: pushdata API required 1 extra byte for empty page (failed to consume final page if empty) - found by Terje Mathisen - 0.992 - fixes for MinGW warning - 0.991 - turn fast-float-conversion on by default - 0.990 - fix push-mode seek recovery if you seek into the headers - 0.98b - fix to bad release of 0.98 - 0.98 - fix push-mode seek recovery; robustify float-to-int and support non-fast mode - 0.97 - builds under c++ (typecasting, don't use 'class' keyword) - 0.96 - somehow MY 0.95 was right, but the web one was wrong, so here's my 0.95 rereleased as 0.96, fixes a typo in the clamping code - 0.95 - clamping code for 16-bit functions - 0.94 - not publically released - 0.93 - fixed all-zero-floor case (was decoding garbage) - 0.92 - fixed a memory leak - 0.91 - conditional compiles to omit parts of the API and the infrastructure to support them: STB_VORBIS_NO_PULLDATA_API, STB_VORBIS_NO_PUSHDATA_API, STB_VORBIS_NO_STDIO, STB_VORBIS_NO_INTEGER_CONVERSION - 0.90 - first public release -*/ - -#endif // STB_VORBIS_HEADER_ONLY - - -/* ------------------------------------------------------------------------------- -This software is available under 2 licenses -- choose whichever you prefer. ------------------------------------------------------------------------------- -ALTERNATIVE A - MIT License -Copyright (c) 2017 Sean Barrett -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. ------------------------------------------------------------------------------- -ALTERNATIVE B - Public Domain (www.unlicense.org) -This is free and unencumbered software released into the public domain. -Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -software, either in source code form or as a compiled binary, for any purpose, -commercial or non-commercial, and by any means. -In jurisdictions that recognize copyright laws, the author or authors of this -software dedicate any and all copyright interest in the software to the public -domain. We make this dedication for the benefit of the public at large and to -the detriment of our heirs and successors. We intend this dedication to be an -overt act of relinquishment in perpetuity of all present and future rights to -this software under copyright law. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- -*/ diff --git a/FCLauncher/src/main/jni/lwjgl/tinyfd/org_lwjgl_util_tinyfd_TinyFileDialogs.c b/FCLauncher/src/main/jni/lwjgl/tinyfd/org_lwjgl_util_tinyfd_TinyFileDialogs.c deleted file mode 100644 index ffc17ccd..00000000 --- a/FCLauncher/src/main/jni/lwjgl/tinyfd/org_lwjgl_util_tinyfd_TinyFileDialogs.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright LWJGL. All rights reserved. - * License terms: https://www.lwjgl.org/license - * MACHINE GENERATED FILE, DO NOT EDIT - */ -#include "lwjgl/common_tools.h" -#include "tinyfiledialogs.h" - -EXTERN_C_ENTER - -JNIEXPORT jlong JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1getGlobalChar(JNIEnv *__env, jclass clazz, jlong aCharVariableNameAddress) { - char const *aCharVariableName = (char const *)(uintptr_t)aCharVariableNameAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)tinyfd_getGlobalChar(aCharVariableName); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1getGlobalInt(JNIEnv *__env, jclass clazz, jlong aIntVariableNameAddress) { - char const *aIntVariableName = (char const *)(uintptr_t)aIntVariableNameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)tinyfd_getGlobalInt(aIntVariableName); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1setGlobalInt(JNIEnv *__env, jclass clazz, jlong aIntVariableNameAddress, jint aValue) { - char const *aIntVariableName = (char const *)(uintptr_t)aIntVariableNameAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)tinyfd_setGlobalInt(aIntVariableName, aValue); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_tinyfd_1beep(JNIEnv *__env, jclass clazz) { - UNUSED_PARAMS(__env, clazz) - tinyfd_beep(); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1notifyPopup(JNIEnv *__env, jclass clazz, jlong aTitleAddress, jlong aMessageAddress, jlong aIconTypeAddress) { - char const *aTitle = (char const *)(uintptr_t)aTitleAddress; - char const *aMessage = (char const *)(uintptr_t)aMessageAddress; - char const *aIconType = (char const *)(uintptr_t)aIconTypeAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)tinyfd_notifyPopup(aTitle, aMessage, aIconType); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1messageBox(JNIEnv *__env, jclass clazz, jlong aTitleAddress, jlong aMessageAddress, jlong aDialogTypeAddress, jlong aIconTypeAddress, jint aDefaultButton) { - char const *aTitle = (char const *)(uintptr_t)aTitleAddress; - char const *aMessage = (char const *)(uintptr_t)aMessageAddress; - char const *aDialogType = (char const *)(uintptr_t)aDialogTypeAddress; - char const *aIconType = (char const *)(uintptr_t)aIconTypeAddress; - UNUSED_PARAMS(__env, clazz) - return (jint)tinyfd_messageBox(aTitle, aMessage, aDialogType, aIconType, aDefaultButton); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1inputBox(JNIEnv *__env, jclass clazz, jlong aTitleAddress, jlong aMessageAddress, jlong aDefaultInputAddress) { - char const *aTitle = (char const *)(uintptr_t)aTitleAddress; - char const *aMessage = (char const *)(uintptr_t)aMessageAddress; - char const *aDefaultInput = (char const *)(uintptr_t)aDefaultInputAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)tinyfd_inputBox(aTitle, aMessage, aDefaultInput); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1saveFileDialog(JNIEnv *__env, jclass clazz, jlong aTitleAddress, jlong aDefaultPathAndFileAddress, jint aNumOfFilterPatterns, jlong aFilterPatternsAddress, jlong aSingleFilterDescriptionAddress) { - char const *aTitle = (char const *)(uintptr_t)aTitleAddress; - char const *aDefaultPathAndFile = (char const *)(uintptr_t)aDefaultPathAndFileAddress; - char const * const *aFilterPatterns = (char const * const *)(uintptr_t)aFilterPatternsAddress; - char const *aSingleFilterDescription = (char const *)(uintptr_t)aSingleFilterDescriptionAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)tinyfd_saveFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1openFileDialog(JNIEnv *__env, jclass clazz, jlong aTitleAddress, jlong aDefaultPathAndFileAddress, jint aNumOfFilterPatterns, jlong aFilterPatternsAddress, jlong aSingleFilterDescriptionAddress, jint aAllowMultipleSelects) { - char const *aTitle = (char const *)(uintptr_t)aTitleAddress; - char const *aDefaultPathAndFile = (char const *)(uintptr_t)aDefaultPathAndFileAddress; - char const * const *aFilterPatterns = (char const * const *)(uintptr_t)aFilterPatternsAddress; - char const *aSingleFilterDescription = (char const *)(uintptr_t)aSingleFilterDescriptionAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)tinyfd_openFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription, aAllowMultipleSelects); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1selectFolderDialog(JNIEnv *__env, jclass clazz, jlong aTitleAddress, jlong aDefaultPathAddress) { - char const *aTitle = (char const *)(uintptr_t)aTitleAddress; - char const *aDefaultPath = (char const *)(uintptr_t)aDefaultPathAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)tinyfd_selectFolderDialog(aTitle, aDefaultPath); -} - -JNIEXPORT jlong JNICALL Java_org_lwjgl_util_tinyfd_TinyFileDialogs_ntinyfd_1colorChooser(JNIEnv *__env, jclass clazz, jlong aTitleAddress, jlong aDefaultHexRGBAddress, jlong aDefaultRGBAddress, jlong aoResultRGBAddress) { - char const *aTitle = (char const *)(uintptr_t)aTitleAddress; - char const *aDefaultHexRGB = (char const *)(uintptr_t)aDefaultHexRGBAddress; - unsigned char *aDefaultRGB = (unsigned char *)(uintptr_t)aDefaultRGBAddress; - unsigned char *aoResultRGB = (unsigned char *)(uintptr_t)aoResultRGBAddress; - UNUSED_PARAMS(__env, clazz) - return (jlong)(uintptr_t)tinyfd_colorChooser(aTitle, aDefaultHexRGB, aDefaultRGB, aoResultRGB); -} - -EXTERN_C_EXIT diff --git a/FCLauncher/src/main/jni/lwjgl/tinyfd/tinyfiledialogs.c b/FCLauncher/src/main/jni/lwjgl/tinyfd/tinyfiledialogs.c deleted file mode 100644 index df5fb62b..00000000 --- a/FCLauncher/src/main/jni/lwjgl/tinyfd/tinyfiledialogs.c +++ /dev/null @@ -1,7848 +0,0 @@ -/* SPDX-License-Identifier: ZLIB - -this file can be renamed with extension ".cpp" and compiled as C++. -The code is 100% compatible C C++ -(just comment out << extern "C" >> in the header file) - _________ - / \ tinyfiledialogs.c v3.13.3 [Jul 2, 2023] zlib licence - |tiny file| Unique code file created [November 9, 2014] - | dialogs | Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com - \____ ___/ http://tinyfiledialogs.sourceforge.net - \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd - ____________________________________________ - | | - | email: tinyfiledialogs at ysengrin.com | - |____________________________________________| - _________________________________________________________________________________ - | | - | the windows only wchar_t UTF-16 prototypes are at the bottom of the header file | - |_________________________________________________________________________________| - _________________________________________________________ - | | - | on windows: - since v3.6 char is UTF-8 by default | - | - if you want MBCS set tinyfd_winUtf8 to 0 | - | - functions like fopen expect MBCS | - |_________________________________________________________| - -If you like tinyfiledialogs, please upvote my stackoverflow answer -https://stackoverflow.com/a/47651444 - -- License - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. -*/ - - -#ifndef __sun -#ifndef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 2 /* to accept POSIX 2 in old ANSI C standards */ -#endif -#endif - -#if !defined(_WIN32) && ( defined(__GNUC__) || defined(__clang__) ) -#if !defined(_GNU_SOURCE) - #define _GNU_SOURCE /* used only to resolve symbolic links. Can be commented out */ -#endif -#endif - -#include -#include -#include -#include -#include - -#ifdef _WIN32 - #ifdef __BORLANDC__ - #define _getch getch - #endif - #ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x0500 - #endif - #include - #include - #include - #include - #include - #define TINYFD_NOCCSUNICODE - #define SLASH "\\" -#else - #include - #include - #include /* on old systems try instead */ - #include - #include - #include /* on old systems try instead */ - #define SLASH "/" -#endif /* _WIN32 */ - -#include "tinyfiledialogs.h" - -#define MAX_PATH_OR_CMD 1024 /* _MAX_PATH or MAX_PATH */ - -#ifndef MAX_MULTIPLE_FILES -#define MAX_MULTIPLE_FILES 1024 -#endif -#define LOW_MULTIPLE_FILES 32 - -char tinyfd_version[8] = "3.13.3"; - -/******************************************************************************************************/ -/**************************************** UTF-8 on Windows ********************************************/ -/******************************************************************************************************/ -#ifdef _WIN32 -/* if you want to use UTF-8 ( instead of the UTF-16/wchar_t functions at the end of tinyfiledialogs.h ) -Make sure your code is really prepared for UTF-8 (on windows, functions like fopen() expect MBCS and not UTF-8) */ -int tinyfd_winUtf8 = 1; /* on windows char strings can be 1:UTF-8(default) or 0:MBCS */ -/* for MBCS change this to 0, here or in your code */ -#endif -/******************************************************************************************************/ -/******************************************************************************************************/ -/******************************************************************************************************/ - -int tinyfd_verbose = 0 ; /* on unix: prints the command line calls */ -int tinyfd_silent = 1 ; /* 1 (default) or 0 : on unix, hide errors and warnings from called dialogs */ - -/* Curses dialogs are difficult to use, on windows they are only ascii and uses the unix backslah */ -int tinyfd_allowCursesDialogs = 0 ; /* 0 (default) or 1 */ -int tinyfd_forceConsole = 0 ; /* 0 (default) or 1 */ -/* 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 can use the package dialog or dialog.exe. - on windows it only make sense for console applications */ - -int tinyfd_assumeGraphicDisplay = 0; /* 0 (default) or 1 */ -/* some systems don't set the environment variable DISPLAY even when a graphic display is present. -set this to 1 to tell tinyfiledialogs to assume the existence of a graphic display */ - - -char tinyfd_response[1024]; -/* if you pass "tinyfd_query" as aTitle, -the functions will not display the dialogs -but and return 0 for console mode, 1 for graphic mode. -tinyfd_response is then filled with the retain solution. -possible values for tinyfd_response are (all lowercase) -for graphic mode: - windows_wchar windows applescript kdialog zenity zenity3 yad matedialog - shellementary qarma python2-tkinter python3-tkinter python-dbus - perl-dbus gxmessage gmessage xmessage xdialog gdialog dunst -for console mode: - dialog whiptail basicinput no_solution */ - -static int gWarningDisplayed = 0 ; -static char gTitle[]="missing software! (we will try basic console input)"; - -#ifdef _WIN32 -char tinyfd_needs[] = "\ - ___________\n\ -/ \\ \n\ -| tiny file |\n\ -| dialogs |\n\ -\\_____ ____/\n\ - \\|\ -\ntiny file dialogs on Windows needs:\ -\n a graphic display\ -\nor dialog.exe (curses console mode ** Disabled by default **)\ -\nor a console for basic input"; -#else -char tinyfd_needs[] = "\ - ___________\n\ -/ \\ \n\ -| tiny file |\n\ -| dialogs |\n\ -\\_____ ____/\n\ - \\|\ -\ntiny file dialogs on UNIX needs:\ -\n applescript or kdialog or yad or Xdialog\ -\nor zenity (or matedialog or shellementary or qarma)\ -\nor python (2 or 3) + tkinter + python-dbus (optional)\ -\nor dialog (opens console if needed) ** Disabled by default **\ -\nor xterm + bash (opens console for basic input)\ -\nor existing console for basic input\ -\nand the command `which\x60 to detect any of the above."; /* ` or \x60 is the grave accent */ - -#endif - -#ifdef _MSC_VER -#pragma warning(disable:4996) /* allows usage of strncpy, strcpy, strcat, sprintf, fopen */ -#pragma warning(disable:4100) /* allows usage of strncpy, strcpy, strcat, sprintf, fopen */ -#pragma warning(disable:4706) /* allows usage of strncpy, strcpy, strcat, sprintf, fopen */ -#endif - -static int getenvDISPLAY(void) -{ - return tinyfd_assumeGraphicDisplay || getenv("DISPLAY"); -} - - -static char * getCurDir(void) -{ - static char lCurDir[MAX_PATH_OR_CMD]; - return getcwd(lCurDir, sizeof(lCurDir)); -} - - -static char * getPathWithoutFinalSlash( - char * aoDestination, /* make sure it is allocated, use _MAX_PATH */ - char const * aSource) /* aoDestination and aSource can be the same */ -{ - char const * lTmp ; - if ( aSource ) - { - lTmp = strrchr(aSource, '/'); - if (!lTmp) - { - lTmp = strrchr(aSource, '\\'); - } - if (lTmp) - { - strncpy(aoDestination, aSource, lTmp - aSource ); - aoDestination[lTmp - aSource] = '\0'; - } - else - { - * aoDestination = '\0'; - } - } - else - { - * aoDestination = '\0'; - } - return aoDestination; -} - - -static char * getLastName( - char * aoDestination, /* make sure it is allocated */ - char const * aSource) -{ - /* copy the last name after '/' or '\' */ - char const * lTmp ; - if ( aSource ) - { - lTmp = strrchr(aSource, '/'); - if (!lTmp) - { - lTmp = strrchr(aSource, '\\'); - } - if (lTmp) - { - strcpy(aoDestination, lTmp + 1); - } - else - { - strcpy(aoDestination, aSource); - } - } - else - { - * aoDestination = '\0'; - } - return aoDestination; -} - - -static void ensureFinalSlash( char * aioString ) -{ - if ( aioString && strlen( aioString ) ) - { - char * lastcar = aioString + strlen( aioString ) - 1 ; - if ( strncmp( lastcar , SLASH , 1 ) ) - { - strcat( lastcar , SLASH ) ; - } - } -} - - -static void Hex2RGB( char const aHexRGB[8] , unsigned char aoResultRGB[3] ) -{ - char lColorChannel[8] ; - if ( aoResultRGB ) - { - if ( aHexRGB ) - { - strcpy(lColorChannel, aHexRGB ) ; - aoResultRGB[2] = (unsigned char)strtoul(lColorChannel+5,NULL,16); - lColorChannel[5] = '\0'; - aoResultRGB[1] = (unsigned char)strtoul(lColorChannel+3,NULL,16); - lColorChannel[3] = '\0'; - aoResultRGB[0] = (unsigned char)strtoul(lColorChannel+1,NULL,16); -/* printf("%d %d %d\n", aoResultRGB[0], aoResultRGB[1], aoResultRGB[2]); */ - } - else - { - aoResultRGB[0]=0; - aoResultRGB[1]=0; - aoResultRGB[2]=0; - } - } -} - -static void RGB2Hex( unsigned char const aRGB[3], char aoResultHexRGB[8] ) -{ - if ( aoResultHexRGB ) - { - if ( aRGB ) - { -#if (defined(__cplusplus ) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__clang__) - sprintf(aoResultHexRGB, "#%02hhx%02hhx%02hhx", aRGB[0], aRGB[1], aRGB[2]); -#else - sprintf(aoResultHexRGB, "#%02hx%02hx%02hx", aRGB[0], aRGB[1], aRGB[2]); -#endif - /*printf("aoResultHexRGB %s\n", aoResultHexRGB);*/ - } - else - { - aoResultHexRGB[0]=0; - aoResultHexRGB[1]=0; - aoResultHexRGB[2]=0; - } - } -} - - -void tfd_replaceSubStr( char const * aSource, char const * aOldSubStr, - char const * aNewSubStr, char * aoDestination ) -{ - char const * pOccurence ; - char const * p ; - char const * lNewSubStr = "" ; - size_t lOldSubLen = strlen( aOldSubStr ) ; - - if ( ! aSource ) - { - * aoDestination = '\0' ; - return ; - } - if ( ! aOldSubStr ) - { - strcpy( aoDestination , aSource ) ; - return ; - } - if ( aNewSubStr ) - { - lNewSubStr = aNewSubStr ; - } - p = aSource ; - * aoDestination = '\0' ; - while ( ( pOccurence = strstr( p , aOldSubStr ) ) != NULL ) - { - strncat( aoDestination , p , pOccurence - p ) ; - strcat( aoDestination , lNewSubStr ) ; - p = pOccurence + lOldSubLen ; - } - strcat( aoDestination , p ) ; -} - - -static int filenameValid( char const * aFileNameWithoutPath ) -{ - if ( ! aFileNameWithoutPath - || ! strlen(aFileNameWithoutPath) - || strpbrk(aFileNameWithoutPath , "\\/:*?\"<>|") ) - { - return 0 ; - } - return 1 ; -} - -#ifndef _WIN32 - -static int fileExists( char const * aFilePathAndName ) -{ - FILE * lIn ; - if ( ! aFilePathAndName || ! strlen(aFilePathAndName) ) - { - return 0 ; - } - lIn = fopen( aFilePathAndName , "r" ) ; - if ( ! lIn ) - { - return 0 ; - } - fclose( lIn ) ; - return 1 ; -} - -#endif - - -static void wipefile(char const * aFilename) -{ - int i; - struct stat st; - FILE * lIn; - - if (stat(aFilename, &st) == 0) - { - if ((lIn = fopen(aFilename, "w"))) - { - for (i = 0; i < st.st_size; i++) - { - fputc('A', lIn); - } - fclose(lIn); - } - } -} - - -int tfd_quoteDetected(char const * aString) -{ - char const * p; - - if (!aString) return 0; - - p = aString; - while ((p = strchr(p, '\''))) - { - return 1; - } - - p = aString; - while ((p = strchr(p, '\"'))) - { - return 1; - } - - return 0; -} - - -char const * tinyfd_getGlobalChar(char const * aCharVariableName) /* to be called from C# (you don't need this in C or C++) */ -{ - if (!aCharVariableName || !strlen(aCharVariableName)) return NULL; - else if (!strcmp(aCharVariableName, "tinyfd_version")) return tinyfd_version; - else if (!strcmp(aCharVariableName, "tinyfd_needs")) return tinyfd_needs; - else if (!strcmp(aCharVariableName, "tinyfd_response")) return tinyfd_response; - else return NULL ; -} - - -int tinyfd_getGlobalInt(char const * aIntVariableName) /* to be called from C# (you don't need this in C or C++) */ -{ - if ( !aIntVariableName || !strlen(aIntVariableName) ) return -1 ; - else if ( !strcmp(aIntVariableName, "tinyfd_verbose") ) return tinyfd_verbose ; - else if ( !strcmp(aIntVariableName, "tinyfd_silent") ) return tinyfd_silent ; - else if ( !strcmp(aIntVariableName, "tinyfd_allowCursesDialogs") ) return tinyfd_allowCursesDialogs ; - else if ( !strcmp(aIntVariableName, "tinyfd_forceConsole") ) return tinyfd_forceConsole ; - else if ( !strcmp(aIntVariableName, "tinyfd_assumeGraphicDisplay") ) return tinyfd_assumeGraphicDisplay ; -#ifdef _WIN32 - else if ( !strcmp(aIntVariableName, "tinyfd_winUtf8") ) return tinyfd_winUtf8 ; -#endif - else return -1; -} - - -int tinyfd_setGlobalInt(char const * aIntVariableName, int aValue) /* to be called from C# (you don't need this in C or C++) */ -{ - if (!aIntVariableName || !strlen(aIntVariableName)) return -1 ; - else if (!strcmp(aIntVariableName, "tinyfd_verbose")) { tinyfd_verbose = aValue; return tinyfd_verbose; } - else if (!strcmp(aIntVariableName, "tinyfd_silent")) { tinyfd_silent = aValue; return tinyfd_silent; } - else if (!strcmp(aIntVariableName, "tinyfd_allowCursesDialogs")) { tinyfd_allowCursesDialogs = aValue; return tinyfd_allowCursesDialogs; } - else if (!strcmp(aIntVariableName, "tinyfd_forceConsole")) { tinyfd_forceConsole = aValue; return tinyfd_forceConsole; } - else if (!strcmp(aIntVariableName, "tinyfd_assumeGraphicDisplay")) { tinyfd_assumeGraphicDisplay = aValue; return tinyfd_assumeGraphicDisplay; } -#ifdef _WIN32 - else if (!strcmp(aIntVariableName, "tinyfd_winUtf8")) { tinyfd_winUtf8 = aValue; return tinyfd_winUtf8; } -#endif - else return -1; -} - - -#ifdef _WIN32 -static int powershellPresent(void) -{ /*only on vista and above (or installed on xp)*/ - static int lPowershellPresent = -1; - char lBuff[MAX_PATH_OR_CMD]; - FILE* lIn; - char const* lString = "powershell.exe"; - - if (lPowershellPresent < 0) - { - if (!(lIn = _popen("where powershell.exe", "r"))) - { - lPowershellPresent = 0; - return 0; - } - while (fgets(lBuff, sizeof(lBuff), lIn) != NULL) - { - } - _pclose(lIn); - if (lBuff[strlen(lBuff) - 1] == '\n') - { - lBuff[strlen(lBuff) - 1] = '\0'; - } - if (strcmp(lBuff + strlen(lBuff) - strlen(lString), lString)) - { - lPowershellPresent = 0; - } - else - { - lPowershellPresent = 1; - } - } - return lPowershellPresent; -} - -static int windowsVersion(void) -{ -#if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) - typedef LONG NTSTATUS ; - typedef NTSTATUS(WINAPI* RtlGetVersionPtr)(PRTL_OSVERSIONINFOW); - HMODULE hMod; - RtlGetVersionPtr lFxPtr; - RTL_OSVERSIONINFOW lRovi = { 0 }; - - hMod = GetModuleHandleW(L"ntdll.dll"); - if (hMod) { - lFxPtr = (RtlGetVersionPtr)GetProcAddress(hMod, "RtlGetVersion"); - if (lFxPtr) - { - lRovi.dwOSVersionInfoSize = sizeof(lRovi); - if (!lFxPtr(&lRovi)) - { - return lRovi.dwMajorVersion; - } - } - } -#endif - if (powershellPresent()) return 6; /*minimum is vista or installed on xp*/ - return 0; -} - - -static void replaceChr(char * aString, char aOldChr, char aNewChr) -{ - char * p; - - if (!aString) return; - if (aOldChr == aNewChr) return; - - p = aString; - while ((p = strchr(p, aOldChr))) - { - *p = aNewChr; - p++; - } - return; -} - - -#if !defined(WC_ERR_INVALID_CHARS) -/* undefined prior to Vista, so not yet in MINGW header file */ -#define WC_ERR_INVALID_CHARS 0x00000000 /* 0x00000080 for MINGW maybe ? */ -#endif - -static int sizeUtf16From8(char const * aUtf8string) -{ - return MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, - aUtf8string, -1, NULL, 0); -} - - -static int sizeUtf16FromMbcs(char const * aMbcsString) -{ - return MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, - aMbcsString, -1, NULL, 0); -} - - -static int sizeUtf8(wchar_t const * aUtf16string) -{ - return WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, - aUtf16string, -1, NULL, 0, NULL, NULL); -} - - -static int sizeMbcs(wchar_t const * aMbcsString) -{ - int lRes = WideCharToMultiByte(CP_ACP, 0, - aMbcsString, -1, NULL, 0, NULL, NULL); - /* DWORD licic = GetLastError(); */ - return lRes; -} - - -wchar_t* tinyfd_mbcsTo16(char const* aMbcsString) -{ - static wchar_t* lMbcsString = NULL; - int lSize; - - free(lMbcsString); - if (!aMbcsString) { lMbcsString = NULL; return NULL; } - lSize = sizeUtf16FromMbcs(aMbcsString); - if (lSize) - { - lMbcsString = (wchar_t*)malloc(lSize * sizeof(wchar_t)); - lSize = MultiByteToWideChar(CP_ACP, 0, aMbcsString, -1, lMbcsString, lSize); - } - else wcscpy(lMbcsString, L""); - return lMbcsString; -} - - -wchar_t * tinyfd_utf8to16(char const * aUtf8string) -{ - static wchar_t * lUtf16string = NULL; - int lSize; - - free(lUtf16string); - if (!aUtf8string) {lUtf16string = NULL; return NULL;} - lSize = sizeUtf16From8(aUtf8string); - if (lSize) - { - lUtf16string = (wchar_t*)malloc(lSize * sizeof(wchar_t)); - lSize = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, - aUtf8string, -1, lUtf16string, lSize); - return lUtf16string; - } - else - { - /* let's try mbcs anyway */ - lUtf16string = NULL; - return tinyfd_mbcsTo16(aUtf8string); - } -} - - -char * tinyfd_utf16toMbcs(wchar_t const * aUtf16string) -{ - static char * lMbcsString = NULL; - int lSize; - - free(lMbcsString); - if (!aUtf16string) { lMbcsString = NULL; return NULL; } - lSize = sizeMbcs(aUtf16string); - if (lSize) - { - lMbcsString = (char*)malloc(lSize); - lSize = WideCharToMultiByte(CP_ACP, 0, aUtf16string, -1, lMbcsString, lSize, NULL, NULL); - } - else strcpy(lMbcsString, ""); - return lMbcsString; -} - - -char * tinyfd_utf8toMbcs(char const * aUtf8string) -{ - wchar_t const * lUtf16string; - lUtf16string = tinyfd_utf8to16(aUtf8string); - return tinyfd_utf16toMbcs(lUtf16string); -} - - -char * tinyfd_utf16to8(wchar_t const * aUtf16string) -{ - static char * lUtf8string = NULL; - int lSize; - - free(lUtf8string); - if (!aUtf16string) { lUtf8string = NULL; return NULL; } - lSize = sizeUtf8(aUtf16string); - if (lSize) - { - lUtf8string = (char*)malloc(lSize); - lSize = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, aUtf16string, -1, lUtf8string, lSize, NULL, NULL); - } - else strcpy(lUtf8string, ""); - return lUtf8string; -} - - -char * tinyfd_mbcsTo8(char const * aMbcsString) -{ - wchar_t const * lUtf16string; - lUtf16string = tinyfd_mbcsTo16(aMbcsString); - return tinyfd_utf16to8(lUtf16string); -} - - -void tinyfd_beep(void) -{ - if (windowsVersion() > 5) Beep(440, 300); - else MessageBeep(MB_OK); -} - - -static void wipefileW(wchar_t const * aFilename) -{ - int i; - FILE * lIn; -#if defined(__MINGW32_MAJOR_VERSION) && !defined(__MINGW64__) && (__MINGW32_MAJOR_VERSION <= 3) - struct _stat st; - if (_wstat(aFilename, &st) == 0) -#else - struct __stat64 st; - if (_wstat64(aFilename, &st) == 0) -#endif - { - if ((lIn = _wfopen(aFilename, L"w"))) - { - for (i = 0; i < st.st_size; i++) - { - fputc('A', lIn); - } - fclose(lIn); - } - } -} - - -static wchar_t * getPathWithoutFinalSlashW( - wchar_t * aoDestination, /* make sure it is allocated, use _MAX_PATH */ - wchar_t const * aSource) /* aoDestination and aSource can be the same */ -{ - wchar_t const * lTmp; - if (aSource) - { - lTmp = wcsrchr(aSource, L'/'); - if (!lTmp) - { - lTmp = wcsrchr(aSource, L'\\'); - } - if (lTmp) - { - wcsncpy(aoDestination, aSource, lTmp - aSource); - aoDestination[lTmp - aSource] = L'\0'; - } - else - { - *aoDestination = L'\0'; - } - } - else - { - *aoDestination = L'\0'; - } - return aoDestination; -} - - -static wchar_t * getLastNameW( - wchar_t * aoDestination, /* make sure it is allocated */ - wchar_t const * aSource) -{ - /* copy the last name after '/' or '\' */ - wchar_t const * lTmp; - if (aSource) - { - lTmp = wcsrchr(aSource, L'/'); - if (!lTmp) - { - lTmp = wcsrchr(aSource, L'\\'); - } - if (lTmp) - { - wcscpy(aoDestination, lTmp + 1); - } - else - { - wcscpy(aoDestination, aSource); - } - } - else - { - *aoDestination = L'\0'; - } - return aoDestination; -} - - -static void Hex2RGBW(wchar_t const aHexRGB[8], unsigned char aoResultRGB[3]) -{ - wchar_t lColorChannel[8]; - if (aoResultRGB) - { - if (aHexRGB) - { - wcscpy(lColorChannel, aHexRGB); - aoResultRGB[2] = (unsigned char)wcstoul(lColorChannel + 5, NULL, 16); - lColorChannel[5] = '\0'; - aoResultRGB[1] = (unsigned char)wcstoul(lColorChannel + 3, NULL, 16); - lColorChannel[3] = '\0'; - aoResultRGB[0] = (unsigned char)wcstoul(lColorChannel + 1, NULL, 16); - /* printf("%d %d %d\n", aoResultRGB[0], aoResultRGB[1], aoResultRGB[2]); */ - } - else - { - aoResultRGB[0] = 0; - aoResultRGB[1] = 0; - aoResultRGB[2] = 0; - } - } -} - - -static void RGB2HexW( unsigned char const aRGB[3], wchar_t aoResultHexRGB[8]) -{ -#if (defined(__cplusplus ) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__clang__) - wchar_t const * const lPrintFormat = L"#%02hhx%02hhx%02hhx"; -#else - wchar_t const * const lPrintFormat = L"#%02hx%02hx%02hx"; -#endif - - if (aoResultHexRGB) - { - if (aRGB) - { - /* wprintf(L"aoResultHexRGB %s\n", aoResultHexRGB); */ -#if !defined(__BORLANDC__) && !defined(__TINYC__) && !(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) - swprintf(aoResultHexRGB, 8, lPrintFormat, aRGB[0], aRGB[1], aRGB[2]); -#else - swprintf(aoResultHexRGB, lPrintFormat, aRGB[0], aRGB[1], aRGB[2]); -#endif - - } - else - { - aoResultHexRGB[0] = 0; - aoResultHexRGB[1] = 0; - aoResultHexRGB[2] = 0; - } - } -} - - -static int dirExists(char const * aDirPath) -{ -#if defined(__MINGW32_MAJOR_VERSION) && !defined(__MINGW64__) && (__MINGW32_MAJOR_VERSION <= 3) - struct _stat lInfo; -#else - struct __stat64 lInfo; -#endif - wchar_t * lTmpWChar; - int lStatRet; - size_t lDirLen; - - if (!aDirPath) - return 0; - lDirLen = strlen(aDirPath); - if (!lDirLen) - return 1; - if ( (lDirLen == 2) && (aDirPath[1] == ':') ) - return 1; - - if (tinyfd_winUtf8) - { - lTmpWChar = tinyfd_utf8to16(aDirPath); -#if defined(__MINGW32_MAJOR_VERSION) && !defined(__MINGW64__) && (__MINGW32_MAJOR_VERSION <= 3) - lStatRet = _wstat(lTmpWChar, &lInfo); -#else - lStatRet = _wstat64(lTmpWChar, &lInfo); -#endif - if (lStatRet != 0) - return 0; - else if (lInfo.st_mode & S_IFDIR) - return 1; - else - return 0; - } -#if defined(__MINGW32_MAJOR_VERSION) && !defined(__MINGW64__) && (__MINGW32_MAJOR_VERSION <= 3) - else if (_stat(aDirPath, &lInfo) != 0) -#else - else if (_stat64(aDirPath, &lInfo) != 0) -#endif - return 0; - else if (lInfo.st_mode & S_IFDIR) - return 1; - else - return 0; -} - - -static int fileExists(char const * aFilePathAndName) -{ -#if defined(__MINGW32_MAJOR_VERSION) && !defined(__MINGW64__) && (__MINGW32_MAJOR_VERSION <= 3) - struct _stat lInfo; -#else - struct __stat64 lInfo; -#endif - wchar_t * lTmpWChar; - int lStatRet; - FILE * lIn; - - if (!aFilePathAndName || !strlen(aFilePathAndName)) - { - return 0; - } - - if (tinyfd_winUtf8) - { - lTmpWChar = tinyfd_utf8to16(aFilePathAndName); -#if defined(__MINGW32_MAJOR_VERSION) && !defined(__MINGW64__) && (__MINGW32_MAJOR_VERSION <= 3) - lStatRet = _wstat(lTmpWChar, &lInfo); -#else - lStatRet = _wstat64(lTmpWChar, &lInfo); -#endif - - if (lStatRet != 0) - return 0; - else if (lInfo.st_mode & _S_IFREG) - return 1; - else - return 0; - } - else - { - lIn = fopen(aFilePathAndName, "r"); - if (!lIn) - { - return 0; - } - fclose(lIn); - return 1; - } -} - -static void replaceWchar(wchar_t * aString, - wchar_t aOldChr, - wchar_t aNewChr) -{ - wchar_t * p; - - if (!aString) - { - return ; - } - - if (aOldChr == aNewChr) - { - return ; - } - - p = aString; - while ((p = wcsrchr(p, aOldChr))) - { - *p = aNewChr; -#ifdef TINYFD_NOCCSUNICODE - p++; -#endif - p++; - } - return ; -} - - -static int quoteDetectedW(wchar_t const * aString) -{ - wchar_t const * p; - - if (!aString) return 0; - - p = aString; - while ((p = wcsrchr(p, L'\''))) - { - return 1; - } - - p = aString; - while ((p = wcsrchr(p, L'\"'))) - { - return 1; - } - - return 0; -} - -#endif /* _WIN32 */ - -/* source and destination can be the same or ovelap*/ -static char * ensureFilesExist(char * aDestination, - char const * aSourcePathsAndNames) -{ - char * lDestination = aDestination; - char const * p; - char const * p2; - size_t lLen; - - if (!aSourcePathsAndNames) - { - return NULL; - } - lLen = strlen(aSourcePathsAndNames); - if (!lLen) - { - return NULL; - } - - p = aSourcePathsAndNames; - while ((p2 = strchr(p, '|')) != NULL) - { - lLen = p2 - p; - memmove(lDestination, p, lLen); - lDestination[lLen] = '\0'; - if (fileExists(lDestination)) - { - lDestination += lLen; - *lDestination = '|'; - lDestination++; - } - p = p2 + 1; - } - if (fileExists(p)) - { - lLen = strlen(p); - memmove(lDestination, p, lLen); - lDestination[lLen] = '\0'; - } - else - { - *(lDestination - 1) = '\0'; - } - return aDestination; -} - -#ifdef _WIN32 - -static int __stdcall EnumThreadWndProc(HWND hwnd, LPARAM lParam) -{ - wchar_t lTitleName[MAX_PATH]; - wchar_t const* lDialogTitle = (wchar_t const *) lParam; - - GetWindowTextW(hwnd, lTitleName, MAX_PATH); - /* wprintf(L"lTitleName %ls \n", lTitleName); */ - - if (wcscmp(lDialogTitle, lTitleName) == 0) - { - SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - return 0; - } - return 1; -} - - -static void hiddenConsoleW(wchar_t const * aString, wchar_t const * aDialogTitle, int aInFront) -{ - STARTUPINFOW StartupInfo; - PROCESS_INFORMATION ProcessInfo; - - if (!aString || !wcslen(aString) ) return; - - memset(&StartupInfo, 0, sizeof(StartupInfo)); - StartupInfo.cb = sizeof(STARTUPINFOW); - StartupInfo.dwFlags = STARTF_USESHOWWINDOW; - StartupInfo.wShowWindow = SW_HIDE; - - if (!CreateProcessW(NULL, (LPWSTR)aString, NULL, NULL, FALSE, - CREATE_NEW_CONSOLE, NULL, NULL, - &StartupInfo, &ProcessInfo)) - { - return; /* GetLastError(); */ - } - - WaitForInputIdle(ProcessInfo.hProcess, INFINITE); - if (aInFront) - { - while (EnumWindows(EnumThreadWndProc, (LPARAM)aDialogTitle)) {} - } - WaitForSingleObject(ProcessInfo.hProcess, INFINITE); - CloseHandle(ProcessInfo.hThread); - CloseHandle(ProcessInfo.hProcess); -} - - -int tinyfd_messageBoxW( - wchar_t const * aTitle, /* NULL or "" */ - wchar_t const * aMessage, /* NULL or "" may contain \n and \t */ - wchar_t const * aDialogType, /* "ok" "okcancel" "yesno" "yesnocancel" */ - wchar_t const * aIconType, /* "info" "warning" "error" "question" */ - int aDefaultButton) /* 0 for cancel/no , 1 for ok/yes , 2 for no in yesnocancel */ -{ - int lBoxReturnValue; - UINT aCode; - - if (aTitle&&!wcscmp(aTitle, L"tinyfd_query")){ strcpy(tinyfd_response, "windows_wchar"); return 1; } - - if (quoteDetectedW(aTitle)) return tinyfd_messageBoxW(L"INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 \\x60 instead.", aMessage, aDialogType, aIconType, aDefaultButton); - if (quoteDetectedW(aMessage)) return tinyfd_messageBoxW(aTitle, L"INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDialogType, aIconType, aDefaultButton); - - if (aIconType && !wcscmp(L"warning", aIconType)) - { - aCode = MB_ICONWARNING; - } - else if (aIconType && !wcscmp(L"error", aIconType)) - { - aCode = MB_ICONERROR; - } - else if (aIconType && !wcscmp(L"question", aIconType)) - { - aCode = MB_ICONQUESTION; - } - else - { - aCode = MB_ICONINFORMATION; - } - - if (aDialogType && !wcscmp(L"okcancel", aDialogType)) - { - aCode += MB_OKCANCEL; - if (!aDefaultButton) - { - aCode += MB_DEFBUTTON2; - } - } - else if (aDialogType && !wcscmp(L"yesno", aDialogType)) - { - aCode += MB_YESNO; - if (!aDefaultButton) - { - aCode += MB_DEFBUTTON2; - } - } - else if (aDialogType && !wcscmp(L"yesnocancel", aDialogType)) - { - aCode += MB_YESNOCANCEL; - if (aDefaultButton == 1) - { - aCode += MB_DEFBUTTON1; - } - else if (aDefaultButton == 2) - { - aCode += MB_DEFBUTTON2; - } - else - { - aCode += MB_DEFBUTTON3; - } - } - else - { - aCode += MB_OK; - } - - aCode += MB_TOPMOST; - - lBoxReturnValue = MessageBoxW(GetForegroundWindow(), aMessage, aTitle, aCode); - - if ( (lBoxReturnValue == IDNO) && (aDialogType && !wcscmp(L"yesnocancel", aDialogType)) ) - { - return 2; - } - else if ( (lBoxReturnValue == IDOK) || (lBoxReturnValue == IDYES) ) - { - return 1; - } - else - { - return 0; - } -} - - -/* return has only meaning for tinyfd_query */ -int tinyfd_notifyPopupW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aMessage, /* NULL or L"" may contain \n \t */ - wchar_t const * aIconType) /* L"info" L"warning" L"error" */ -{ - wchar_t * lDialogString; - size_t lTitleLen; - size_t lMessageLen; - size_t lDialogStringLen; - - if (aTitle && !wcscmp(aTitle, L"tinyfd_query")) { strcpy(tinyfd_response, "windows_wchar"); return 1; } - - if (quoteDetectedW(aTitle)) return tinyfd_notifyPopupW(L"INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aMessage, aIconType); - if (quoteDetectedW(aMessage)) return tinyfd_notifyPopupW(aTitle, L"INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aIconType); - - lTitleLen = aTitle ? wcslen(aTitle) : 0; - lMessageLen = aMessage ? wcslen(aMessage) : 0; - lDialogStringLen = 3 * MAX_PATH_OR_CMD + lTitleLen + lMessageLen; - lDialogString = (wchar_t *)malloc(2 * lDialogStringLen); - if (!lDialogString) return 0; - - wcscpy(lDialogString, L"powershell.exe -command \"\ -function Show-BalloonTip {\ -[cmdletbinding()] \ -param( \ -[string]$Title = ' ', \ -[string]$Message = ' ', \ -[ValidateSet('info', 'warning', 'error')] \ -[string]$IconType = 'info');\ -[system.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null ; \ -$balloon = New-Object System.Windows.Forms.NotifyIcon ; \ -$path = Get-Process -id $pid | Select-Object -ExpandProperty Path ; \ -$icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;"); - - wcscat(lDialogString, L"\ -$balloon.Icon = $icon ; \ -$balloon.BalloonTipIcon = $IconType ; \ -$balloon.BalloonTipText = $Message ; \ -$balloon.BalloonTipTitle = $Title ; \ -$balloon.Text = 'tinyfiledialogs' ; \ -$balloon.Visible = $true ; \ -$balloon.ShowBalloonTip(5000)};\ -Show-BalloonTip"); - - if (aTitle && wcslen(aTitle)) - { - wcscat(lDialogString, L" -Title '"); - wcscat(lDialogString, aTitle); - wcscat(lDialogString, L"'"); - } - if (aMessage && wcslen(aMessage)) - { - wcscat(lDialogString, L" -Message '"); - wcscat(lDialogString, aMessage); - wcscat(lDialogString, L"'"); - } - if (aMessage && wcslen(aIconType)) - { - wcscat(lDialogString, L" -IconType '"); - wcscat(lDialogString, aIconType); - wcscat(lDialogString, L"'"); - } - wcscat(lDialogString, L"\""); - - /* wprintf ( L"lDialogString: %ls\n" , lDialogString ) ; */ - - hiddenConsoleW(lDialogString, aTitle, 0); - free(lDialogString); - return 1; -} - - -wchar_t * tinyfd_inputBoxW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aMessage, /* NULL or L"" (\n and \t have no effect) */ - wchar_t const * aDefaultInput) /* L"" , if NULL it's a passwordBox */ -{ - static wchar_t lBuff[MAX_PATH_OR_CMD]; - wchar_t * lDialogString; - FILE * lIn; - FILE * lFile; - int lResult; - size_t lTitleLen; - size_t lMessageLen; - size_t lDialogStringLen; - - if (aTitle&&!wcscmp(aTitle, L"tinyfd_query")){ strcpy(tinyfd_response, "windows_wchar"); return (wchar_t *)1; } - - if (quoteDetectedW(aTitle)) return tinyfd_inputBoxW(L"INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aMessage, aDefaultInput); - if (quoteDetectedW(aMessage)) return tinyfd_inputBoxW(aTitle, L"INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultInput); - if (quoteDetectedW(aDefaultInput)) return tinyfd_inputBoxW(aTitle, aMessage, L"INVALID DEFAULT_INPUT WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - - lTitleLen = aTitle ? wcslen(aTitle) : 0 ; - lMessageLen = aMessage ? wcslen(aMessage) : 0 ; - lDialogStringLen = 3 * MAX_PATH_OR_CMD + lTitleLen + lMessageLen; - lDialogString = (wchar_t *)malloc(2 * lDialogStringLen); - - if (aDefaultInput) - { - swprintf(lDialogString, -#if !defined(__BORLANDC__) && !defined(__TINYC__) && !(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) - lDialogStringLen, -#endif - L"%ls\\tinyfd.vbs", _wgetenv(L"TEMP")); - } - else - { - swprintf(lDialogString, -#if !defined(__BORLANDC__) && !defined(__TINYC__) && !(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) - lDialogStringLen, -#endif - L"%ls\\tinyfd.hta", _wgetenv(L"TEMP")); - } - lIn = _wfopen(lDialogString, L"w"); - if (!lIn) - { - free(lDialogString); - return NULL; - } - - if ( aDefaultInput ) - { - wcscpy(lDialogString, L"Dim result:result=InputBox(\""); - if (aMessage && wcslen(aMessage)) - { - wcscpy(lBuff, aMessage); - replaceWchar(lBuff, L'\n', L' '); - wcscat(lDialogString, lBuff); - } - wcscat(lDialogString, L"\",\""); - if (aTitle) wcscat(lDialogString, aTitle); - wcscat(lDialogString, L"\",\""); - - if (aDefaultInput && wcslen(aDefaultInput)) - { - wcscpy(lBuff, aDefaultInput); - replaceWchar(lBuff, L'\n', L' '); - wcscat(lDialogString, lBuff); - } - wcscat(lDialogString, L"\"):If IsEmpty(result) then:WScript.Echo 0"); - wcscat(lDialogString, L":Else: WScript.Echo \"1\" & result : End If"); - } - else - { - wcscpy(lDialogString, L"\n\ -\n\ -\n\ -"); - if (aTitle) wcscat(lDialogString, aTitle); - wcscat(lDialogString, L"\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -\n\ -
\n"); - - wcscat(lDialogString, aMessage ? aMessage : L""); - - wcscat(lDialogString, L"\n\ -\n\ -\n\ -\n\ -
\n\ -

\n\ -\n\ -
\n\ -
\n"); - - wcscat(lDialogString, L"\n\ -\n\ -\n\ -\n\ -
\n\ -
\n\ -
\n\ -\n\ -\n\ -" ) ; - } - fputws(lDialogString, lIn); - fclose(lIn); - - if (aDefaultInput) - { - swprintf(lDialogString, -#if !defined(__BORLANDC__) && !defined(__TINYC__) && !(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) - lDialogStringLen, -#endif - L"%ls\\tinyfd.txt",_wgetenv(L"TEMP")); - -#ifdef TINYFD_NOCCSUNICODE - lFile = _wfopen(lDialogString, L"w"); - fputc(0xFF, lFile); - fputc(0xFE, lFile); -#else - lFile = _wfopen(lDialogString, L"wt, ccs=UNICODE"); /*or ccs=UTF-16LE*/ -#endif - fclose(lFile); - - wcscpy(lDialogString, L"cmd.exe /c cscript.exe //U //Nologo "); - wcscat(lDialogString, L"\"%TEMP%\\tinyfd.vbs\" "); - wcscat(lDialogString, L">> \"%TEMP%\\tinyfd.txt\""); - } - else - { - wcscpy(lDialogString, - L"cmd.exe /c mshta.exe \"%TEMP%\\tinyfd.hta\""); - } - - /* wprintf ( "lDialogString: %ls\n" , lDialogString ) ; */ - - hiddenConsoleW(lDialogString, aTitle, 1); - - swprintf(lDialogString, -#if !defined(__BORLANDC__) && !defined(__TINYC__) && !(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) - lDialogStringLen, -#endif - L"%ls\\tinyfd.txt", _wgetenv(L"TEMP")); - /* wprintf(L"lDialogString: %ls\n", lDialogString); */ -#ifdef TINYFD_NOCCSUNICODE - if (!(lIn = _wfopen(lDialogString, L"r"))) -#else - if (!(lIn = _wfopen(lDialogString, L"rt, ccs=UNICODE"))) /*or ccs=UTF-16LE*/ -#endif - { - _wremove(lDialogString); - free(lDialogString); - return NULL; - } - - memset(lBuff, 0, MAX_PATH_OR_CMD * sizeof(wchar_t) ); - -#ifdef TINYFD_NOCCSUNICODE - fgets((char *)lBuff, 2*MAX_PATH_OR_CMD, lIn); -#else - fgetws(lBuff, MAX_PATH_OR_CMD, lIn); -#endif - fclose(lIn); - wipefileW(lDialogString); - _wremove(lDialogString); - - if (aDefaultInput) - { - swprintf(lDialogString, -#if !defined(__BORLANDC__) && !defined(__TINYC__) && !(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) - lDialogStringLen, -#endif - L"%ls\\tinyfd.vbs", _wgetenv(L"TEMP")); - } - else - { - swprintf(lDialogString, -#if !defined(__BORLANDC__) && !defined(__TINYC__) && !(defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) - lDialogStringLen, -#endif - L"%ls\\tinyfd.hta", _wgetenv(L"TEMP")); - } - _wremove(lDialogString); - free(lDialogString); - /* wprintf( L"lBuff: %ls\n" , lBuff ) ; */ -#ifdef TINYFD_NOCCSUNICODE - lResult = !wcsncmp(lBuff+1, L"1", 1); -#else - lResult = !wcsncmp(lBuff, L"1", 1); -#endif - - /* printf( "lResult: %d \n" , lResult ) ; */ - if (!lResult) - { - return NULL ; - } - - /* wprintf( "lBuff+1: %ls\n" , lBuff+1 ) ; */ - -#ifdef TINYFD_NOCCSUNICODE - if (aDefaultInput) - { - lDialogStringLen = wcslen(lBuff) ; - lBuff[lDialogStringLen - 1] = L'\0'; - lBuff[lDialogStringLen - 2] = L'\0'; - } - return lBuff + 2; -#else - if (aDefaultInput) lBuff[wcslen(lBuff) - 1] = L'\0'; - return lBuff + 1; -#endif -} - - -wchar_t * tinyfd_saveFileDialogW( - wchar_t const * aTitle, /* NULL or "" */ - wchar_t const * aDefaultPathAndFile, /* NULL or "" */ - int aNumOfFilterPatterns, /* 0 */ - wchar_t const * const * aFilterPatterns, /* NULL or {"*.jpg","*.png"} */ - wchar_t const * aSingleFilterDescription) /* NULL or "image files" */ -{ - static wchar_t lBuff[MAX_PATH_OR_CMD]; - wchar_t lDirname[MAX_PATH_OR_CMD]; - wchar_t lDialogString[MAX_PATH_OR_CMD]; - wchar_t lFilterPatterns[MAX_PATH_OR_CMD] = L""; - wchar_t * p; - wchar_t * lRetval; - wchar_t const * ldefExt = NULL; - int i; - HRESULT lHResult; - OPENFILENAMEW ofn = {0}; - - if (aTitle&&!wcscmp(aTitle, L"tinyfd_query")){ strcpy(tinyfd_response, "windows_wchar"); return (wchar_t *)1; } - - if (quoteDetectedW(aTitle)) return tinyfd_saveFileDialogW(L"INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription); - if (quoteDetectedW(aDefaultPathAndFile)) return tinyfd_saveFileDialogW(aTitle, L"INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription); - if (quoteDetectedW(aSingleFilterDescription)) return tinyfd_saveFileDialogW(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, L"INVALID FILTER_DESCRIPTION WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - for (i = 0; i < aNumOfFilterPatterns; i++) - { - if (quoteDetectedW(aFilterPatterns[i])) return tinyfd_saveFileDialogW(L"INVALID FILTER_PATTERN WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, 0, NULL, NULL); - } - - lHResult = CoInitializeEx(NULL, 0); - - getPathWithoutFinalSlashW(lDirname, aDefaultPathAndFile); - getLastNameW(lBuff, aDefaultPathAndFile); - - if (aNumOfFilterPatterns > 0) - { - ldefExt = aFilterPatterns[0]; - - if (aSingleFilterDescription && wcslen(aSingleFilterDescription)) - { - wcscpy(lFilterPatterns, aSingleFilterDescription); - wcscat(lFilterPatterns, L"\n"); - } - wcscat(lFilterPatterns, aFilterPatterns[0]); - for (i = 1; i < aNumOfFilterPatterns; i++) - { - wcscat(lFilterPatterns, L";"); - wcscat(lFilterPatterns, aFilterPatterns[i]); - } - wcscat(lFilterPatterns, L"\n"); - if (!(aSingleFilterDescription && wcslen(aSingleFilterDescription))) - { - wcscpy(lDialogString, lFilterPatterns); - wcscat(lFilterPatterns, lDialogString); - } - wcscat(lFilterPatterns, L"All Files\n*.*\n"); - p = lFilterPatterns; - while ((p = wcschr(p, L'\n')) != NULL) - { - *p = L'\0'; - p++; - } - } - - ofn.lStructSize = sizeof(OPENFILENAMEW); - ofn.hwndOwner = GetForegroundWindow(); - ofn.hInstance = 0; - ofn.lpstrFilter = wcslen(lFilterPatterns) ? lFilterPatterns : NULL; - ofn.lpstrCustomFilter = NULL; - ofn.nMaxCustFilter = 0; - ofn.nFilterIndex = 1; - ofn.lpstrFile = lBuff; - - ofn.nMaxFile = MAX_PATH_OR_CMD; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = MAX_PATH_OR_CMD/2; - ofn.lpstrInitialDir = wcslen(lDirname) ? lDirname : NULL; - ofn.lpstrTitle = aTitle && wcslen(aTitle) ? aTitle : NULL; - ofn.Flags = OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST ; - ofn.nFileOffset = 0; - ofn.nFileExtension = 0; - ofn.lpstrDefExt = ldefExt; - ofn.lCustData = 0L; - ofn.lpfnHook = NULL; - ofn.lpTemplateName = NULL; - - if (GetSaveFileNameW(&ofn) == 0) - { - lRetval = NULL; - } - else - { - lRetval = lBuff; - } - - if (lHResult == S_OK || lHResult == S_FALSE) - { - CoUninitialize(); - } - return lRetval; -} - - -wchar_t * tinyfd_openFileDialogW( - wchar_t const * aTitle, /* NULL or "" */ - wchar_t const * aDefaultPathAndFile, /* NULL or "" */ - int aNumOfFilterPatterns, /* 0 */ - wchar_t const * const * aFilterPatterns, /* NULL or {"*.jpg","*.png"} */ - wchar_t const * aSingleFilterDescription, /* NULL or "image files" */ - int aAllowMultipleSelects) /* 0 or 1 ; -1 to free allocated memory and return */ -{ - size_t lLengths[MAX_MULTIPLE_FILES]; - wchar_t lDirname[MAX_PATH_OR_CMD]; - wchar_t lFilterPatterns[MAX_PATH_OR_CMD] = L""; - wchar_t lDialogString[MAX_PATH_OR_CMD]; - wchar_t * lPointers[MAX_MULTIPLE_FILES+1]; - wchar_t * p; - int i, j; - size_t lBuffLen; - DWORD lFullBuffLen; - HRESULT lHResult; - OPENFILENAMEW ofn = { 0 }; - static wchar_t * lBuff = NULL; - - free(lBuff); - lBuff = NULL; - if (aAllowMultipleSelects < 0) return (wchar_t *)0; - - if (aTitle&&!wcscmp(aTitle, L"tinyfd_query")){ strcpy(tinyfd_response, "windows_wchar"); return (wchar_t *)1; } - - if (quoteDetectedW(aTitle)) return tinyfd_openFileDialogW(L"INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription, aAllowMultipleSelects); - if (quoteDetectedW(aDefaultPathAndFile)) return tinyfd_openFileDialogW(aTitle, L"INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription, aAllowMultipleSelects); - if (quoteDetectedW(aSingleFilterDescription)) return tinyfd_openFileDialogW(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, L"INVALID FILTER_DESCRIPTION WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aAllowMultipleSelects); - for (i = 0; i < aNumOfFilterPatterns; i++) - { - if (quoteDetectedW(aFilterPatterns[i])) return tinyfd_openFileDialogW(L"INVALID FILTER_PATTERN WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, 0, NULL, NULL, aAllowMultipleSelects); - } - - if (aAllowMultipleSelects) - { - lFullBuffLen = MAX_MULTIPLE_FILES * MAX_PATH_OR_CMD + 1; - lBuff = (wchar_t*)(malloc(lFullBuffLen * sizeof(wchar_t))); - if (!lBuff) - { - lFullBuffLen = LOW_MULTIPLE_FILES * MAX_PATH_OR_CMD + 1; - lBuff = (wchar_t*)( malloc( lFullBuffLen * sizeof(wchar_t))); - } - } - else - { - lFullBuffLen = MAX_PATH_OR_CMD + 1; - lBuff = (wchar_t*)(malloc(lFullBuffLen * sizeof(wchar_t))); - } - if (!lBuff) return NULL; - - lHResult = CoInitializeEx(NULL, 0); - - getPathWithoutFinalSlashW(lDirname, aDefaultPathAndFile); - getLastNameW(lBuff, aDefaultPathAndFile); - - if (aNumOfFilterPatterns > 0) - { - if (aSingleFilterDescription && wcslen(aSingleFilterDescription)) - { - wcscpy(lFilterPatterns, aSingleFilterDescription); - wcscat(lFilterPatterns, L"\n"); - } - wcscat(lFilterPatterns, aFilterPatterns[0]); - for (i = 1; i < aNumOfFilterPatterns; i++) - { - wcscat(lFilterPatterns, L";"); - wcscat(lFilterPatterns, aFilterPatterns[i]); - } - wcscat(lFilterPatterns, L"\n"); - if (!(aSingleFilterDescription && wcslen(aSingleFilterDescription))) - { - wcscpy(lDialogString, lFilterPatterns); - wcscat(lFilterPatterns, lDialogString); - } - wcscat(lFilterPatterns, L"All Files\n*.*\n"); - p = lFilterPatterns; - while ((p = wcschr(p, L'\n')) != NULL) - { - *p = L'\0'; - p++; - } - } - - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = GetForegroundWindow(); - ofn.hInstance = 0; - ofn.lpstrFilter = wcslen(lFilterPatterns) ? lFilterPatterns : NULL; - ofn.lpstrCustomFilter = NULL; - ofn.nMaxCustFilter = 0; - ofn.nFilterIndex = 1; - ofn.lpstrFile = lBuff; - ofn.nMaxFile = lFullBuffLen; - ofn.lpstrFileTitle = NULL; - ofn.nMaxFileTitle = MAX_PATH_OR_CMD / 2; - ofn.lpstrInitialDir = wcslen(lDirname) ? lDirname : NULL; - ofn.lpstrTitle = aTitle && wcslen(aTitle) ? aTitle : NULL; - ofn.Flags = OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; - ofn.nFileOffset = 0; - ofn.nFileExtension = 0; - ofn.lpstrDefExt = NULL; - ofn.lCustData = 0L; - ofn.lpfnHook = NULL; - ofn.lpTemplateName = NULL; - - if (aAllowMultipleSelects) - { - ofn.Flags |= OFN_ALLOWMULTISELECT; - } - - if (GetOpenFileNameW(&ofn) == 0) - { - free(lBuff); - lBuff = NULL; - } - else - { - lBuffLen = wcslen(lBuff); - lPointers[0] = lBuff + lBuffLen + 1; - if (aAllowMultipleSelects && (lPointers[0][0] != L'\0')) - { - i = 0; - do - { - lLengths[i] = wcslen(lPointers[i]); - lPointers[i + 1] = lPointers[i] + lLengths[i] + 1; - i++; - } while (lPointers[i][0] != L'\0' && i < MAX_MULTIPLE_FILES ); - if (i > MAX_MULTIPLE_FILES) - { - free(lBuff); - lBuff = NULL; - } - else - { - i--; - p = lBuff + lFullBuffLen - 1; - *p = L'\0'; - for (j = i; j >= 0; j--) - { - p -= lLengths[j]; - memmove(p, lPointers[j], lLengths[j] * sizeof(wchar_t)); - p--; - *p = L'\\'; - p -= lBuffLen; - memmove(p, lBuff, lBuffLen*sizeof(wchar_t)); - p--; - *p = L'|'; - } - p++; - wcscpy(lBuff, p); - lBuffLen = wcslen(lBuff); - } - } - if (lBuff) lBuff = (wchar_t*)(realloc(lBuff, (lBuffLen + 1) * sizeof(wchar_t))); - } - - if (lHResult == S_OK || lHResult == S_FALSE) - { - CoUninitialize(); - } - return lBuff; -} - - -BOOL CALLBACK BrowseCallbackProcW_enum(HWND hWndChild, LPARAM lParam) -{ - wchar_t buf[255]; - GetClassNameW(hWndChild, buf, sizeof(buf)); - if (wcscmp(buf, L"SysTreeView32") == 0) { - HTREEITEM hNode = TreeView_GetSelection(hWndChild); - TreeView_EnsureVisible(hWndChild, hNode); - return FALSE; - } - return TRUE; -} - - -static int __stdcall BrowseCallbackProcW(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) -{ - switch (uMsg) { - case BFFM_INITIALIZED: - SendMessage(hwnd, BFFM_SETSELECTIONW, TRUE, (LPARAM)pData); - break; - case BFFM_SELCHANGED: - EnumChildWindows(hwnd, BrowseCallbackProcW_enum, 0); - } - return 0; -} - -wchar_t * tinyfd_selectFolderDialogW( - wchar_t const * aTitle, /* NULL or "" */ - wchar_t const * aDefaultPath) /* NULL or "" */ -{ - static wchar_t lBuff[MAX_PATH_OR_CMD]; - wchar_t * lRetval; - - BROWSEINFOW bInfo; - LPITEMIDLIST lpItem; - HRESULT lHResult; - - if (aTitle&&!wcscmp(aTitle, L"tinyfd_query")){ strcpy(tinyfd_response, "windows_wchar"); return (wchar_t *)1; } - - if (quoteDetectedW(aTitle)) return tinyfd_selectFolderDialogW(L"INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPath); - if (quoteDetectedW(aDefaultPath)) return tinyfd_selectFolderDialogW(aTitle, L"INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - - lHResult = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); - - bInfo.hwndOwner = GetForegroundWindow(); - bInfo.pidlRoot = NULL; - bInfo.pszDisplayName = lBuff; - bInfo.lpszTitle = aTitle && wcslen(aTitle) ? aTitle : NULL; - if (lHResult == S_OK || lHResult == S_FALSE) - { - bInfo.ulFlags = BIF_USENEWUI; - } - bInfo.lpfn = BrowseCallbackProcW; - bInfo.lParam = (LPARAM)aDefaultPath; - bInfo.iImage = -1; - - lpItem = SHBrowseForFolderW(&bInfo); - if (!lpItem) - { - lRetval = NULL; - } - else - { - SHGetPathFromIDListW(lpItem, lBuff); - lRetval = lBuff ; - } - - if (lHResult == S_OK || lHResult == S_FALSE) - { - CoUninitialize(); - } - return lRetval; -} - - -wchar_t * tinyfd_colorChooserW( - wchar_t const * aTitle, /* NULL or "" */ - wchar_t const * aDefaultHexRGB, /* NULL or "#FF0000"*/ - unsigned char const aDefaultRGB[3], /* { 0 , 255 , 255 } */ - unsigned char aoResultRGB[3]) /* { 0 , 0 , 0 } */ -{ - static wchar_t lResultHexRGB[8]; - CHOOSECOLORW cc; - COLORREF crCustColors[16]; - unsigned char lDefaultRGB[3]; - int lRet; - - HRESULT lHResult; - - if (aTitle&&!wcscmp(aTitle, L"tinyfd_query")){ strcpy(tinyfd_response, "windows_wchar"); return (wchar_t *)1; } - - if (quoteDetectedW(aTitle)) return tinyfd_colorChooserW(L"INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultHexRGB, aDefaultRGB, aoResultRGB); - if (quoteDetectedW(aDefaultHexRGB)) return tinyfd_colorChooserW(aTitle, L"INVALID DEFAULT_HEX_RGB WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultRGB, aoResultRGB); - - lHResult = CoInitializeEx(NULL, 0); - - if ( aDefaultHexRGB ) - { - Hex2RGBW(aDefaultHexRGB, lDefaultRGB); - } - else - { - lDefaultRGB[0] = aDefaultRGB[0]; - lDefaultRGB[1] = aDefaultRGB[1]; - lDefaultRGB[2] = aDefaultRGB[2]; - } - - /* we can't use aTitle */ - cc.lStructSize = sizeof(CHOOSECOLOR); - cc.hwndOwner = GetForegroundWindow(); - cc.hInstance = NULL; - cc.rgbResult = RGB(lDefaultRGB[0], lDefaultRGB[1], lDefaultRGB[2]); - cc.lpCustColors = crCustColors; - cc.Flags = CC_RGBINIT | CC_FULLOPEN | CC_ANYCOLOR ; - cc.lCustData = 0; - cc.lpfnHook = NULL; - cc.lpTemplateName = NULL; - - lRet = ChooseColorW(&cc); - - if (!lRet) - { - return NULL; - } - - aoResultRGB[0] = GetRValue(cc.rgbResult); - aoResultRGB[1] = GetGValue(cc.rgbResult); - aoResultRGB[2] = GetBValue(cc.rgbResult); - - RGB2HexW(aoResultRGB, lResultHexRGB); - - if (lHResult == S_OK || lHResult == S_FALSE) - { - CoUninitialize(); - } - - return lResultHexRGB; -} - - -static int messageBoxWinGui( - char const * aTitle, /* NULL or "" */ - char const * aMessage, /* NULL or "" may contain \n and \t */ - char const * aDialogType, /* "ok" "okcancel" "yesno" "yesnocancel" */ - char const * aIconType, /* "info" "warning" "error" "question" */ - int aDefaultButton) /* 0 for cancel/no , 1 for ok/yes , 2 for no in yesnocancel */ -{ - int lIntRetVal; - wchar_t lTitle[128] = L""; - wchar_t * lMessage = NULL; - wchar_t lDialogType[16] = L""; - wchar_t lIconType[16] = L""; - wchar_t * lTmpWChar; - - if (aTitle) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aTitle); - else lTmpWChar = tinyfd_mbcsTo16(aTitle); - wcscpy(lTitle, lTmpWChar); - } - if (aMessage) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aMessage); - else lTmpWChar = tinyfd_mbcsTo16(aMessage); - lMessage = (wchar_t *) malloc((wcslen(lTmpWChar) + 1)* sizeof(wchar_t)); - if (lMessage) wcscpy(lMessage, lTmpWChar); - } - if (aDialogType) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aDialogType); - else lTmpWChar = tinyfd_mbcsTo16(aDialogType); - wcscpy(lDialogType, lTmpWChar); - } - if (aIconType) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aIconType); - else lTmpWChar = tinyfd_mbcsTo16(aIconType); - wcscpy(lIconType, lTmpWChar); - } - - lIntRetVal = tinyfd_messageBoxW(lTitle, lMessage, lDialogType, lIconType, aDefaultButton); - - free(lMessage); - - return lIntRetVal; -} - - -static int notifyWinGui( - char const * aTitle, /* NULL or "" */ - char const * aMessage, /* NULL or "" may NOT contain \n nor \t */ - char const * aIconType) -{ - wchar_t lTitle[128] = L""; - wchar_t * lMessage = NULL; - wchar_t lIconType[16] = L""; - wchar_t * lTmpWChar; - - if (aTitle) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aTitle); - else lTmpWChar = tinyfd_mbcsTo16(aTitle); - wcscpy(lTitle, lTmpWChar); - } - if (aMessage) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aMessage); - else lTmpWChar = tinyfd_mbcsTo16(aMessage); - lMessage = (wchar_t *) malloc((wcslen(lTmpWChar) + 1)* sizeof(wchar_t)); - if (lMessage) wcscpy(lMessage, lTmpWChar); - } - if (aIconType) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aIconType); - else lTmpWChar = tinyfd_mbcsTo16(aIconType); - wcscpy(lIconType, lTmpWChar); - } - - tinyfd_notifyPopupW(lTitle, lMessage, lIconType); - - free(lMessage); - - return 1; -} - - -static int inputBoxWinGui( - char * aoBuff, - char const * aTitle, /* NULL or "" */ - char const * aMessage, /* NULL or "" may NOT contain \n nor \t */ - char const * aDefaultInput) /* "" , if NULL it's a passwordBox */ -{ - wchar_t lTitle[128] = L""; - wchar_t * lMessage = NULL; - wchar_t lDefaultInput[MAX_PATH_OR_CMD] = L""; - wchar_t * lTmpWChar; - char * lTmpChar; - - if (aTitle) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aTitle); - else lTmpWChar = tinyfd_mbcsTo16(aTitle); - wcscpy(lTitle, lTmpWChar); - } - if (aMessage) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aMessage); - else lTmpWChar = tinyfd_mbcsTo16(aMessage); - lMessage = (wchar_t *) malloc((wcslen(lTmpWChar) + 1)* sizeof(wchar_t)); - if (lMessage) wcscpy(lMessage, lTmpWChar); - } - if (aDefaultInput) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aDefaultInput); - else lTmpWChar = tinyfd_mbcsTo16(aDefaultInput); - wcscpy(lDefaultInput, lTmpWChar); - lTmpWChar = tinyfd_inputBoxW(lTitle, lMessage, lDefaultInput); - } - else lTmpWChar = tinyfd_inputBoxW(lTitle, lMessage, NULL); - - free(lMessage); - - if (!lTmpWChar) - { - aoBuff[0] = '\0'; - return 0; - } - - if (tinyfd_winUtf8) lTmpChar = tinyfd_utf16to8(lTmpWChar); - else lTmpChar = tinyfd_utf16toMbcs(lTmpWChar); - - strcpy(aoBuff, lTmpChar); - - return 1; -} - - -static char * saveFileDialogWinGui( - char * aoBuff, - char const * aTitle, /* NULL or "" */ - char const * aDefaultPathAndFile, /* NULL or "" */ - int aNumOfFilterPatterns, /* 0 */ - char const * const * aFilterPatterns, /* NULL or {"*.jpg","*.png"} */ - char const * aSingleFilterDescription) /* NULL or "image files" */ -{ - wchar_t lTitle[128] = L""; - wchar_t lDefaultPathAndFile[MAX_PATH_OR_CMD] = L""; - wchar_t lSingleFilterDescription[128] = L""; - wchar_t * * lFilterPatterns; - wchar_t * lTmpWChar; - char * lTmpChar; - int i; - - lFilterPatterns = (wchar_t **)malloc(aNumOfFilterPatterns*sizeof(wchar_t *)); - for (i = 0; i < aNumOfFilterPatterns; i++) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aFilterPatterns[i]); - else lTmpWChar = tinyfd_mbcsTo16(aFilterPatterns[i]); - lFilterPatterns[i] = (wchar_t *)malloc((wcslen(lTmpWChar) + 1) * sizeof(wchar_t *)); - if (lFilterPatterns[i]) wcscpy(lFilterPatterns[i], lTmpWChar); - } - - if (aTitle) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aTitle); - else lTmpWChar = tinyfd_mbcsTo16(aTitle); - wcscpy(lTitle, lTmpWChar); - } - if (aDefaultPathAndFile) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aDefaultPathAndFile); - else lTmpWChar = tinyfd_mbcsTo16(aDefaultPathAndFile); - wcscpy(lDefaultPathAndFile, lTmpWChar); - } - if (aSingleFilterDescription) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aSingleFilterDescription); - else lTmpWChar = tinyfd_mbcsTo16(aSingleFilterDescription); - wcscpy(lSingleFilterDescription, lTmpWChar); - } - - lTmpWChar = tinyfd_saveFileDialogW( - lTitle, - lDefaultPathAndFile, - aNumOfFilterPatterns, - (wchar_t const**) lFilterPatterns, /*stupid cast for gcc*/ - lSingleFilterDescription); - - for (i = 0; i < aNumOfFilterPatterns; i++) - { - free(lFilterPatterns[i]); - } - free(lFilterPatterns); - - if (!lTmpWChar) - { - return NULL; - } - - if (tinyfd_winUtf8) lTmpChar = tinyfd_utf16to8(lTmpWChar); - else lTmpChar = tinyfd_utf16toMbcs(lTmpWChar); - strcpy(aoBuff, lTmpChar); - if (tinyfd_winUtf8) (void)tinyfd_utf16to8(NULL); - else (void)tinyfd_utf16toMbcs(NULL); - - return aoBuff; -} - - -static char * openFileDialogWinGui( - char const * aTitle, /* NULL or "" */ - char const * aDefaultPathAndFile, /* NULL or "" */ - int aNumOfFilterPatterns, /* 0 */ - char const * const * aFilterPatterns, /* NULL or {"*.jpg","*.png"} */ - char const * aSingleFilterDescription, /* NULL or "image files" */ - int aAllowMultipleSelects) /* 0 or 1 */ -{ - wchar_t lTitle[128] = L""; - wchar_t lDefaultPathAndFile[MAX_PATH_OR_CMD] = L""; - wchar_t lSingleFilterDescription[128] = L""; - wchar_t * * lFilterPatterns; - wchar_t * lTmpWChar; - char * lTmpChar; - int i; - - lFilterPatterns = (wchar_t * *)malloc(aNumOfFilterPatterns*sizeof(wchar_t *)); - for (i = 0; i < aNumOfFilterPatterns; i++) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aFilterPatterns[i]); - else lTmpWChar = tinyfd_mbcsTo16(aFilterPatterns[i]); - lFilterPatterns[i] = (wchar_t *)malloc((wcslen(lTmpWChar) + 1)*sizeof(wchar_t *)); - if (lFilterPatterns[i]) wcscpy(lFilterPatterns[i], lTmpWChar); - } - - if (aTitle) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aTitle); - else lTmpWChar = tinyfd_mbcsTo16(aTitle); - wcscpy(lTitle, lTmpWChar); - } - if (aDefaultPathAndFile) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aDefaultPathAndFile); - else lTmpWChar = tinyfd_mbcsTo16(aDefaultPathAndFile); - wcscpy(lDefaultPathAndFile, lTmpWChar); - } - if (aSingleFilterDescription) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aSingleFilterDescription); - else lTmpWChar = tinyfd_mbcsTo16(aSingleFilterDescription); - wcscpy(lSingleFilterDescription, lTmpWChar); - } - - lTmpWChar = tinyfd_openFileDialogW( - lTitle, - lDefaultPathAndFile, - aNumOfFilterPatterns, - (wchar_t const**) lFilterPatterns, /*stupid cast for gcc*/ - lSingleFilterDescription, - aAllowMultipleSelects); - - for (i = 0; i < aNumOfFilterPatterns; i++) - { - free(lFilterPatterns[i]); - } - free(lFilterPatterns); - - if (!lTmpWChar) return NULL; - - if (tinyfd_winUtf8) lTmpChar = tinyfd_utf16to8(lTmpWChar); - else lTmpChar = tinyfd_utf16toMbcs(lTmpWChar); - (void)tinyfd_openFileDialogW(NULL, NULL, 0, NULL, NULL, -1); - - return lTmpChar; -} - - -static char * selectFolderDialogWinGui( - char * aoBuff, - char const * aTitle, /* NULL or "" */ - char const * aDefaultPath) /* NULL or "" */ -{ - wchar_t lTitle[128] = L""; - wchar_t lDefaultPath[MAX_PATH_OR_CMD] = L""; - wchar_t * lTmpWChar; - char * lTmpChar; - - if (aTitle) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aTitle); - else lTmpWChar = tinyfd_mbcsTo16(aTitle); - wcscpy(lTitle, lTmpWChar); - } - if (aDefaultPath) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aDefaultPath); - else lTmpWChar = tinyfd_mbcsTo16(aDefaultPath); - wcscpy(lDefaultPath, lTmpWChar); - } - - lTmpWChar = tinyfd_selectFolderDialogW( - lTitle, - lDefaultPath); - - if (!lTmpWChar) - { - return NULL; - } - - if (tinyfd_winUtf8) lTmpChar = tinyfd_utf16to8(lTmpWChar); - else lTmpChar = tinyfd_utf16toMbcs(lTmpWChar); - strcpy(aoBuff, lTmpChar); - - return aoBuff; -} - - -static char * colorChooserWinGui( - char const * aTitle, /* NULL or "" */ - char const * aDefaultHexRGB, /* NULL or "#FF0000"*/ - unsigned char const aDefaultRGB[3], /* { 0 , 255 , 255 } */ - unsigned char aoResultRGB[3]) /* { 0 , 0 , 0 } */ -{ - static char lResultHexRGB[8]; - - wchar_t lTitle[128]; - wchar_t lDefaultHexRGB[16]; - wchar_t * lTmpWChar; - char * lTmpChar; - - if (aTitle) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aTitle); - else lTmpWChar = tinyfd_mbcsTo16(aTitle); - wcscpy(lTitle, lTmpWChar); - } - if (aDefaultHexRGB) - { - if (tinyfd_winUtf8) lTmpWChar = tinyfd_utf8to16(aDefaultHexRGB); - else lTmpWChar = tinyfd_mbcsTo16(aDefaultHexRGB); - wcscpy(lDefaultHexRGB, lTmpWChar); - } - - lTmpWChar = tinyfd_colorChooserW( - lTitle, - lDefaultHexRGB, - aDefaultRGB, - aoResultRGB ); - - if (!lTmpWChar) - { - return NULL; - } - - if (tinyfd_winUtf8) lTmpChar = tinyfd_utf16to8(lTmpWChar); - else lTmpChar = tinyfd_utf16toMbcs(lTmpWChar); - strcpy(lResultHexRGB, lTmpChar); - - return lResultHexRGB; -} - - -static int dialogPresent(void) -{ - static int lDialogPresent = -1 ; - char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - char const * lString = "dialog.exe"; - if (!tinyfd_allowCursesDialogs) return 0; - if (lDialogPresent < 0) - { - if (!(lIn = _popen("where dialog.exe","r"))) - { - lDialogPresent = 0 ; - return 0 ; - } - while ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - {} - _pclose( lIn ) ; - if ( lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - if ( strcmp(lBuff+strlen(lBuff)-strlen(lString),lString) ) - { - lDialogPresent = 0 ; - } - else - { - lDialogPresent = 1 ; - } - } - return lDialogPresent; -} - - -static int messageBoxWinConsole( - char const * aTitle , /* NULL or "" */ - char const * aMessage , /* NULL or "" may contain \n and \t */ - char const * aDialogType , /* "ok" "okcancel" "yesno" "yesnocancel" */ - char const * aIconType , /* "info" "warning" "error" "question" */ - int aDefaultButton ) /* 0 for cancel/no , 1 for ok/yes , 2 for no in yesnocancel */ -{ - char lDialogString[MAX_PATH_OR_CMD]; - char lDialogFile[MAX_PATH_OR_CMD]; - FILE * lIn; - char lBuff[MAX_PATH_OR_CMD] = ""; - - strcpy(lDialogString, "dialog "); - if (aTitle && strlen(aTitle)) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - if ( aDialogType && ( !strcmp( "okcancel" , aDialogType ) - || !strcmp("yesno", aDialogType) || !strcmp("yesnocancel", aDialogType) ) ) - { - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, "tab: move focus") ; - strcat(lDialogString, "\" ") ; - } - - if ( aDialogType && ! strcmp( "okcancel" , aDialogType ) ) - { - if ( ! aDefaultButton ) - { - strcat( lDialogString , "--defaultno " ) ; - } - strcat( lDialogString , - "--yes-label \"Ok\" --no-label \"Cancel\" --yesno " ) ; - } - else if ( aDialogType && ! strcmp( "yesno" , aDialogType ) ) - { - if ( ! aDefaultButton ) - { - strcat( lDialogString , "--defaultno " ) ; - } - strcat( lDialogString , "--yesno " ) ; - } - else if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - if (!aDefaultButton) - { - strcat(lDialogString, "--defaultno "); - } - strcat(lDialogString, "--menu "); - } - else - { - strcat( lDialogString , "--msgbox " ) ; - } - - strcat( lDialogString , "\"" ) ; - if ( aMessage && strlen(aMessage) ) - { - tfd_replaceSubStr( aMessage , "\n" , "\\n" , lBuff ) ; - strcat(lDialogString, lBuff) ; - lBuff[0]='\0'; - } - strcat(lDialogString, "\" "); - - if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - strcat(lDialogString, "0 60 0 Yes \"\" No \"\""); - strcat(lDialogString, "2>>"); - } - else - { - strcat(lDialogString, "10 60"); - strcat(lDialogString, " && echo 1 > "); - } - - strcpy(lDialogFile, getenv("TEMP")); - strcat(lDialogFile, "\\tinyfd.txt"); - strcat(lDialogString, lDialogFile); - - /*if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ;*/ - system( lDialogString ) ; - - if (!(lIn = fopen(lDialogFile, "r"))) - { - remove(lDialogFile); - return 0 ; - } - while (fgets(lBuff, sizeof(lBuff), lIn) != NULL) - {} - fclose(lIn); - remove(lDialogFile); - if ( lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - - /* if (tinyfd_verbose) printf("lBuff: %s\n", lBuff); */ - if ( ! strlen(lBuff) ) - { - return 0; - } - - if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - if (lBuff[0] == 'Y') return 1; - else return 2; - } - - return 1; -} - - -static int inputBoxWinConsole( - char * aoBuff , - char const * aTitle , /* NULL or "" */ - char const * aMessage , /* NULL or "" may NOT contain \n nor \t */ - char const * aDefaultInput ) /* "" , if NULL it's a passwordBox */ -{ - char lDialogString[MAX_PATH_OR_CMD]; - char lDialogFile[MAX_PATH_OR_CMD]; - FILE * lIn; - int lResult; - - strcpy(lDialogFile, getenv("TEMP")); - strcat(lDialogFile, "\\tinyfd.txt"); - strcpy(lDialogString , "echo|set /p=1 >" ) ; - strcat(lDialogString, lDialogFile); - strcat( lDialogString , " & " ) ; - - strcat( lDialogString , "dialog " ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, "tab: move focus") ; - if ( ! aDefaultInput ) - { - strcat(lDialogString, " (sometimes nothing, no blink nor star, is shown in text field)") ; - } - - strcat(lDialogString, "\" ") ; - - if ( ! aDefaultInput ) - { - strcat( lDialogString , "--insecure --passwordbox" ) ; - } - else - { - strcat( lDialogString , "--inputbox" ) ; - } - strcat( lDialogString , " \"" ) ; - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, aMessage) ; - } - strcat(lDialogString,"\" 10 60 ") ; - if ( aDefaultInput && strlen(aDefaultInput) ) - { - strcat(lDialogString, "\"") ; - strcat(lDialogString, aDefaultInput) ; - strcat(lDialogString, "\" ") ; - } - - strcat(lDialogString, "2>>"); - strcpy(lDialogFile, getenv("TEMP")); - strcat(lDialogFile, "\\tinyfd.txt"); - strcat(lDialogString, lDialogFile); - strcat(lDialogString, " || echo 0 > "); - strcat(lDialogString, lDialogFile); - - /* printf( "lDialogString: %s\n" , lDialogString ) ; */ - system( lDialogString ) ; - - if (!(lIn = fopen(lDialogFile, "r"))) - { - remove(lDialogFile); - aoBuff[0] = '\0'; - return 0; - } - while (fgets(aoBuff, MAX_PATH_OR_CMD, lIn) != NULL) - {} - fclose(lIn); - - wipefile(lDialogFile); - remove(lDialogFile); - if ( aoBuff[strlen( aoBuff ) -1] == '\n' ) - { - aoBuff[strlen( aoBuff ) -1] = '\0' ; - } - /* printf( "aoBuff: %s\n" , aoBuff ) ; */ - - /* printf( "aoBuff: %s len: %lu \n" , aoBuff , strlen(aoBuff) ) ; */ - lResult = strncmp( aoBuff , "1" , 1) ? 0 : 1 ; - /* printf( "lResult: %d \n" , lResult ) ; */ - if ( ! lResult ) - { - aoBuff[0] = '\0'; - return 0 ; - } - /* printf( "aoBuff+1: %s\n" , aoBuff+1 ) ; */ - strcpy(aoBuff, aoBuff+3); - return 1; -} - - -static char * saveFileDialogWinConsole( - char * aoBuff , - char const * aTitle , /* NULL or "" */ - char const * aDefaultPathAndFile ) /* NULL or "" */ -{ - char lDialogString[MAX_PATH_OR_CMD]; - char lPathAndFile[MAX_PATH_OR_CMD] = ""; - FILE * lIn; - - strcpy( lDialogString , "dialog " ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, - "tab: focus | /: populate | spacebar: fill text field | ok: TEXT FIELD ONLY") ; - strcat(lDialogString, "\" ") ; - - strcat( lDialogString , "--fselect \"" ) ; - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - /* dialog.exe uses unix separators even on windows */ - strcpy(lPathAndFile, aDefaultPathAndFile); - replaceChr( lPathAndFile , '\\' , '/' ) ; - } - - /* dialog.exe needs at least one separator */ - if ( ! strchr(lPathAndFile, '/') ) - { - strcat(lDialogString, "./") ; - } - strcat(lDialogString, lPathAndFile) ; - strcat(lDialogString, "\" 0 60 2>"); - strcpy(lPathAndFile, getenv("TEMP")); - strcat(lPathAndFile, "\\tinyfd.txt"); - strcat(lDialogString, lPathAndFile); - - /* printf( "lDialogString: %s\n" , lDialogString ) ; */ - system( lDialogString ) ; - - if (!(lIn = fopen(lPathAndFile, "r"))) - { - remove(lPathAndFile); - return NULL; - } - while (fgets(aoBuff, MAX_PATH_OR_CMD, lIn) != NULL) - {} - fclose(lIn); - remove(lPathAndFile); - replaceChr( aoBuff , '/' , '\\' ) ; - /* printf( "aoBuff: %s\n" , aoBuff ) ; */ - getLastName(lDialogString,aoBuff); - if ( ! strlen(lDialogString) ) - { - return NULL; - } - return aoBuff; -} - - -static char * openFileDialogWinConsole( - char const * aTitle , /* NULL or "" */ - char const * aDefaultPathAndFile ) /* NULL or "" */ -{ - char lFilterPatterns[MAX_PATH_OR_CMD] = ""; - char lDialogString[MAX_PATH_OR_CMD] ; - FILE * lIn; - - static char aoBuff[MAX_PATH_OR_CMD]; - - strcpy( lDialogString , "dialog " ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, - "tab: focus | /: populate | spacebar: fill text field | ok: TEXT FIELD ONLY") ; - strcat(lDialogString, "\" ") ; - - strcat( lDialogString , "--fselect \"" ) ; - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - /* dialog.exe uses unix separators even on windows */ - strcpy(lFilterPatterns, aDefaultPathAndFile); - replaceChr( lFilterPatterns , '\\' , '/' ) ; - } - - /* dialog.exe needs at least one separator */ - if ( ! strchr(lFilterPatterns, '/') ) - { - strcat(lDialogString, "./") ; - } - strcat(lDialogString, lFilterPatterns) ; - strcat(lDialogString, "\" 0 60 2>"); - strcpy(lFilterPatterns, getenv("TEMP")); - strcat(lFilterPatterns, "\\tinyfd.txt"); - strcat(lDialogString, lFilterPatterns); - - /* printf( "lDialogString: %s\n" , lDialogString ) ; */ - system( lDialogString ) ; - - if (!(lIn = fopen(lFilterPatterns, "r"))) - { - remove(lFilterPatterns); - return NULL; - } - while (fgets(aoBuff, MAX_PATH_OR_CMD, lIn) != NULL) - {} - fclose(lIn); - remove(lFilterPatterns); - replaceChr( aoBuff , '/' , '\\' ) ; - /* printf( "aoBuff: %s\n" , aoBuff ) ; */ - return aoBuff; -} - - -static char * selectFolderDialogWinConsole( - char * aoBuff , - char const * aTitle , /* NULL or "" */ - char const * aDefaultPath ) /* NULL or "" */ -{ - char lDialogString[MAX_PATH_OR_CMD] ; - char lString[MAX_PATH_OR_CMD] ; - FILE * lIn ; - - strcpy( lDialogString , "dialog " ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, - "tab: focus | /: populate | spacebar: fill text field | ok: TEXT FIELD ONLY") ; - strcat(lDialogString, "\" ") ; - - strcat( lDialogString , "--dselect \"" ) ; - if ( aDefaultPath && strlen(aDefaultPath) ) - { - /* dialog.exe uses unix separators even on windows */ - strcpy(lString, aDefaultPath) ; - ensureFinalSlash(lString); - replaceChr( lString , '\\' , '/' ) ; - strcat(lDialogString, lString) ; - } - else - { - /* dialog.exe needs at least one separator */ - strcat(lDialogString, "./") ; - } - strcat(lDialogString, "\" 0 60 2>"); - strcpy(lString, getenv("TEMP")); - strcat(lString, "\\tinyfd.txt"); - strcat(lDialogString, lString); - - /* printf( "lDialogString: %s\n" , lDialogString ) ; */ - system( lDialogString ) ; - - if (!(lIn = fopen(lString, "r"))) - { - remove(lString); - return NULL; - } - while (fgets(aoBuff, MAX_PATH_OR_CMD, lIn) != NULL) - {} - fclose(lIn); - remove(lString); - replaceChr( aoBuff , '/' , '\\' ) ; - /* printf( "aoBuff: %s\n" , aoBuff ) ; */ - return aoBuff; -} - -static void writeUtf8( char const * aUtf8String ) -{ - unsigned long lNum; - void * lConsoleHandle; - wchar_t * lTmpWChar; - - lConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); - lTmpWChar = tinyfd_utf8to16(aUtf8String); - (void)WriteConsoleW(lConsoleHandle, lTmpWChar, (DWORD) wcslen(lTmpWChar), &lNum, NULL); -} - - -int tinyfd_messageBox( - char const * aTitle, /* NULL or "" */ - char const * aMessage, /* NULL or "" may contain \n and \t */ - char const * aDialogType, /* "ok" "okcancel" "yesno" "yesnocancel" */ - char const * aIconType, /* "info" "warning" "error" "question" */ - int aDefaultButton) /* 0 for cancel/no , 1 for ok/yes , 2 for no in yesnocancel */ -{ - char lChar; - UINT lOriginalCP = 0; - UINT lOriginalOutputCP = 0; - - if (tfd_quoteDetected(aTitle)) return tinyfd_messageBox("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aMessage, aDialogType, aIconType, aDefaultButton); - if (tfd_quoteDetected(aMessage)) return tinyfd_messageBox(aTitle, "INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDialogType, aIconType, aDefaultButton); - - if ((!tinyfd_forceConsole || !(GetConsoleWindow() || dialogPresent())) - && (!getenv("SSH_CLIENT") || getenvDISPLAY())) - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "windows"); return 1; } - return messageBoxWinGui(aTitle, aMessage, aDialogType, aIconType, aDefaultButton); - } - else if (dialogPresent()) - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "dialog"); return 0; } - return messageBoxWinConsole( - aTitle, aMessage, aDialogType, aIconType, aDefaultButton); - } - else - { - if (!tinyfd_winUtf8) - { - lOriginalCP = GetConsoleCP(); - lOriginalOutputCP = GetConsoleOutputCP(); - (void)SetConsoleCP(GetACP()); - (void)SetConsoleOutputCP(GetACP()); - } - - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "basicinput"); return 0; } - if (!gWarningDisplayed && !tinyfd_forceConsole) - { - gWarningDisplayed = 1; - printf("\n\n%s\n", gTitle); - printf("%s\n\n", tinyfd_needs); - } - - if (aTitle && strlen(aTitle)) - { - printf("\n"); - if (tinyfd_winUtf8) writeUtf8(aTitle); - else printf("%s", aTitle); - printf("\n\n"); - } - if (aDialogType && !strcmp("yesno", aDialogType)) - { - do - { - if (aMessage && strlen(aMessage)) - { - if (tinyfd_winUtf8) writeUtf8(aMessage); - else printf("%s", aMessage); - printf("\n"); - } - printf("y/n: "); - lChar = (char)tolower(_getch()); - printf("\n\n"); - } while (lChar != 'y' && lChar != 'n'); - if (!tinyfd_winUtf8) { (void)SetConsoleCP(lOriginalCP); (void)SetConsoleOutputCP(lOriginalOutputCP); } - return lChar == 'y' ? 1 : 0; - } - else if (aDialogType && !strcmp("okcancel", aDialogType)) - { - do - { - if (aMessage && strlen(aMessage)) - { - if (tinyfd_winUtf8) writeUtf8(aMessage); - else printf("%s", aMessage); - printf("\n"); - } - printf("[O]kay/[C]ancel: "); - lChar = (char)tolower(_getch()); - printf("\n\n"); - } while (lChar != 'o' && lChar != 'c'); - if (!tinyfd_winUtf8) { (void)SetConsoleCP(lOriginalCP); (void)SetConsoleOutputCP(lOriginalOutputCP); } - return lChar == 'o' ? 1 : 0; - } - else if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - do - { - if (aMessage && strlen(aMessage)) - { - if (tinyfd_winUtf8) writeUtf8(aMessage); - else printf("%s", aMessage); - printf("\n"); - } - printf("[Y]es/[N]o/[C]ancel: "); - lChar = (char)tolower(_getch()); - printf("\n\n"); - } while (lChar != 'y' && lChar != 'n' && lChar != 'c'); - if (!tinyfd_winUtf8) { (void)SetConsoleCP(lOriginalCP); (void)SetConsoleOutputCP(lOriginalOutputCP); } - return (lChar == 'y') ? 1 : (lChar == 'n') ? 2 : 0; - } - else - { - if (aMessage && strlen(aMessage)) - { - if (tinyfd_winUtf8) writeUtf8(aMessage); - else printf("%s", aMessage); - printf("\n\n"); - } - printf("press enter to continue "); - lChar = (char)_getch(); - printf("\n\n"); - if (!tinyfd_winUtf8) { (void)SetConsoleCP(lOriginalCP); (void)SetConsoleOutputCP(lOriginalOutputCP); } - return 1; - } - } -} - - -/* return has only meaning for tinyfd_query */ -int tinyfd_notifyPopup( - char const * aTitle, /* NULL or "" */ - char const * aMessage , /* NULL or "" may contain \n \t */ - char const * aIconType ) /* "info" "warning" "error" */ -{ - if (tfd_quoteDetected(aTitle)) return tinyfd_notifyPopup("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aMessage, aIconType); - if (tfd_quoteDetected(aMessage)) return tinyfd_notifyPopup(aTitle, "INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aIconType); - - if ( powershellPresent() && (!tinyfd_forceConsole || !( - GetConsoleWindow() || - dialogPresent())) - && (!getenv("SSH_CLIENT") || getenvDISPLAY())) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"windows");return 1;} - return notifyWinGui(aTitle, aMessage, aIconType); - } - else - return tinyfd_messageBox(aTitle, aMessage, "ok" , aIconType, 0); -} - - -/* returns NULL on cancel */ -char * tinyfd_inputBox( - char const * aTitle , /* NULL or "" */ - char const * aMessage , /* NULL or "" (\n and \t have no effect) */ - char const * aDefaultInput ) /* "" , if NULL it's a passwordBox */ -{ - static char lBuff[MAX_PATH_OR_CMD] = ""; - char * lEOF; - - DWORD mode = 0; - HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE); - - unsigned long lNum; - void * lConsoleHandle; - char * lTmpChar; - wchar_t lBuffW[1024]; - - UINT lOriginalCP = 0; - UINT lOriginalOutputCP = 0; - - if (!aTitle && !aMessage && !aDefaultInput) return lBuff; /* now I can fill lBuff from outside */ - - if (tfd_quoteDetected(aTitle)) return tinyfd_inputBox("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aMessage, aDefaultInput); - if (tfd_quoteDetected(aMessage)) return tinyfd_inputBox(aTitle, "INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultInput); - if (tfd_quoteDetected(aDefaultInput)) return tinyfd_inputBox(aTitle, aMessage, "INVALID DEFAULT_INPUT WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - - mode = 0; - hStdin = GetStdHandle(STD_INPUT_HANDLE); - - if ((!tinyfd_forceConsole || !( - GetConsoleWindow() || - dialogPresent())) - && (!getenv("SSH_CLIENT") || getenvDISPLAY())) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"windows");return (char *)1;} - lBuff[0]='\0'; - if (inputBoxWinGui(lBuff, aTitle, aMessage, aDefaultInput)) return lBuff; - else return NULL; - } - else if ( dialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return (char *)0;} - lBuff[0]='\0'; - if (inputBoxWinConsole(lBuff, aTitle, aMessage, aDefaultInput) ) return lBuff; - else return NULL; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"basicinput");return (char *)0;} - lBuff[0]='\0'; - if (!gWarningDisplayed && !tinyfd_forceConsole) - { - gWarningDisplayed = 1 ; - printf("\n\n%s\n", gTitle); - printf("%s\n\n", tinyfd_needs); - } - - if (!tinyfd_winUtf8) - { - lOriginalCP = GetConsoleCP(); - lOriginalOutputCP = GetConsoleOutputCP(); - (void)SetConsoleCP(GetACP()); - (void)SetConsoleOutputCP(GetACP()); - } - - if (aTitle && strlen(aTitle)) - { - printf("\n"); - if (tinyfd_winUtf8) writeUtf8(aTitle); - else printf("%s", aTitle); - printf("\n\n"); - } - if ( aMessage && strlen(aMessage) ) - { - if (tinyfd_winUtf8) writeUtf8(aMessage); - else printf("%s", aMessage); - printf("\n"); - } - printf("(ctrl-Z + enter to cancel): "); - if ( ! aDefaultInput ) - { - (void) GetConsoleMode(hStdin, &mode); - (void) SetConsoleMode(hStdin, mode & (~ENABLE_ECHO_INPUT)); - } - if (tinyfd_winUtf8) - { - lConsoleHandle = GetStdHandle(STD_INPUT_HANDLE); - (void) ReadConsoleW(lConsoleHandle, lBuffW, MAX_PATH_OR_CMD, &lNum, NULL); - if (!aDefaultInput) - { - (void)SetConsoleMode(hStdin, mode); - printf("\n"); - } - lBuffW[lNum] = '\0'; - if (lBuffW[wcslen(lBuffW) - 1] == '\n') lBuffW[wcslen(lBuffW) - 1] = '\0'; - if (lBuffW[wcslen(lBuffW) - 1] == '\r') lBuffW[wcslen(lBuffW) - 1] = '\0'; - lTmpChar = tinyfd_utf16to8(lBuffW); - if (lTmpChar) - { - strcpy(lBuff, lTmpChar); - return lBuff; - } - else - return NULL; - } - else - { - lEOF = fgets(lBuff, MAX_PATH_OR_CMD, stdin); - if (!aDefaultInput) - { - (void)SetConsoleMode(hStdin, mode); - printf("\n"); - } - - if (!tinyfd_winUtf8) - { - (void)SetConsoleCP(lOriginalCP); - (void)SetConsoleOutputCP(lOriginalOutputCP); - } - - if (!lEOF) - { - return NULL; - } - printf("\n"); - if (strchr(lBuff, 27)) - { - return NULL; - } - if (lBuff[strlen(lBuff) - 1] == '\n') - { - lBuff[strlen(lBuff) - 1] = '\0'; - } - return lBuff; - } - } -} - - -char * tinyfd_saveFileDialog( - char const * aTitle , /* NULL or "" */ - char const * aDefaultPathAndFile , /* NULL or "" */ - int aNumOfFilterPatterns , /* 0 */ - char const * const * aFilterPatterns , /* NULL or {"*.jpg","*.png"} */ - char const * aSingleFilterDescription ) /* NULL or "image files" */ -{ - static char lBuff[MAX_PATH_OR_CMD] ; - char lString[MAX_PATH_OR_CMD] ; - char * p ; - char * lPointerInputBox; - int i; - - lBuff[0]='\0'; - - if ( ! aFilterPatterns ) aNumOfFilterPatterns = 0 ; - if (tfd_quoteDetected(aTitle)) return tinyfd_saveFileDialog("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription); - if (tfd_quoteDetected(aDefaultPathAndFile)) return tinyfd_saveFileDialog(aTitle, "INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription); - if (tfd_quoteDetected(aSingleFilterDescription)) return tinyfd_saveFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, "INVALID FILTER_DESCRIPTION WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - for (i = 0; i < aNumOfFilterPatterns; i++) - { - if (tfd_quoteDetected(aFilterPatterns[i])) return tinyfd_saveFileDialog("INVALID FILTER_PATTERN WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, 0, NULL, NULL); - } - - - if ( ( !tinyfd_forceConsole || !( GetConsoleWindow() || dialogPresent() ) ) - && (!getenv("SSH_CLIENT") || getenvDISPLAY())) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"windows");return (char *)1;} - p = saveFileDialogWinGui(lBuff, - aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, (char const * const *)aFilterPatterns, aSingleFilterDescription); - } - else if (dialogPresent()) - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "dialog"); return (char *)0; } - p = saveFileDialogWinConsole(lBuff, aTitle, aDefaultPathAndFile); - } - else - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "basicinput"); return (char *)0; } - strcpy(lBuff, "Save file in "); - strcat(lBuff, getCurDir()); - - lPointerInputBox = tinyfd_inputBox(NULL,NULL,NULL); /* obtain a pointer on the current content of tinyfd_inputBox */ - if (lPointerInputBox) strcpy(lString, lPointerInputBox); /* preserve the current content of tinyfd_inputBox */ - p = tinyfd_inputBox(aTitle, lBuff, ""); - if (p) strcpy(lBuff, p); else lBuff[0] = '\0'; - if (lPointerInputBox) strcpy(lPointerInputBox, lString); /* restore its previous content to tinyfd_inputBox */ - p = lBuff; - } - - if ( ! p || ! strlen( p ) ) - { - return NULL; - } - getPathWithoutFinalSlash( lString , p ) ; - if ( strlen( lString ) && ! dirExists( lString ) ) - { - return NULL ; - } - getLastName(lString,p); - if ( ! filenameValid(lString) ) - { - return NULL; - } - return p ; -} - - -/* in case of multiple files, the separator is | */ -char * tinyfd_openFileDialog( - char const * aTitle , /* NULL or "" */ - char const * aDefaultPathAndFile, /* NULL or "" */ - int aNumOfFilterPatterns , /* 0 */ - char const * const * aFilterPatterns, /* NULL or {"*.jpg","*.png"} */ - char const * aSingleFilterDescription, /* NULL or "image files" */ - int aAllowMultipleSelects ) /* 0 or 1 */ -{ - static char lBuff[MAX_PATH_OR_CMD]; - char lString[MAX_PATH_OR_CMD]; - char * p; - char * lPointerInputBox; - int i; - - if ( ! aFilterPatterns ) aNumOfFilterPatterns = 0 ; - if (tfd_quoteDetected(aTitle)) return tinyfd_openFileDialog("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription, aAllowMultipleSelects); - if (tfd_quoteDetected(aDefaultPathAndFile)) return tinyfd_openFileDialog(aTitle, "INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription, aAllowMultipleSelects); - if (tfd_quoteDetected(aSingleFilterDescription)) return tinyfd_openFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, "INVALID FILTER_DESCRIPTION WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aAllowMultipleSelects); - for (i = 0; i < aNumOfFilterPatterns; i++) - { - if (tfd_quoteDetected(aFilterPatterns[i])) return tinyfd_openFileDialog("INVALID FILTER_PATTERN WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, 0, NULL, NULL, aAllowMultipleSelects); - } - - if ( ( !tinyfd_forceConsole || !( GetConsoleWindow() || dialogPresent() ) ) - && (!getenv("SSH_CLIENT") || getenvDISPLAY())) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"windows");return (char *)1;} - p = openFileDialogWinGui( aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, - (char const * const *)aFilterPatterns, aSingleFilterDescription, aAllowMultipleSelects); - } - else if (dialogPresent()) - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "dialog"); return (char *)0; } - p = openFileDialogWinConsole(aTitle, aDefaultPathAndFile); - } - else - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "basicinput"); return (char *)0; } - strcpy(lBuff, "Open file from "); - strcat(lBuff, getCurDir()); - lPointerInputBox = tinyfd_inputBox(NULL, NULL, NULL); /* obtain a pointer on the current content of tinyfd_inputBox */ - if (lPointerInputBox) strcpy(lString, lPointerInputBox); /* preserve the current content of tinyfd_inputBox */ - p = tinyfd_inputBox(aTitle, lBuff, ""); - if (p) strcpy(lBuff, p); else lBuff[0] = '\0'; - if (lPointerInputBox) strcpy(lPointerInputBox, lString); /* restore its previous content to tinyfd_inputBox */ - p = lBuff; - } - - if ( ! p || ! strlen( p ) ) - { - return NULL; - } - if ( aAllowMultipleSelects && strchr(p, '|') ) - { - p = ensureFilesExist( (char *) p , p ) ; - } - else if ( ! fileExists(p) ) - { - return NULL ; - } - /* printf( "lBuff3: %s\n" , p ) ; */ - return p ; -} - - -char * tinyfd_selectFolderDialog( - char const * aTitle , /* NULL or "" */ - char const * aDefaultPath ) /* NULL or "" */ -{ - static char lBuff[MAX_PATH_OR_CMD]; - char * p; - char * lPointerInputBox; - char lString[MAX_PATH_OR_CMD]; - - if (tfd_quoteDetected(aTitle)) return tinyfd_selectFolderDialog("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPath); - if (tfd_quoteDetected(aDefaultPath)) return tinyfd_selectFolderDialog(aTitle, "INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - - if ( ( !tinyfd_forceConsole || !( GetConsoleWindow() || dialogPresent() ) ) - && (!getenv("SSH_CLIENT") || getenvDISPLAY())) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"windows");return (char *)1;} - p = selectFolderDialogWinGui(lBuff, aTitle, aDefaultPath); - } - else - if (dialogPresent()) - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "dialog"); return (char *)0; } - p = selectFolderDialogWinConsole(lBuff, aTitle, aDefaultPath); - } - else - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "basicinput"); return (char *)0; } - strcpy(lBuff, "Select folder from "); - strcat(lBuff, getCurDir()); - lPointerInputBox = tinyfd_inputBox(NULL, NULL, NULL); /* obtain a pointer on the current content of tinyfd_inputBox */ - if (lPointerInputBox) strcpy(lString, lPointerInputBox); /* preserve the current content of tinyfd_inputBox */ - p = tinyfd_inputBox(aTitle, lBuff, ""); - if (p) strcpy(lBuff, p); else lBuff[0] = '\0'; - if (lPointerInputBox) strcpy(lPointerInputBox, lString); /* restore its previous content to tinyfd_inputBox */ - p = lBuff; - } - - if ( ! p || ! strlen( p ) || ! dirExists( p ) ) - { - return NULL ; - } - return p ; -} - - -/* aDefaultRGB is used only if aDefaultHexRGB is absent */ -/* aDefaultRGB and aoResultRGB can be the same array */ -/* returns NULL on cancel */ -/* returns the hexcolor as a string "#FF0000" */ -/* aoResultRGB also contains the result */ -char * tinyfd_colorChooser( - char const * aTitle, /* NULL or "" */ - char const * aDefaultHexRGB, /* NULL or "" or "#FF0000"*/ - unsigned char const aDefaultRGB[3], /* { 0 , 255 , 255 } */ - unsigned char aoResultRGB[3]) /* { 0 , 0 , 0 } */ -{ - static char lDefaultHexRGB[16]; - int i; - char * p ; - char * lPointerInputBox; - char lString[MAX_PATH_OR_CMD]; - - lDefaultHexRGB[0] = '\0'; - - if (tfd_quoteDetected(aTitle)) return tinyfd_colorChooser("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultHexRGB, aDefaultRGB, aoResultRGB); - if (tfd_quoteDetected(aDefaultHexRGB)) return tinyfd_colorChooser(aTitle, "INVALID DEFAULT_HEX_RGB WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultRGB, aoResultRGB); - - if ( (!tinyfd_forceConsole || !( GetConsoleWindow() || dialogPresent()) ) - && (!getenv("SSH_CLIENT") || getenvDISPLAY())) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"windows");return (char *)1;} - p = colorChooserWinGui(aTitle, aDefaultHexRGB, aDefaultRGB, aoResultRGB); - if (p) - { - strcpy(lDefaultHexRGB, p); - return lDefaultHexRGB; - } - return NULL; - } - else if (dialogPresent()) - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "dialog"); return (char *)0; } - } - else - { - if (aTitle&&!strcmp(aTitle, "tinyfd_query")){ strcpy(tinyfd_response, "basicinput"); return (char *)0; } - } - - if (aDefaultHexRGB && (strlen(aDefaultHexRGB)==7) ) - { - strncpy(lDefaultHexRGB, aDefaultHexRGB,7); - lDefaultHexRGB[7]='\0'; - } - else - { - RGB2Hex(aDefaultRGB, lDefaultHexRGB); - } - - lPointerInputBox = tinyfd_inputBox(NULL, NULL, NULL); /* obtain a pointer on the current content of tinyfd_inputBox */ - if (lPointerInputBox) strcpy(lString, lPointerInputBox); /* preserve the current content of tinyfd_inputBox */ - p = tinyfd_inputBox(aTitle, "Enter hex rgb color (i.e. #f5ca20)", lDefaultHexRGB); - - if ( !p || (strlen(p) != 7) || (p[0] != '#') ) - { - return NULL ; - } - for ( i = 1 ; i < 7 ; i ++ ) - { - if ( ! isxdigit( (int) p[i] ) ) - { - return NULL ; - } - } - Hex2RGB(p,aoResultRGB); - - strcpy(lDefaultHexRGB, p); - - if (lPointerInputBox) strcpy(lPointerInputBox, lString); /* restore its previous content to tinyfd_inputBox */ - - return lDefaultHexRGB; -} - - -#else /* unix */ - -static char gPython2Name[16]; -static char gPython3Name[16]; -static char gPythonName[16]; - -int tfd_isDarwin(void) -{ - static int lsIsDarwin = -1 ; - struct utsname lUtsname ; - if ( lsIsDarwin < 0 ) - { - lsIsDarwin = !uname(&lUtsname) && !strcmp(lUtsname.sysname,"Darwin") ; - } - return lsIsDarwin ; -} - - -static int dirExists( char const * aDirPath ) -{ - DIR * lDir ; - if ( ! aDirPath || ! strlen( aDirPath ) ) - return 0 ; - lDir = opendir( aDirPath ) ; - if ( ! lDir ) - { - return 0 ; - } - closedir( lDir ) ; - return 1 ; -} - - -static int detectPresence( char const * aExecutable ) -{ - char lBuff[MAX_PATH_OR_CMD] ; - char lTestedString[MAX_PATH_OR_CMD] = "which " ; - FILE * lIn ; -#ifdef _GNU_SOURCE - char* lAllocatedCharString; - int lSubstringUndetected; -#endif - - strcat( lTestedString , aExecutable ) ; - strcat( lTestedString, " 2>/dev/null "); - lIn = popen( lTestedString , "r" ) ; - if ( ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - && ( ! strchr( lBuff , ':' ) ) && ( strncmp(lBuff, "no ", 3) ) ) - { /* present */ - pclose( lIn ) ; - -#ifdef _GNU_SOURCE /*to bypass this, just comment out "#define _GNU_SOURCE" at the top of the file*/ - if ( lBuff[strlen( lBuff ) -1] == '\n' ) lBuff[strlen( lBuff ) -1] = '\0' ; - lAllocatedCharString = realpath(lBuff,NULL); /*same as canonicalize_file_name*/ - lSubstringUndetected = ! strstr(lAllocatedCharString, aExecutable); - free(lAllocatedCharString); - if (lSubstringUndetected) - { - if (tinyfd_verbose) printf("detectPresence %s %d\n", aExecutable, 0); - return 0; - } -#endif /*_GNU_SOURCE*/ - - if (tinyfd_verbose) printf("detectPresence %s %d\n", aExecutable, 1); - return 1 ; - } - else - { - pclose( lIn ) ; - if (tinyfd_verbose) printf("detectPresence %s %d\n", aExecutable, 0); - return 0 ; - } -} - - -static char * getVersion( char const * aExecutable ) /*version must be first numeral*/ -{ - static char lBuff[MAX_PATH_OR_CMD] ; - char lTestedString[MAX_PATH_OR_CMD] ; - FILE * lIn ; - char * lTmp ; - - strcpy( lTestedString , aExecutable ) ; - strcat( lTestedString , " --version" ) ; - - lIn = popen( lTestedString , "r" ) ; - lTmp = fgets( lBuff , sizeof( lBuff ) , lIn ) ; - pclose( lIn ) ; - - lTmp += strcspn(lTmp,"0123456789"); - /* printf("lTmp:%s\n", lTmp); */ - return lTmp ; -} - - -static int * getMajorMinorPatch( char const * aExecutable ) -{ - static int lArray[3] ; - char * lTmp ; - - lTmp = (char *) getVersion(aExecutable); - lArray[0] = atoi( strtok(lTmp," ,.-") ) ; - /* printf("lArray0 %d\n", lArray[0]); */ - lArray[1] = atoi( strtok(0," ,.-") ) ; - /* printf("lArray1 %d\n", lArray[1]); */ - lArray[2] = atoi( strtok(0," ,.-") ) ; - /* printf("lArray2 %d\n", lArray[2]); */ - - if ( !lArray[0] && !lArray[1] && !lArray[2] ) return NULL; - return lArray ; -} - - -static int tryCommand( char const * aCommand ) -{ - char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - - lIn = popen( aCommand , "r" ) ; - if ( fgets( lBuff , sizeof( lBuff ) , lIn ) == NULL ) - { /* present */ - pclose( lIn ) ; - return 1 ; - } - else - { - pclose( lIn ) ; - return 0 ; - } - -} - - -static int isTerminalRunning(void) -{ - static int lIsTerminalRunning = -1 ; - if ( lIsTerminalRunning < 0 ) - { - lIsTerminalRunning = isatty(1); - if (tinyfd_verbose) printf("isTerminalRunning %d\n", lIsTerminalRunning ); - } - return lIsTerminalRunning; -} - - -static char * dialogNameOnly(void) -{ - static char lDialogName[128] = "*" ; - if ( lDialogName[0] == '*' ) - { - if (!tinyfd_allowCursesDialogs) - { - strcpy(lDialogName , "" ); - } - else if ( tfd_isDarwin() && * strcpy(lDialogName , "/opt/local/bin/dialog" ) - && detectPresence( lDialogName ) ) - {} - else if ( * strcpy(lDialogName , "dialog" ) - && detectPresence( lDialogName ) ) - {} - else - { - strcpy(lDialogName , "" ); - } - } - return lDialogName ; -} - - -int isDialogVersionBetter09b(void) -{ - char const * lDialogName ; - char * lVersion ; - int lMajor ; - int lMinor ; - int lDate ; - int lResult ; - char * lMinorP ; - char * lLetter ; - char lBuff[128] ; - - /*char lTest[128] = " 0.9b-20031126" ;*/ - - lDialogName = dialogNameOnly() ; - if ( ! strlen(lDialogName) || !(lVersion = (char *) getVersion(lDialogName)) ) return 0 ; - /*lVersion = lTest ;*/ - /*printf("lVersion %s\n", lVersion);*/ - strcpy(lBuff,lVersion); - lMajor = atoi( strtok(lVersion," ,.-") ) ; - /*printf("lMajor %d\n", lMajor);*/ - lMinorP = strtok(0," ,.-abcdefghijklmnopqrstuvxyz"); - lMinor = atoi( lMinorP ) ; - /*printf("lMinor %d\n", lMinor );*/ - lDate = atoi( strtok(0," ,.-") ) ; - if (lDate<0) lDate = - lDate; - /*printf("lDate %d\n", lDate);*/ - lLetter = lMinorP + strlen(lMinorP) ; - strcpy(lVersion,lBuff); - strtok(lLetter," ,.-"); - /*printf("lLetter %s\n", lLetter);*/ - lResult = (lMajor > 0) || ( ( lMinor == 9 ) && (*lLetter == 'b') && (lDate >= 20031126) ); - /*printf("lResult %d\n", lResult);*/ - return lResult; -} - - -static int whiptailPresentOnly(void) -{ - static int lWhiptailPresent = -1 ; - if (!tinyfd_allowCursesDialogs) return 0; - if ( lWhiptailPresent < 0 ) - { - lWhiptailPresent = detectPresence( "whiptail" ) ; - } - return lWhiptailPresent ; -} - - -static char * terminalName(void) -{ - static char lTerminalName[128] = "*" ; - char lShellName[64] = "*" ; - int * lArray; - - if ( lTerminalName[0] == '*' ) - { - if ( detectPresence( "bash" ) ) - { - strcpy(lShellName , "bash -c " ) ; /*good for basic input*/ - } - else if ( strlen(dialogNameOnly()) || whiptailPresentOnly() ) - { - strcpy(lShellName , "sh -c " ) ; /*good enough for dialog & whiptail*/ - } - else - { - strcpy(lTerminalName , "" ) ; - return NULL ; - } - - if ( tfd_isDarwin() ) - { - if ( * strcpy(lTerminalName , "/opt/X11/bin/xterm" ) - && detectPresence( lTerminalName ) ) - { - strcat(lTerminalName , " -fa 'DejaVu Sans Mono' -fs 10 -title tinyfiledialogs -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else - { - strcpy(lTerminalName , "" ) ; - } - } - else if ( * strcpy(lTerminalName,"xterm") /*good (small without parameters)*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -fa 'DejaVu Sans Mono' -fs 10 -title tinyfiledialogs -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"terminator") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -x " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"lxterminal") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"konsole") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"kterm") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"tilix") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"xfce4-terminal") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -x " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"mate-terminal") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -x " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"Eterm") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"evilvte") /*good*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"pterm") /*good (only letters)*/ - && detectPresence(lTerminalName) ) - { - strcat(lTerminalName , " -e " ) ; - strcat(lTerminalName , lShellName ) ; - } - else if ( * strcpy(lTerminalName,"gnome-terminal") - && detectPresence(lTerminalName) && (lArray = getMajorMinorPatch(lTerminalName)) - && ((lArray[0]<3) || (lArray[0]==3 && lArray[1]<=6)) ) - { - strcat(lTerminalName , " --disable-factory -x " ) ; - strcat(lTerminalName , lShellName ) ; - } - else - { - strcpy(lTerminalName , "" ) ; - } - /* bad: koi rxterm guake tilda vala-terminal qterminal kgx - aterm Terminal terminology sakura lilyterm weston-terminal - roxterm termit xvt rxvt mrxvt urxvt */ - } - if ( strlen(lTerminalName) ) - { - return lTerminalName ; - } - else - { - return NULL ; - } -} - - -static char * dialogName(void) -{ - char * lDialogName ; - lDialogName = dialogNameOnly( ) ; - if ( strlen(lDialogName) && ( isTerminalRunning() || terminalName() ) ) - { - return lDialogName ; - } - else - { - return NULL ; - } -} - - -static int whiptailPresent(void) -{ - int lWhiptailPresent ; - lWhiptailPresent = whiptailPresentOnly( ) ; - if ( lWhiptailPresent && ( isTerminalRunning() || terminalName() ) ) - { - return lWhiptailPresent ; - } - else - { - return 0 ; - } -} - - - -static int graphicMode(void) -{ - return !( tinyfd_forceConsole && (isTerminalRunning() || terminalName()) ) - && ( getenvDISPLAY() - || (tfd_isDarwin() && (!getenv("SSH_TTY") || getenvDISPLAY() ) ) ) ; -} - - -static int pactlPresent(void) -{ - static int lPactlPresent = -1 ; - if ( lPactlPresent < 0 ) - { - lPactlPresent = detectPresence("pactl") ; - } - return lPactlPresent ; -} - - -static int speakertestPresent(void) -{ - static int lSpeakertestPresent = -1 ; - if ( lSpeakertestPresent < 0 ) - { - lSpeakertestPresent = detectPresence("speaker-test") ; - } - return lSpeakertestPresent ; -} - - -static int playPresent() -{ - static int lPlayPresent = -1; - if (lPlayPresent < 0) - { - lPlayPresent = detectPresence("sox"); /*if sox is present, play is ready*/ - } - return lPlayPresent; -} - - -static int beepexePresent() -{ - static int lBeepexePresent = -1; - if (lBeepexePresent < 0) - { - lBeepexePresent = detectPresence("beep.exe"); - } - return lBeepexePresent; -} - - -static int beepPresent(void) -{ - static int lBeepPresent = -1 ; - if ( lBeepPresent < 0 ) - { - lBeepPresent = detectPresence("beep") ; - } - return lBeepPresent ; -} - - -static int xmessagePresent(void) -{ - static int lXmessagePresent = -1 ; - if ( lXmessagePresent < 0 ) - { - lXmessagePresent = detectPresence("xmessage");/*if not tty,not on osxpath*/ - } - return lXmessagePresent && graphicMode( ) ; -} - - -static int gxmessagePresent(void) -{ - static int lGxmessagePresent = -1 ; - if ( lGxmessagePresent < 0 ) - { - lGxmessagePresent = detectPresence("gxmessage") ; - } - return lGxmessagePresent && graphicMode( ) ; -} - - -static int gmessagePresent(void) -{ - static int lGmessagePresent = -1 ; - if ( lGmessagePresent < 0 ) - { - lGmessagePresent = detectPresence("gmessage") ; - } - return lGmessagePresent && graphicMode( ) ; -} - - -static int notifysendPresent(void) -{ - static int lNotifysendPresent = -1 ; - if ( lNotifysendPresent < 0 ) - { - lNotifysendPresent = detectPresence("notify-send") ; - } - return lNotifysendPresent && graphicMode( ) ; -} - - -static int perlPresent(void) -{ - static int lPerlPresent = -1 ; - char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - - if ( lPerlPresent < 0 ) - { - lPerlPresent = detectPresence("perl") ; - if (lPerlPresent) - { - lIn = popen("perl -MNet::DBus -e \"Net::DBus->session->get_service('org.freedesktop.Notifications')\" 2>&1", "r"); - if (fgets(lBuff, sizeof(lBuff), lIn) == NULL) - { - lPerlPresent = 2; - } - pclose(lIn); - if (tinyfd_verbose) printf("perl-dbus %d\n", lPerlPresent); - } - } - return graphicMode() ? lPerlPresent : 0 ; -} - - -static int afplayPresent(void) -{ - static int lAfplayPresent = -1 ; - char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - - if ( lAfplayPresent < 0 ) - { - lAfplayPresent = detectPresence("afplay") ; - if ( lAfplayPresent ) - { - lIn = popen( "test -e /System/Library/Sounds/Ping.aiff || echo Ping" , "r" ) ; - if ( fgets( lBuff , sizeof( lBuff ) , lIn ) == NULL ) - { - lAfplayPresent = 2 ; - } - pclose( lIn ) ; - if (tinyfd_verbose) printf("afplay %d\n", lAfplayPresent); - } - } - return graphicMode() ? lAfplayPresent : 0 ; -} - - -static int xdialogPresent(void) -{ - static int lXdialogPresent = -1 ; - if ( lXdialogPresent < 0 ) - { - lXdialogPresent = detectPresence("Xdialog") ; - } - return lXdialogPresent && graphicMode( ) ; -} - - -static int gdialogPresent(void) -{ - static int lGdialoglPresent = -1 ; - if ( lGdialoglPresent < 0 ) - { - lGdialoglPresent = detectPresence( "gdialog" ) ; - } - return lGdialoglPresent && graphicMode( ) ; -} - - -static int osascriptPresent(void) -{ - static int lOsascriptPresent = -1 ; - if ( lOsascriptPresent < 0 ) - { - gWarningDisplayed |= !!getenv("SSH_TTY"); - lOsascriptPresent = detectPresence( "osascript" ) ; - } - return lOsascriptPresent && graphicMode() && !getenv("SSH_TTY") ; -} - - -static int dunstifyPresent(void) -{ - static int lDunstifyPresent = -1 ; - static char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - char * lTmp ; - - if ( lDunstifyPresent < 0 ) - { - lDunstifyPresent = detectPresence( "dunstify" ) ; - if ( lDunstifyPresent ) - { - lIn = popen( "dunstify -s" , "r" ) ; - lTmp = fgets( lBuff , sizeof( lBuff ) , lIn ) ; - pclose( lIn ) ; - /* printf("lTmp:%s\n", lTmp); */ - lDunstifyPresent = strstr(lTmp,"name:dunst\n") ? 1 : 0 ; - if (tinyfd_verbose) printf("lDunstifyPresent %d\n", lDunstifyPresent); - } - } - return lDunstifyPresent && graphicMode( ) ; -} - - -static int dunstPresent(void) -{ - static int lDunstPresent = -1 ; - static char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - char * lTmp ; - - if ( lDunstPresent < 0 ) - { - lDunstPresent = detectPresence( "dunst" ) ; - if ( lDunstPresent ) - { - lIn = popen( "ps -e | grep dunst | grep -v grep" , "r" ) ; /* add "| wc -l" to receive the number of lines */ - lTmp = fgets( lBuff , sizeof( lBuff ) , lIn ) ; - pclose( lIn ) ; - /* if ( lTmp ) printf("lTmp:%s\n", lTmp); */ - if ( lTmp ) lDunstPresent = 1 ; - else lDunstPresent = 0 ; - if (tinyfd_verbose) printf("lDunstPresent %d\n", lDunstPresent); - } - } - return lDunstPresent && graphicMode( ) ; -} - - -int tfd_qarmaPresent(void) -{ - static int lQarmaPresent = -1 ; - if ( lQarmaPresent < 0 ) - { - lQarmaPresent = detectPresence("qarma") ; - } - return lQarmaPresent && graphicMode( ) ; -} - - -int tfd_matedialogPresent(void) -{ - static int lMatedialogPresent = -1 ; - if ( lMatedialogPresent < 0 ) - { - lMatedialogPresent = detectPresence("matedialog") ; - } - return lMatedialogPresent && graphicMode( ) ; -} - - -int tfd_shellementaryPresent(void) -{ - static int lShellementaryPresent = -1 ; - if ( lShellementaryPresent < 0 ) - { - lShellementaryPresent = 0 ; /*detectPresence("shellementary"); shellementary is not ready yet */ - } - return lShellementaryPresent && graphicMode( ) ; -} - - -int tfd_xpropPresent(void) -{ - static int lXpropPresent = -1 ; - if ( lXpropPresent < 0 ) - { - lXpropPresent = detectPresence("xprop") ; - } - return lXpropPresent && graphicMode( ) ; -} - - -int tfd_zenityPresent(void) -{ - static int lZenityPresent = -1 ; - if ( lZenityPresent < 0 ) - { - lZenityPresent = detectPresence("zenity") ; - } - return lZenityPresent && graphicMode( ) ; -} - - -int tfd_yadPresent(void) -{ - static int lYadPresent = -1; - if (lYadPresent < 0) - { - lYadPresent = detectPresence("yad"); - } - return lYadPresent && graphicMode(); -} - - -int tfd_zenity3Present(void) -{ - static int lZenity3Present = -1 ; - char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - int lIntTmp ; - - if ( lZenity3Present < 0 ) - { - lZenity3Present = 0 ; - if ( tfd_zenityPresent() ) - { - lIn = popen( "zenity --version" , "r" ) ; - if ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - { - if ( atoi(lBuff) >= 3 ) - { - lZenity3Present = 3 ; - lIntTmp = atoi(strtok(lBuff,".")+2 ) ; - if ( lIntTmp >= 18 ) - { - lZenity3Present = 5 ; - } - else if ( lIntTmp >= 10 ) - { - lZenity3Present = 4 ; - } - } - else if ( ( atoi(lBuff) == 2 ) && ( atoi(strtok(lBuff,".")+2 ) >= 32 ) ) - { - lZenity3Present = 2 ; - } - if (tinyfd_verbose) printf("zenity type %d\n", lZenity3Present); - } - pclose( lIn ) ; - } - } - return graphicMode() ? lZenity3Present : 0 ; -} - - -int tfd_kdialogPresent(void) -{ - static int lKdialogPresent = -1 ; - char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - char * lDesktop; - - if ( lKdialogPresent < 0 ) - { - if ( tfd_zenityPresent() ) - { - lDesktop = getenv("XDG_SESSION_DESKTOP"); - if ( !lDesktop || ( strcmp(lDesktop, "KDE") && strcmp(lDesktop, "lxqt") ) ) - { - lKdialogPresent = 0 ; - return lKdialogPresent ; - } - } - - lKdialogPresent = detectPresence("kdialog") ; - if ( lKdialogPresent && !getenv("SSH_TTY") ) - { - lIn = popen( "kdialog --attach 2>&1" , "r" ) ; - if ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - { - if ( ! strstr( "Unknown" , lBuff ) ) - { - lKdialogPresent = 2 ; - if (tinyfd_verbose) printf("kdialog-attach %d\n", lKdialogPresent); - } - } - pclose( lIn ) ; - - if (lKdialogPresent == 2) - { - lKdialogPresent = 1 ; - lIn = popen( "kdialog --passivepopup 2>&1" , "r" ) ; - if ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - { - if ( ! strstr( "Unknown" , lBuff ) ) - { - lKdialogPresent = 2 ; - if (tinyfd_verbose) printf("kdialog-popup %d\n", lKdialogPresent); - } - } - pclose( lIn ) ; - } - } - } - return graphicMode() ? lKdialogPresent : 0 ; -} - - -static int osx9orBetter(void) -{ - static int lOsx9orBetter = -1 ; - char lBuff[MAX_PATH_OR_CMD] ; - FILE * lIn ; - int V,v; - - if ( lOsx9orBetter < 0 ) - { - lOsx9orBetter = 0 ; - lIn = popen( "osascript -e 'set osver to system version of (system info)'" , "r" ) ; - V = 0 ; - if ( ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - && ( 2 == sscanf(lBuff, "%d.%d", &V, &v) ) ) - { - V = V * 100 + v; - if ( V >= 1009 ) - { - lOsx9orBetter = 1 ; - } - } - pclose( lIn ) ; - if (tinyfd_verbose) printf("Osx10 = %d, %d = %s\n", lOsx9orBetter, V, lBuff) ; - } - return lOsx9orBetter ; -} - - -static int python3Present(void) -{ - static int lPython3Present = -1 ; - int i; - - if ( lPython3Present < 0 ) - { - lPython3Present = 0 ; - strcpy(gPython3Name , "python3" ) ; - if ( detectPresence(gPython3Name) ) lPython3Present = 1; - else - { - for ( i = 9 ; i >= 0 ; i -- ) - { - sprintf( gPython3Name , "python3.%d" , i ) ; - if ( detectPresence(gPython3Name) ) - { - lPython3Present = 1; - break; - } - } - } - if (tinyfd_verbose) printf("lPython3Present %d\n", lPython3Present) ; - if (tinyfd_verbose) printf("gPython3Name %s\n", gPython3Name) ; - } - return lPython3Present ; -} - - -static int python2Present(void) -{ - static int lPython2Present = -1 ; - - if ( lPython2Present < 0 ) - { - lPython2Present = 0 ; - strcpy(gPython2Name , "python2" ) ; - if ( detectPresence(gPython2Name) ) lPython2Present = 1; - /*else - { - for ( i = 9 ; i >= 0 ; i -- ) - { - sprintf( gPython2Name , "python2.%d" , i ) ; - if ( detectPresence(gPython2Name) ) - { - lPython2Present = 1; - break; - } - } - }*/ - if (tinyfd_verbose) printf("lPython2Present %d\n", lPython2Present) ; - if (tinyfd_verbose) printf("gPython2Name %s\n", gPython2Name) ; - } - return lPython2Present ; -} - - -static int tkinter3Present(void) -{ - static int lTkinter3Present = -1 ; - char lPythonCommand[256]; - char lPythonParams[128] = - "-S -c \"try:\n\timport tkinter;\nexcept:\n\tprint(0);\""; - - if ( lTkinter3Present < 0 ) - { - lTkinter3Present = 0 ; - if ( python3Present() ) - { - sprintf( lPythonCommand , "%s %s" , gPython3Name , lPythonParams ) ; - lTkinter3Present = tryCommand(lPythonCommand) ; - } - if (tinyfd_verbose) printf("lTkinter3Present %d\n", lTkinter3Present) ; - } - return lTkinter3Present && graphicMode() && !(tfd_isDarwin() && getenv("SSH_TTY") ); -} - - -static int tkinter2Present(void) -{ - static int lTkinter2Present = -1 ; - char lPythonCommand[256]; - char lPythonParams[128] = - "-S -c \"try:\n\timport Tkinter;\nexcept:\n\tprint 0;\""; - - if ( lTkinter2Present < 0 ) - { - lTkinter2Present = 0 ; - if ( python2Present() ) - { - sprintf( lPythonCommand , "%s %s" , gPython2Name , lPythonParams ) ; - lTkinter2Present = tryCommand(lPythonCommand) ; - } - if (tinyfd_verbose) printf("lTkinter2Present %d graphicMode %d \n", lTkinter2Present, graphicMode() ) ; - } - return lTkinter2Present && graphicMode() && !(tfd_isDarwin() && getenv("SSH_TTY") ); -} - - -static int pythonDbusPresent(void) -{ - static int lPythonDbusPresent = -1 ; - char lPythonCommand[384]; - char lPythonParams[256] = -"-c \"try:\n\timport dbus;bus=dbus.SessionBus();\ -notif=bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications');\ -notify=dbus.Interface(notif,'org.freedesktop.Notifications');\nexcept:\n\tprint(0);\""; - - if (lPythonDbusPresent < 0 ) - { - lPythonDbusPresent = 0 ; - if ( python2Present() ) - { - strcpy(gPythonName , gPython2Name ) ; - sprintf( lPythonCommand , "%s %s" , gPythonName , lPythonParams ) ; - lPythonDbusPresent = tryCommand(lPythonCommand) ; - } - - if ( !lPythonDbusPresent && python3Present() ) - { - strcpy(gPythonName , gPython3Name ) ; - sprintf( lPythonCommand , "%s %s" , gPythonName , lPythonParams ) ; - lPythonDbusPresent = tryCommand(lPythonCommand) ; - } - - if (tinyfd_verbose) printf("lPythonDbusPresent %d\n", lPythonDbusPresent) ; - if (tinyfd_verbose) printf("gPythonName %s\n", gPythonName) ; - } - return lPythonDbusPresent && graphicMode() && !(tfd_isDarwin() && getenv("SSH_TTY") ); -} - - -static void sigHandler(int signum) -{ - FILE * lIn ; - if ( ( lIn = popen( "pactl unload-module module-sine" , "r" ) ) ) - { - pclose( lIn ) ; - } - if (tinyfd_verbose) printf("tinyfiledialogs caught signal %d\n", signum); -} - -void tinyfd_beep(void) -{ - char lDialogString[256] ; - FILE * lIn ; - - if ( osascriptPresent() ) - { - if ( afplayPresent() >= 2 ) - { - strcpy( lDialogString , "afplay /System/Library/Sounds/Ping.aiff") ; - } - else - { - strcpy( lDialogString , "osascript -e 'tell application \"System Events\" to beep'") ; - } - } - else if ( pactlPresent() ) - { - signal(SIGINT, sigHandler); - /*strcpy( lDialogString , "pactl load-module module-sine frequency=440;sleep .3;pactl unload-module module-sine" ) ;*/ - strcpy( lDialogString , "thnum=$(pactl load-module module-sine frequency=440);sleep .3;pactl unload-module $thnum" ) ; - } - else if ( speakertestPresent() ) - { - /*strcpy( lDialogString , "timeout -k .3 .3 speaker-test --frequency 440 --test sine > /dev/tty" ) ;*/ - strcpy( lDialogString , "( speaker-test -t sine -f 440 > /dev/tty )& pid=$!;sleep .5; kill -9 $pid" ) ; /*.3 was too short for mac g3*/ - } - else if (beepexePresent()) - { - strcpy(lDialogString, "beep.exe 440 300"); - } - else if (playPresent()) /* play is part of sox */ - { - strcpy(lDialogString, "play -q -n synth .3 sine 440"); - } - else if ( beepPresent() ) - { - strcpy( lDialogString , "beep -f 440 -l 300" ) ; - } - else - { - strcpy( lDialogString , "printf '\a' > /dev/tty" ) ; - } - - if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ; - - if ( ( lIn = popen( lDialogString , "r" ) ) ) - { - pclose( lIn ) ; - } - - if ( pactlPresent() ) - { - signal(SIGINT, SIG_DFL); - } -} - - -int tinyfd_messageBox( - char const * aTitle , /* NULL or "" */ - char const * aMessage , /* NULL or "" may contain \n and \t */ - char const * aDialogType , /* "ok" "okcancel" "yesno" "yesnocancel" */ - char const * aIconType , /* "info" "warning" "error" "question" */ - int aDefaultButton ) /* 0 for cancel/no , 1 for ok/yes , 2 for no in yesnocancel */ -{ - char lBuff[MAX_PATH_OR_CMD] ; - char * lDialogString = NULL ; - char * lpDialogString; - FILE * lIn ; - int lWasGraphicDialog = 0 ; - int lWasXterm = 0 ; - int lResult ; - char lChar ; - struct termios infoOri; - struct termios info; - size_t lTitleLen ; - size_t lMessageLen ; - - lBuff[0]='\0'; - - if (tfd_quoteDetected(aTitle)) return tinyfd_messageBox("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aMessage, aDialogType, aIconType, aDefaultButton); - if (tfd_quoteDetected(aMessage)) return tinyfd_messageBox(aTitle, "INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDialogType, aIconType, aDefaultButton); - - lTitleLen = aTitle ? strlen(aTitle) : 0 ; - lMessageLen = aMessage ? strlen(aMessage) : 0 ; - if ( !aTitle || strcmp(aTitle,"tinyfd_query") ) - { - lDialogString = (char *) malloc( MAX_PATH_OR_CMD + lTitleLen + lMessageLen ); - } - - if ( osascriptPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"applescript");return 1;} - - strcpy( lDialogString , "osascript "); - if ( ! osx9orBetter() ) strcat( lDialogString , " -e 'tell application \"System Events\"' -e 'Activate'"); - strcat( lDialogString , " -e 'try' -e 'set {vButton} to {button returned} of ( display dialog \"") ; - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, aMessage) ; - } - strcat(lDialogString, "\" ") ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "with title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - strcat(lDialogString, "with icon ") ; - if ( aIconType && ! strcmp( "error" , aIconType ) ) - { - strcat(lDialogString, "stop " ) ; - } - else if ( aIconType && ! strcmp( "warning" , aIconType ) ) - { - strcat(lDialogString, "caution " ) ; - } - else /* question or info */ - { - strcat(lDialogString, "note " ) ; - } - if ( aDialogType && ! strcmp( "okcancel" , aDialogType ) ) - { - if ( ! aDefaultButton ) - { - strcat( lDialogString ,"default button \"Cancel\" " ) ; - } - } - else if ( aDialogType && ! strcmp( "yesno" , aDialogType ) ) - { - strcat( lDialogString ,"buttons {\"No\", \"Yes\"} " ) ; - if (aDefaultButton) - { - strcat( lDialogString ,"default button \"Yes\" " ) ; - } - else - { - strcat( lDialogString ,"default button \"No\" " ) ; - } - strcat( lDialogString ,"cancel button \"No\"" ) ; - } - else if ( aDialogType && ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat( lDialogString ,"buttons {\"No\", \"Yes\", \"Cancel\"} " ) ; - switch (aDefaultButton) - { - case 1: strcat( lDialogString ,"default button \"Yes\" " ) ; break; - case 2: strcat( lDialogString ,"default button \"No\" " ) ; break; - case 0: strcat( lDialogString ,"default button \"Cancel\" " ) ; break; - } - strcat( lDialogString ,"cancel button \"Cancel\"" ) ; - } - else - { - strcat( lDialogString ,"buttons {\"OK\"} " ) ; - strcat( lDialogString ,"default button \"OK\" " ) ; - } - strcat( lDialogString, ")' ") ; - - strcat( lDialogString, -"-e 'if vButton is \"Yes\" then' -e 'return 1'\ - -e 'else if vButton is \"OK\" then' -e 'return 1'\ - -e 'else if vButton is \"No\" then' -e 'return 2'\ - -e 'else' -e 'return 0' -e 'end if' " ); - - strcat( lDialogString, "-e 'on error number -128' " ) ; - strcat( lDialogString, "-e '0' " ); - - strcat( lDialogString, "-e 'end try'") ; - if ( ! osx9orBetter() ) strcat( lDialogString, " -e 'end tell'") ; - } - else if ( tfd_kdialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"kdialog");return 1;} - - strcpy( lDialogString , "kdialog" ) ; - if ( (tfd_kdialogPresent() == 2) && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - - strcat( lDialogString , " --" ) ; - if ( aDialogType && ( ! strcmp( "okcancel" , aDialogType ) - || ! strcmp( "yesno" , aDialogType ) || ! strcmp( "yesnocancel" , aDialogType ) ) ) - { - if ( aIconType && ( ! strcmp( "warning" , aIconType ) - || ! strcmp( "error" , aIconType ) ) ) - { - strcat( lDialogString , "warning" ) ; - } - if ( ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat( lDialogString , "yesnocancel" ) ; - } - else - { - strcat( lDialogString , "yesno" ) ; - } - } - else if ( aIconType && ! strcmp( "error" , aIconType ) ) - { - strcat( lDialogString , "error" ) ; - } - else if ( aIconType && ! strcmp( "warning" , aIconType ) ) - { - strcat( lDialogString , "sorry" ) ; - } - else - { - strcat( lDialogString , "msgbox" ) ; - } - strcat( lDialogString , " \"" ) ; - if ( aMessage ) - { - strcat( lDialogString , aMessage ) ; - } - strcat( lDialogString , "\"" ) ; - if ( aDialogType && ! strcmp( "okcancel" , aDialogType ) ) - { - strcat( lDialogString , - " --yes-label Ok --no-label Cancel" ) ; - } - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, " --title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - } - - if ( ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat( lDialogString , "; x=$? ;if [ $x = 0 ] ;then echo 1;elif [ $x = 1 ] ;then echo 2;else echo 0;fi"); - } - else - { - strcat( lDialogString , ";if [ $? = 0 ];then echo 1;else echo 0;fi"); - } - } - else if ( tfd_zenityPresent() || tfd_matedialogPresent() || tfd_shellementaryPresent() || tfd_qarmaPresent() ) - { - if ( tfd_zenityPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"zenity");return 1;} - strcpy( lDialogString , "szAnswer=$(zenity" ) ; - if ( (tfd_zenity3Present() >= 4) && !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(sleep .01;xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - else if ( tfd_matedialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"matedialog");return 1;} - strcpy( lDialogString , "szAnswer=$(matedialog" ) ; - } - else if ( tfd_shellementaryPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"shellementary");return 1;} - strcpy( lDialogString , "szAnswer=$(shellementary" ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"qarma");return 1;} - strcpy( lDialogString , "szAnswer=$(qarma" ) ; - if ( !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - strcat(lDialogString, " --"); - - if ( aDialogType && ! strcmp( "okcancel" , aDialogType ) ) - { - strcat( lDialogString , - "question --ok-label=Ok --cancel-label=Cancel" ) ; - } - else if ( aDialogType && ! strcmp( "yesno" , aDialogType ) ) - { - strcat( lDialogString , "question" ) ; - } - else if ( aDialogType && ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat( lDialogString , "list --column \"\" --hide-header \"Yes\" \"No\"" ) ; - } - else if ( aIconType && ! strcmp( "error" , aIconType ) ) - { - strcat( lDialogString , "error" ) ; - } - else if ( aIconType && ! strcmp( "warning" , aIconType ) ) - { - strcat( lDialogString , "warning" ) ; - } - else - { - strcat( lDialogString , "info" ) ; - } - - strcat(lDialogString, " --title=\""); - if ( aTitle && strlen(aTitle) ) strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\""); - - if (strcmp("yesnocancel", aDialogType)) strcat(lDialogString, " --no-wrap"); - - strcat(lDialogString, " --text=\"") ; - if (aMessage && strlen(aMessage)) strcat(lDialogString, aMessage) ; - strcat(lDialogString, "\"") ; - - if ( (tfd_zenity3Present() >= 3) || (!tfd_zenityPresent() && (tfd_shellementaryPresent() || tfd_qarmaPresent()) ) ) - { - strcat( lDialogString , " --icon-name=dialog-" ) ; - if ( aIconType && (! strcmp( "question" , aIconType ) - || ! strcmp( "error" , aIconType ) - || ! strcmp( "warning" , aIconType ) ) ) - { - strcat( lDialogString , aIconType ) ; - } - else - { - strcat( lDialogString , "information" ) ; - } - } - - if (tinyfd_silent) strcat( lDialogString , " 2>/dev/null "); - - if ( ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat( lDialogString , -");if [ $? = 1 ];then echo 0;elif [ $szAnswer = \"No\" ];then echo 2;else echo 1;fi"); - } - else - { - strcat( lDialogString , ");if [ $? = 0 ];then echo 1;else echo 0;fi"); - } - } - - else if (tfd_yadPresent()) - { - if (aTitle && !strcmp(aTitle, "tinyfd_query")) { strcpy(tinyfd_response, "yad"); return 1; } - strcpy(lDialogString, "szAnswer=$(yad --"); - if (aDialogType && !strcmp("ok", aDialogType)) - { - strcat(lDialogString,"button=Ok:1"); - } - else if (aDialogType && !strcmp("okcancel", aDialogType)) - { - strcat(lDialogString,"button=Ok:1 --button=Cancel:0"); - } - else if (aDialogType && !strcmp("yesno", aDialogType)) - { - strcat(lDialogString, "button=Yes:1 --button=No:0"); - } - else if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - strcat(lDialogString, "button=Yes:1 --button=No:2 --button=Cancel:0"); - } - else if (aIconType && !strcmp("error", aIconType)) - { - strcat(lDialogString, "error"); - } - else if (aIconType && !strcmp("warning", aIconType)) - { - strcat(lDialogString, "warning"); - } - else - { - strcat(lDialogString, "info"); - } - if (aTitle && strlen(aTitle)) - { - strcat(lDialogString, " --title=\""); - strcat(lDialogString, aTitle); - strcat(lDialogString, "\""); - } - if (aMessage && strlen(aMessage)) - { - strcat(lDialogString, " --text=\""); - strcat(lDialogString, aMessage); - strcat(lDialogString, "\""); - } - - strcat(lDialogString, " --image=dialog-"); - if (aIconType && (!strcmp("question", aIconType) - || !strcmp("error", aIconType) - || !strcmp("warning", aIconType))) - { - strcat(lDialogString, aIconType); - } - else - { - strcat(lDialogString, "information"); - } - - if (tinyfd_silent) strcat(lDialogString, " 2>/dev/null "); - strcat(lDialogString,");echo $?"); - } - - else if ( !gxmessagePresent() && !gmessagePresent() && !gdialogPresent() && !xdialogPresent() && tkinter3Present() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python3-tkinter");return 1;} - - strcpy( lDialogString , gPython3Name ) ; - strcat( lDialogString , - " -S -c \"import tkinter;from tkinter import messagebox;root=tkinter.Tk();root.withdraw();"); - - strcat( lDialogString ,"res=messagebox." ) ; - if ( aDialogType && ! strcmp( "okcancel" , aDialogType ) ) - { - strcat( lDialogString , "askokcancel(" ) ; - if ( aDefaultButton ) - { - strcat( lDialogString , "default=messagebox.OK," ) ; - } - else - { - strcat( lDialogString , "default=messagebox.CANCEL," ) ; - } - } - else if ( aDialogType && ! strcmp( "yesno" , aDialogType ) ) - { - strcat( lDialogString , "askyesno(" ) ; - if ( aDefaultButton ) - { - strcat( lDialogString , "default=messagebox.YES," ) ; - } - else - { - strcat( lDialogString , "default=messagebox.NO," ) ; - } - } - else if ( aDialogType && ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat( lDialogString , "askyesnocancel(" ) ; - switch ( aDefaultButton ) - { - case 1: strcat( lDialogString , "default=messagebox.YES," ); break; - case 2: strcat( lDialogString , "default=messagebox.NO," ); break; - case 0: strcat( lDialogString , "default=messagebox.CANCEL," ); break; - } - } - else - { - strcat( lDialogString , "showinfo(" ) ; - } - - strcat( lDialogString , "icon='" ) ; - if ( aIconType && (! strcmp( "question" , aIconType ) - || ! strcmp( "error" , aIconType ) - || ! strcmp( "warning" , aIconType ) ) ) - { - strcat( lDialogString , aIconType ) ; - } - else - { - strcat( lDialogString , "info" ) ; - } - - strcat(lDialogString, "',") ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, "message='") ; - lpDialogString = lDialogString + strlen(lDialogString); - tfd_replaceSubStr( aMessage , "\n" , "\\n" , lpDialogString ) ; - strcat(lDialogString, "'") ; - } - - if ( aDialogType && ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat(lDialogString, ");\n\ -if res is None :\n\tprint(0)\n\ -elif res is False :\n\tprint(2)\n\ -else :\n\tprint (1)\n\"" ) ; - } - else - { - strcat(lDialogString, ");\n\ -if res is False :\n\tprint(0)\n\ -else :\n\tprint(1)\n\"" ) ; - } - } - else if ( !gxmessagePresent() && !gmessagePresent() && !gdialogPresent() && !xdialogPresent() && tkinter2Present() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python2-tkinter");return 1;} - strcpy( lDialogString , "export PYTHONIOENCODING=utf-8;" ) ; - strcat( lDialogString , gPython2Name ) ; - if ( ! isTerminalRunning( ) && tfd_isDarwin( ) ) - { - strcat( lDialogString , " -i" ) ; /* for osx without console */ - } - - strcat( lDialogString , -" -S -c \"import Tkinter,tkMessageBox;root=Tkinter.Tk();root.withdraw();"); - - if ( tfd_isDarwin( ) ) - { - strcat( lDialogString , -"import os;os.system('''/usr/bin/osascript -e 'tell app \\\"Finder\\\" to set \ -frontmost of process \\\"Python\\\" to true' ''');"); - } - - strcat( lDialogString ,"res=tkMessageBox." ) ; - if ( aDialogType && ! strcmp( "okcancel" , aDialogType ) ) - { - strcat( lDialogString , "askokcancel(" ) ; - if ( aDefaultButton ) - { - strcat( lDialogString , "default=tkMessageBox.OK," ) ; - } - else - { - strcat( lDialogString , "default=tkMessageBox.CANCEL," ) ; - } - } - else if ( aDialogType && ! strcmp( "yesno" , aDialogType ) ) - { - strcat( lDialogString , "askyesno(" ) ; - if ( aDefaultButton ) - { - strcat( lDialogString , "default=tkMessageBox.YES," ) ; - } - else - { - strcat( lDialogString , "default=tkMessageBox.NO," ) ; - } - } - else if ( aDialogType && ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat( lDialogString , "askyesnocancel(" ) ; - switch ( aDefaultButton ) - { - case 1: strcat( lDialogString , "default=tkMessageBox.YES," ); break; - case 2: strcat( lDialogString , "default=tkMessageBox.NO," ); break; - case 0: strcat( lDialogString , "default=tkMessageBox.CANCEL," ); break; - } - } - else - { - strcat( lDialogString , "showinfo(" ) ; - } - - strcat( lDialogString , "icon='" ) ; - if ( aIconType && (! strcmp( "question" , aIconType ) - || ! strcmp( "error" , aIconType ) - || ! strcmp( "warning" , aIconType ) ) ) - { - strcat( lDialogString , aIconType ) ; - } - else - { - strcat( lDialogString , "info" ) ; - } - - strcat(lDialogString, "',") ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, "message='") ; - lpDialogString = lDialogString + strlen(lDialogString); - tfd_replaceSubStr( aMessage , "\n" , "\\n" , lpDialogString ) ; - strcat(lDialogString, "'") ; - } - - if ( aDialogType && ! strcmp( "yesnocancel" , aDialogType ) ) - { - strcat(lDialogString, ");\n\ -if res is None :\n\tprint 0\n\ -elif res is False :\n\tprint 2\n\ -else :\n\tprint 1\n\"" ) ; - } - else - { - strcat(lDialogString, ");\n\ -if res is False :\n\tprint 0\n\ -else :\n\tprint 1\n\"" ) ; - } - } - else if ( gxmessagePresent() || gmessagePresent() || (!gdialogPresent() && !xdialogPresent() && xmessagePresent()) ) - { - if ( gxmessagePresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"gxmessage");return 1;} - strcpy( lDialogString , "gxmessage"); - } - else if ( gmessagePresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"gmessage");return 1;} - strcpy( lDialogString , "gmessage"); - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"xmessage");return 1;} - strcpy( lDialogString , "xmessage"); - } - - if ( aDialogType && ! strcmp("okcancel" , aDialogType) ) - { - strcat( lDialogString , " -buttons Ok:1,Cancel:0"); - switch ( aDefaultButton ) - { - case 1: strcat( lDialogString , " -default Ok"); break; - case 0: strcat( lDialogString , " -default Cancel"); break; - } - } - else if ( aDialogType && ! strcmp("yesno" , aDialogType) ) - { - strcat( lDialogString , " -buttons Yes:1,No:0"); - switch ( aDefaultButton ) - { - case 1: strcat( lDialogString , " -default Yes"); break; - case 0: strcat( lDialogString , " -default No"); break; - } - } - else if ( aDialogType && ! strcmp("yesnocancel" , aDialogType) ) - { - strcat( lDialogString , " -buttons Yes:1,No:2,Cancel:0"); - switch ( aDefaultButton ) - { - case 1: strcat( lDialogString , " -default Yes"); break; - case 2: strcat( lDialogString , " -default No"); break; - case 0: strcat( lDialogString , " -default Cancel"); break; - } - } - else - { - strcat( lDialogString , " -buttons Ok:1"); - strcat( lDialogString , " -default Ok"); - } - - strcat( lDialogString , " -center \""); - if ( aMessage && strlen(aMessage) ) - { - strcat( lDialogString , aMessage ) ; - } - strcat(lDialogString, "\"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat( lDialogString , " -title \""); - strcat( lDialogString , aTitle ) ; - strcat( lDialogString, "\"" ) ; - } - strcat( lDialogString , " ; echo $? "); - } - else if ( xdialogPresent() || gdialogPresent() || dialogName() || whiptailPresent() ) - { - if ( gdialogPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"gdialog");return 1;} - lWasGraphicDialog = 1 ; - strcpy( lDialogString , "(gdialog " ) ; - } - else if ( xdialogPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"xdialog");return 1;} - lWasGraphicDialog = 1 ; - strcpy( lDialogString , "(Xdialog " ) ; - } - else if ( dialogName( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return 0;} - if ( isTerminalRunning( ) ) - { - strcpy( lDialogString , "(dialog " ) ; - } - else - { - lWasXterm = 1 ; - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'(" ) ; - strcat( lDialogString , dialogName() ) ; - strcat( lDialogString , " " ) ; - } - } - else if ( isTerminalRunning( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"whiptail");return 0;} - strcpy( lDialogString , "(whiptail " ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"whiptail");return 0;} - lWasXterm = 1 ; - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'(whiptail " ) ; - } - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - if ( !xdialogPresent() && !gdialogPresent() ) - { - if ( aDialogType && ( !strcmp( "okcancel" , aDialogType ) || !strcmp( "yesno" , aDialogType ) - || !strcmp( "yesnocancel" , aDialogType ) ) ) - { - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, "tab: move focus") ; - strcat(lDialogString, "\" ") ; - } - } - - if ( aDialogType && ! strcmp( "okcancel" , aDialogType ) ) - { - if ( ! aDefaultButton ) - { - strcat( lDialogString , "--defaultno " ) ; - } - strcat( lDialogString , - "--yes-label \"Ok\" --no-label \"Cancel\" --yesno " ) ; - } - else if ( aDialogType && ! strcmp( "yesno" , aDialogType ) ) - { - if ( ! aDefaultButton ) - { - strcat( lDialogString , "--defaultno " ) ; - } - strcat( lDialogString , "--yesno " ) ; - } - else if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - if (!aDefaultButton) - { - strcat(lDialogString, "--defaultno "); - } - strcat(lDialogString, "--menu "); - } - else - { - strcat( lDialogString , "--msgbox " ) ; - - } - strcat( lDialogString , "\"" ) ; - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, aMessage) ; - } - strcat(lDialogString, "\" "); - - if ( lWasGraphicDialog ) - { - if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - strcat(lDialogString,"0 60 0 Yes \"\" No \"\") 2>/tmp/tinyfd.txt;\ -if [ $? = 0 ];then tinyfdBool=1;else tinyfdBool=0;fi;\ -tinyfdRes=$(cat /tmp/tinyfd.txt);echo $tinyfdBool$tinyfdRes") ; - } - else - { - strcat(lDialogString, - "10 60 ) 2>&1;if [ $? = 0 ];then echo 1;else echo 0;fi"); - } - } - else - { - if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - strcat(lDialogString,"0 60 0 Yes \"\" No \"\" >/dev/tty ) 2>/tmp/tinyfd.txt;\ - if [ $? = 0 ];then tinyfdBool=1;else tinyfdBool=0;fi;\ - tinyfdRes=$(cat /tmp/tinyfd.txt);echo $tinyfdBool$tinyfdRes") ; - - if ( lWasXterm ) - { - strcat(lDialogString," >/tmp/tinyfd0.txt';cat /tmp/tinyfd0.txt"); - } - else - { - strcat(lDialogString, "; clear >/dev/tty") ; - } - } - else - { - strcat(lDialogString, "10 60 >/dev/tty) 2>&1;if [ $? = 0 ];"); - if ( lWasXterm ) - { - strcat( lDialogString , -"then\n\techo 1\nelse\n\techo 0\nfi >/tmp/tinyfd.txt';cat /tmp/tinyfd.txt;rm /tmp/tinyfd.txt"); - } - else - { - strcat(lDialogString, - "then echo 1;else echo 0;fi;clear >/dev/tty"); - } - } - } - } - else if ( !isTerminalRunning() && terminalName() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"basicinput");return 0;} - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'" ) ; - if ( !gWarningDisplayed && !tinyfd_forceConsole) - { - gWarningDisplayed = 1 ; - strcat( lDialogString , "echo \"" ) ; - strcat( lDialogString, gTitle) ; - strcat( lDialogString , "\";" ) ; - strcat( lDialogString , "echo \"" ) ; - strcat( lDialogString, tinyfd_needs) ; - strcat( lDialogString , "\";echo;echo;" ) ; - } - if ( aTitle && strlen(aTitle) ) - { - strcat( lDialogString , "echo \"" ) ; - strcat( lDialogString, aTitle) ; - strcat( lDialogString , "\";echo;" ) ; - } - if ( aMessage && strlen(aMessage) ) - { - strcat( lDialogString , "echo \"" ) ; - strcat( lDialogString, aMessage) ; - strcat( lDialogString , "\"; " ) ; - } - if ( aDialogType && !strcmp("yesno",aDialogType) ) - { - strcat( lDialogString , "echo -n \"y/n: \"; " ) ; - strcat( lDialogString , "stty sane -echo;" ) ; - strcat( lDialogString , - "answer=$( while ! head -c 1 | grep -i [ny];do true ;done);"); - strcat( lDialogString , - "if echo \"$answer\" | grep -iq \"^y\";then\n"); - strcat( lDialogString , "\techo 1\nelse\n\techo 0\nfi" ) ; - } - else if ( aDialogType && !strcmp("okcancel",aDialogType) ) - { - strcat( lDialogString , "echo -n \"[O]kay/[C]ancel: \"; " ) ; - strcat( lDialogString , "stty sane -echo;" ) ; - strcat( lDialogString , - "answer=$( while ! head -c 1 | grep -i [oc];do true ;done);"); - strcat( lDialogString , - "if echo \"$answer\" | grep -iq \"^o\";then\n"); - strcat( lDialogString , "\techo 1\nelse\n\techo 0\nfi" ) ; - } - else if ( aDialogType && !strcmp("yesnocancel",aDialogType) ) - { - strcat( lDialogString , "echo -n \"[Y]es/[N]o/[C]ancel: \"; " ) ; - strcat( lDialogString , "stty sane -echo;" ) ; - strcat( lDialogString , - "answer=$( while ! head -c 1 | grep -i [nyc];do true ;done);"); - strcat( lDialogString , - "if echo \"$answer\" | grep -iq \"^y\";then\n\techo 1\n"); - strcat( lDialogString , "elif echo \"$answer\" | grep -iq \"^n\";then\n\techo 2\n" ) ; - strcat( lDialogString , "else\n\techo 0\nfi" ) ; - } - else - { - strcat(lDialogString , "echo -n \"press enter to continue \"; "); - strcat( lDialogString , "stty sane -echo;" ) ; - strcat( lDialogString , - "answer=$( while ! head -c 1;do true ;done);echo 1"); - } - strcat( lDialogString , - " >/tmp/tinyfd.txt';cat /tmp/tinyfd.txt;rm /tmp/tinyfd.txt"); - } - else if ( !isTerminalRunning() && pythonDbusPresent() && !strcmp("ok" , aDialogType) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python-dbus");return 1;} - strcpy( lDialogString , gPythonName ) ; - strcat( lDialogString ," -c \"import dbus;bus=dbus.SessionBus();"); - strcat( lDialogString ,"notif=bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications');" ) ; - strcat( lDialogString ,"notify=dbus.Interface(notif,'org.freedesktop.Notifications');" ) ; - strcat( lDialogString ,"notify.Notify('',0,'" ) ; - if ( aIconType && strlen(aIconType) ) - { - strcat( lDialogString , aIconType ) ; - } - strcat(lDialogString, "','") ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, aTitle) ; - } - strcat(lDialogString, "','") ; - if ( aMessage && strlen(aMessage) ) - { - lpDialogString = lDialogString + strlen(lDialogString); - tfd_replaceSubStr( aMessage , "\n" , "\\n" , lpDialogString ) ; - } - strcat(lDialogString, "','','',5000)\"") ; - } - else if ( !isTerminalRunning() && (perlPresent() >= 2) && !strcmp("ok" , aDialogType) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"perl-dbus");return 1;} - - strcpy( lDialogString , "perl -e \"use Net::DBus;\ -my \\$sessionBus = Net::DBus->session;\ -my \\$notificationsService = \\$sessionBus->get_service('org.freedesktop.Notifications');\ -my \\$notificationsObject = \\$notificationsService->get_object('/org/freedesktop/Notifications',\ -'org.freedesktop.Notifications');"); - - sprintf( lDialogString + strlen(lDialogString), -"my \\$notificationId;\\$notificationId = \\$notificationsObject->Notify(shift, 0, '%s', '%s', '%s', [], {}, -1);\" ", - aIconType?aIconType:"", aTitle?aTitle:"", aMessage?aMessage:"" ) ; - } - else if ( !isTerminalRunning() && notifysendPresent() && !strcmp("ok" , aDialogType) ) - { - - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"notifysend");return 1;} - strcpy( lDialogString , "notify-send" ) ; - if ( aIconType && strlen(aIconType) ) - { - strcat( lDialogString , " -i '" ) ; - strcat( lDialogString , aIconType ) ; - strcat( lDialogString , "'" ) ; - } - strcat( lDialogString , " \"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, aTitle) ; - strcat( lDialogString , " | " ) ; - } - if ( aMessage && strlen(aMessage) ) - { - tfd_replaceSubStr( aMessage , "\n\t" , " | " , lBuff ) ; - tfd_replaceSubStr( aMessage , "\n" , " | " , lBuff ) ; - tfd_replaceSubStr( aMessage , "\t" , " " , lBuff ) ; - strcat(lDialogString, lBuff) ; - } - strcat( lDialogString , "\"" ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"basicinput");return 0;} - if ( !gWarningDisplayed && !tinyfd_forceConsole) - { - gWarningDisplayed = 1 ; - printf("\n\n%s\n", gTitle); - printf("%s\n\n", tinyfd_needs); - } - if ( aTitle && strlen(aTitle) ) - { - printf("\n%s\n", aTitle); - } - - tcgetattr(0, &infoOri); - tcgetattr(0, &info); - info.c_lflag &= ~ICANON; - info.c_cc[VMIN] = 1; - info.c_cc[VTIME] = 0; - tcsetattr(0, TCSANOW, &info); - if ( aDialogType && !strcmp("yesno",aDialogType) ) - { - do - { - if ( aMessage && strlen(aMessage) ) - { - printf("\n%s\n",aMessage); - } - printf("y/n: "); fflush(stdout); - lChar = (char) tolower( getchar() ) ; - printf("\n\n"); - } - while ( lChar != 'y' && lChar != 'n' ); - lResult = lChar == 'y' ? 1 : 0 ; - } - else if ( aDialogType && !strcmp("okcancel",aDialogType) ) - { - do - { - if ( aMessage && strlen(aMessage) ) - { - printf("\n%s\n",aMessage); - } - printf("[O]kay/[C]ancel: "); fflush(stdout); - lChar = (char) tolower( getchar() ) ; - printf("\n\n"); - } - while ( lChar != 'o' && lChar != 'c' ); - lResult = lChar == 'o' ? 1 : 0 ; - } - else if ( aDialogType && !strcmp("yesnocancel",aDialogType) ) - { - do - { - if ( aMessage && strlen(aMessage) ) - { - printf("\n%s\n",aMessage); - } - printf("[Y]es/[N]o/[C]ancel: "); fflush(stdout); - lChar = (char) tolower( getchar() ) ; - printf("\n\n"); - } - while ( lChar != 'y' && lChar != 'n' && lChar != 'c' ); - lResult = (lChar == 'y') ? 1 : (lChar == 'n') ? 2 : 0 ; - } - else - { - if ( aMessage && strlen(aMessage) ) - { - printf("\n%s\n\n",aMessage); - } - printf("press enter to continue "); fflush(stdout); - getchar() ; - printf("\n\n"); - lResult = 1 ; - } - tcsetattr(0, TCSANOW, &infoOri); - free(lDialogString); - return lResult ; - } - - if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ; - - if ( ! ( lIn = popen( lDialogString , "r" ) ) ) - { - free(lDialogString); - return 0 ; - } - while ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - {} - - pclose( lIn ) ; - - /* printf( "lBuff: %s len: %lu \n" , lBuff , strlen(lBuff) ) ; */ - if ( lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - /* printf( "lBuff1: %s len: %lu \n" , lBuff , strlen(lBuff) ) ; */ - - if (aDialogType && !strcmp("yesnocancel", aDialogType)) - { - if ( lBuff[0]=='1' ) - { - if ( !strcmp( lBuff+1 , "Yes" )) strcpy(lBuff,"1"); - else if ( !strcmp( lBuff+1 , "No" )) strcpy(lBuff,"2"); - } - } - /* printf( "lBuff2: %s len: %lu \n" , lBuff , strlen(lBuff) ) ; */ - - lResult = !strcmp( lBuff , "2" ) ? 2 : !strcmp( lBuff , "1" ) ? 1 : 0; - - /* printf( "lResult: %d\n" , lResult ) ; */ - free(lDialogString); - return lResult ; -} - - -/* return has only meaning for tinyfd_query */ -int tinyfd_notifyPopup( - char const * aTitle , /* NULL or "" */ - char const * aMessage , /* NULL or "" may contain \n and \t */ - char const * aIconType ) /* "info" "warning" "error" */ -{ - char lBuff[MAX_PATH_OR_CMD]; - char * lDialogString = NULL ; - char * lpDialogString ; - FILE * lIn ; - size_t lTitleLen ; - size_t lMessageLen ; - - if (tfd_quoteDetected(aTitle)) return tinyfd_notifyPopup("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aMessage, aIconType); - if (tfd_quoteDetected(aMessage)) return tinyfd_notifyPopup(aTitle, "INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aIconType); - - if ( getenv("SSH_TTY") && !dunstifyPresent() && !dunstPresent() ) - { - return tinyfd_messageBox(aTitle, aMessage, "ok", aIconType, 0); - } - - lTitleLen = aTitle ? strlen(aTitle) : 0 ; - lMessageLen = aMessage ? strlen(aMessage) : 0 ; - if ( !aTitle || strcmp(aTitle,"tinyfd_query") ) - { - lDialogString = (char *) malloc( MAX_PATH_OR_CMD + lTitleLen + lMessageLen ); - } - - if ( getenv("SSH_TTY") ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dunst");return 1;} - strcpy( lDialogString , "notify-send \"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat( lDialogString , aTitle ) ; - strcat( lDialogString , "\" \"" ) ; - } - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, aMessage) ; - } - strcat( lDialogString , "\"" ) ; - } - else if ( osascriptPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"applescript");return 1;} - - strcpy( lDialogString , "osascript "); - if ( ! osx9orBetter() ) strcat( lDialogString , " -e 'tell application \"System Events\"' -e 'Activate'"); - strcat( lDialogString , " -e 'try' -e 'display notification \"") ; - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, aMessage) ; - } - strcat(lDialogString, " \" ") ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "with title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - strcat( lDialogString, "' -e 'end try'") ; - if ( ! osx9orBetter() ) strcat( lDialogString, " -e 'end tell'") ; - } - else if ( tfd_kdialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"kdialog");return 1;} - strcpy( lDialogString , "kdialog" ) ; - - if ( aIconType && strlen(aIconType) ) - { - strcat( lDialogString , " --icon '" ) ; - strcat( lDialogString , aIconType ) ; - strcat( lDialogString , "'" ) ; - } - if ( aTitle && strlen(aTitle) ) - { - strcat( lDialogString , " --title \"" ) ; - strcat( lDialogString , aTitle ) ; - strcat( lDialogString , "\"" ) ; - } - - strcat( lDialogString , " --passivepopup" ) ; - strcat( lDialogString , " \"" ) ; - if ( aMessage ) - { - strcat( lDialogString , aMessage ) ; - } - strcat( lDialogString , " \" 5" ) ; - } - else if ( tfd_yadPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"yad");return 1;} - strcpy( lDialogString , "yad --notification"); - - if ( aIconType && strlen( aIconType ) ) - { - strcat( lDialogString , " --image=\""); - strcat( lDialogString , aIconType ) ; - strcat( lDialogString , "\"" ) ; - } - - strcat( lDialogString , " --text=\"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\n") ; - } - if ( aMessage && strlen( aMessage ) ) - { - strcat( lDialogString , aMessage ) ; - } - strcat( lDialogString , " \"" ) ; - } - else if ( perlPresent() >= 2 ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"perl-dbus");return 1;} - - strcpy( lDialogString , "perl -e \"use Net::DBus;\ -my \\$sessionBus = Net::DBus->session;\ -my \\$notificationsService = \\$sessionBus->get_service('org.freedesktop.Notifications');\ -my \\$notificationsObject = \\$notificationsService->get_object('/org/freedesktop/Notifications',\ -'org.freedesktop.Notifications');"); - - sprintf( lDialogString + strlen(lDialogString) , -"my \\$notificationId;\\$notificationId = \\$notificationsObject->Notify(shift, 0, '%s', '%s', '%s', [], {}, -1);\" ", -aIconType?aIconType:"", aTitle?aTitle:"", aMessage?aMessage:"" ) ; - } - else if ( pythonDbusPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python-dbus");return 1;} - strcpy( lDialogString , gPythonName ) ; - strcat( lDialogString ," -c \"import dbus;bus=dbus.SessionBus();"); - strcat( lDialogString ,"notif=bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications');" ) ; - strcat( lDialogString ,"notify=dbus.Interface(notif,'org.freedesktop.Notifications');" ) ; - strcat( lDialogString ,"notify.Notify('',0,'" ) ; - if ( aIconType && strlen(aIconType) ) - { - strcat( lDialogString , aIconType ) ; - } - strcat(lDialogString, "','") ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, aTitle) ; - } - strcat(lDialogString, "','") ; - if ( aMessage && strlen(aMessage) ) - { - lpDialogString = lDialogString + strlen(lDialogString); - tfd_replaceSubStr( aMessage , "\n" , "\\n" , lpDialogString ) ; - } - strcat(lDialogString, "','','',5000)\"") ; - } - else if ( notifysendPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"notifysend");return 1;} - strcpy( lDialogString , "notify-send" ) ; - if ( aIconType && strlen(aIconType) ) - { - strcat( lDialogString , " -i '" ) ; - strcat( lDialogString , aIconType ) ; - strcat( lDialogString , "'" ) ; - } - strcat( lDialogString , " \"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, aTitle) ; - strcat( lDialogString , " | " ) ; - } - if ( aMessage && strlen(aMessage) ) - { - tfd_replaceSubStr( aMessage , "\n\t" , " | " , lBuff ) ; - tfd_replaceSubStr( aMessage , "\n" , " | " , lBuff ) ; - tfd_replaceSubStr( aMessage , "\t" , " " , lBuff ) ; - strcat(lDialogString, lBuff) ; - } - strcat( lDialogString , "\"" ) ; - } - else if ( (tfd_zenity3Present()>=5) ) - { - /* zenity 2.32 & 3.14 has the notification but with a bug: it doesnt return from it */ - /* zenity 3.8 show the notification as an alert ok cancel box */ - /* zenity 3.44 doesn't have the notification (3.42 has it) */ - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"zenity");return 1;} - strcpy( lDialogString , "zenity --notification"); - - if ( aIconType && strlen( aIconType ) ) - { - strcat( lDialogString , " --window-icon '"); - strcat( lDialogString , aIconType ) ; - strcat( lDialogString , "'" ) ; - } - - strcat( lDialogString , " --text \"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\n") ; - } - if ( aMessage && strlen( aMessage ) ) - { - strcat( lDialogString , aMessage ) ; - } - strcat( lDialogString , " \"" ) ; - } - else - { - if (lDialogString) free(lDialogString); - return tinyfd_messageBox(aTitle, aMessage, "ok", aIconType, 0); - } - - if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ; - - if ( ! ( lIn = popen( lDialogString , "r" ) ) ) - { - free(lDialogString); - return 0 ; - } - - pclose( lIn ) ; - free(lDialogString); - return 1; -} - - -/* returns NULL on cancel */ -char * tinyfd_inputBox( - char const * aTitle , /* NULL or "" */ - char const * aMessage , /* NULL or "" (\n and \t have no effect) */ - char const * aDefaultInput ) /* "" , if NULL it's a passwordBox */ -{ - static char lBuff[MAX_PATH_OR_CMD]; - char * lDialogString = NULL; - char * lpDialogString; - FILE * lIn ; - int lResult ; - int lWasGdialog = 0 ; - int lWasGraphicDialog = 0 ; - int lWasXterm = 0 ; - int lWasBasicXterm = 0 ; - struct termios oldt ; - struct termios newt ; - char * lEOF; - size_t lTitleLen ; - size_t lMessageLen ; - - if (!aTitle && !aMessage && !aDefaultInput) return lBuff; /* now I can fill lBuff from outside */ - - lBuff[0]='\0'; - - if (tfd_quoteDetected(aTitle)) return tinyfd_inputBox("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aMessage, aDefaultInput); - if (tfd_quoteDetected(aMessage)) return tinyfd_inputBox(aTitle, "INVALID MESSAGE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultInput); - if (tfd_quoteDetected(aDefaultInput)) return tinyfd_inputBox(aTitle, aMessage, "INVALID DEFAULT_INPUT WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - - lTitleLen = aTitle ? strlen(aTitle) : 0 ; - lMessageLen = aMessage ? strlen(aMessage) : 0 ; - if ( !aTitle || strcmp(aTitle,"tinyfd_query") ) - { - lDialogString = (char *) malloc( MAX_PATH_OR_CMD + lTitleLen + lMessageLen ); - } - - if ( osascriptPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"applescript");return (char *)1;} - strcpy( lDialogString , "osascript "); - if ( ! osx9orBetter() ) strcat( lDialogString , " -e 'tell application \"System Events\"' -e 'Activate'"); - strcat( lDialogString , " -e 'try' -e 'display dialog \"") ; - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, aMessage) ; - } - strcat(lDialogString, "\" ") ; - strcat(lDialogString, "default answer \"") ; - if ( aDefaultInput && strlen(aDefaultInput) ) - { - strcat(lDialogString, aDefaultInput) ; - } - strcat(lDialogString, "\" ") ; - if ( ! aDefaultInput ) - { - strcat(lDialogString, "hidden answer true ") ; - } - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "with title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - strcat(lDialogString, "with icon note' ") ; - strcat(lDialogString, "-e '\"1\" & text returned of result' " ); - strcat(lDialogString, "-e 'on error number -128' " ) ; - strcat(lDialogString, "-e '0' " ); - strcat(lDialogString, "-e 'end try'") ; - if ( ! osx9orBetter() ) strcat(lDialogString, " -e 'end tell'") ; - } - else if ( tfd_kdialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"kdialog");return (char *)1;} - strcpy( lDialogString , "szAnswer=$(kdialog" ) ; - - if ( (tfd_kdialogPresent() == 2) && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - - if ( ! aDefaultInput ) - { - strcat(lDialogString, " --password ") ; - } - else - { - strcat(lDialogString, " --inputbox ") ; - - } - strcat(lDialogString, "\"") ; - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, aMessage ) ; - } - strcat(lDialogString , "\" \"" ) ; - if ( aDefaultInput && strlen(aDefaultInput) ) - { - strcat(lDialogString, aDefaultInput ) ; - } - strcat(lDialogString , "\"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, " --title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - } - strcat( lDialogString , - ");if [ $? = 0 ];then echo 1$szAnswer;else echo 0$szAnswer;fi"); - } - else if ( tfd_zenityPresent() || tfd_matedialogPresent() || tfd_shellementaryPresent() || tfd_qarmaPresent() ) - { - if ( tfd_zenityPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"zenity");return (char *)1;} - strcpy( lDialogString , "szAnswer=$(zenity" ) ; - if ( (tfd_zenity3Present() >= 4) && !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat( lDialogString, " --attach=$(sleep .01;xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - else if ( tfd_matedialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"matedialog");return (char *)1;} - strcpy( lDialogString , "szAnswer=$(matedialog" ) ; - } - else if ( tfd_shellementaryPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"shellementary");return (char *)1;} - strcpy( lDialogString , "szAnswer=$(shellementary" ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"qarma");return (char *)1;} - strcpy( lDialogString , "szAnswer=$(qarma" ) ; - if ( !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - strcat( lDialogString ," --entry" ) ; - - strcat(lDialogString, " --title=\"") ; - if (aTitle && strlen(aTitle)) strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - - strcat(lDialogString, " --text=\"") ; - if (aMessage && strlen(aMessage)) strcat(lDialogString, aMessage) ; - strcat(lDialogString, "\"") ; - - if ( aDefaultInput ) - { - strcat(lDialogString, " --entry-text=\"") ; - strcat(lDialogString, aDefaultInput) ; - strcat(lDialogString, "\"") ; - } - else - { - strcat(lDialogString, " --hide-text") ; - } - if (tinyfd_silent) strcat( lDialogString , " 2>/dev/null "); - strcat( lDialogString , - ");if [ $? = 0 ];then echo 1$szAnswer;else echo 0$szAnswer;fi"); - } - else if (tfd_yadPresent()) - { - if (aTitle && !strcmp(aTitle, "tinyfd_query")) { strcpy(tinyfd_response, "yad"); return (char*)1; } - strcpy(lDialogString, "szAnswer=$(yad --entry"); - if (aTitle && strlen(aTitle)) - { - strcat(lDialogString, " --title=\""); - strcat(lDialogString, aTitle); - strcat(lDialogString, "\""); - } - if (aMessage && strlen(aMessage)) - { - strcat(lDialogString, " --text=\""); - strcat(lDialogString, aMessage); - strcat(lDialogString, "\""); - } - if (aDefaultInput && strlen(aDefaultInput)) - { - strcat(lDialogString, " --entry-text=\""); - strcat(lDialogString, aDefaultInput); - strcat(lDialogString, "\""); - } - else - { - strcat(lDialogString, " --hide-text"); - } - if (tinyfd_silent) strcat(lDialogString, " 2>/dev/null "); - strcat(lDialogString, - ");if [ $? = 0 ];then echo 1$szAnswer;else echo 0$szAnswer;fi"); - } - else if ( gxmessagePresent() || gmessagePresent() ) - { - if ( gxmessagePresent() ) { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"gxmessage");return (char *)1;} - strcpy( lDialogString , "szAnswer=$(gxmessage -buttons Ok:1,Cancel:0 -center \""); - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"gmessage");return (char *)1;} - strcpy( lDialogString , "szAnswer=$(gmessage -buttons Ok:1,Cancel:0 -center \""); - } - - if ( aMessage && strlen(aMessage) ) - { - strcat( lDialogString , aMessage ) ; - } - strcat(lDialogString, "\"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat( lDialogString , " -title \""); - strcat( lDialogString , aTitle ) ; - strcat(lDialogString, "\" " ) ; - } - strcat(lDialogString, " -entrytext \"" ) ; - if ( aDefaultInput && strlen(aDefaultInput) ) - { - strcat( lDialogString , aDefaultInput ) ; - } - strcat(lDialogString, "\"" ) ; - strcat( lDialogString , ");echo $?$szAnswer"); - } - else if ( !gdialogPresent() && !xdialogPresent() && tkinter3Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python3-tkinter");return (char *)1;} - strcpy( lDialogString , gPython3Name ) ; - strcat( lDialogString , - " -S -c \"import tkinter; from tkinter import simpledialog;root=tkinter.Tk();root.withdraw();"); - strcat( lDialogString ,"res=simpledialog.askstring(" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aMessage && strlen(aMessage) ) - { - - strcat(lDialogString, "prompt='") ; - lpDialogString = lDialogString + strlen(lDialogString); - tfd_replaceSubStr( aMessage , "\n" , "\\n" , lpDialogString ) ; - strcat(lDialogString, "',") ; - } - if ( aDefaultInput ) - { - if ( strlen(aDefaultInput) ) - { - strcat(lDialogString, "initialvalue='") ; - strcat(lDialogString, aDefaultInput) ; - strcat(lDialogString, "',") ; - } - } - else - { - strcat(lDialogString, "show='*'") ; - } - strcat(lDialogString, ");\nif res is None :\n\tprint(0)"); - strcat(lDialogString, "\nelse :\n\tprint('1'+res)\n\"" ) ; - } - else if ( !gdialogPresent() && !xdialogPresent() && tkinter2Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python2-tkinter");return (char *)1;} - strcpy( lDialogString , "export PYTHONIOENCODING=utf-8;" ) ; - strcat( lDialogString , gPython2Name ) ; - if ( ! isTerminalRunning( ) && tfd_isDarwin( ) ) - { - strcat( lDialogString , " -i" ) ; /* for osx without console */ - } - - strcat( lDialogString , - " -S -c \"import Tkinter,tkSimpleDialog;root=Tkinter.Tk();root.withdraw();"); - - if ( tfd_isDarwin( ) ) - { - strcat( lDialogString , -"import os;os.system('''/usr/bin/osascript -e 'tell app \\\"Finder\\\" to set \ -frontmost of process \\\"Python\\\" to true' ''');"); - } - - strcat( lDialogString ,"res=tkSimpleDialog.askstring(" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aMessage && strlen(aMessage) ) - { - - strcat(lDialogString, "prompt='") ; - lpDialogString = lDialogString + strlen(lDialogString); - tfd_replaceSubStr( aMessage , "\n" , "\\n" , lpDialogString ) ; - strcat(lDialogString, "',") ; - } - if ( aDefaultInput ) - { - if ( strlen(aDefaultInput) ) - { - strcat(lDialogString, "initialvalue='") ; - strcat(lDialogString, aDefaultInput) ; - strcat(lDialogString, "',") ; - } - } - else - { - strcat(lDialogString, "show='*'") ; - } - strcat(lDialogString, ");\nif res is None :\n\tprint 0"); - strcat(lDialogString, "\nelse :\n\tprint '1'+res\n\"" ) ; - } - else if ( gdialogPresent() || xdialogPresent() || dialogName() || whiptailPresent() ) - { - if ( gdialogPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"gdialog");return (char *)1;} - lWasGraphicDialog = 1 ; - lWasGdialog = 1 ; - strcpy( lDialogString , "(gdialog " ) ; - } - else if ( xdialogPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"xdialog");return (char *)1;} - lWasGraphicDialog = 1 ; - strcpy( lDialogString , "(Xdialog " ) ; - } - else if ( dialogName( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return (char *)0;} - if ( isTerminalRunning( ) ) - { - strcpy( lDialogString , "(dialog " ) ; - } - else - { - lWasXterm = 1 ; - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'(" ) ; - strcat( lDialogString , dialogName() ) ; - strcat( lDialogString , " " ) ; - } - } - else if ( isTerminalRunning( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"whiptail");return (char *)0;} - strcpy( lDialogString , "(whiptail " ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"whiptail");return (char *)0;} - lWasXterm = 1 ; - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'(whiptail " ) ; - } - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - if ( !xdialogPresent() && !gdialogPresent() ) - { - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, "tab: move focus") ; - if ( ! aDefaultInput && !lWasGdialog ) - { - strcat(lDialogString, " (sometimes nothing, no blink nor star, is shown in text field)") ; - } - strcat(lDialogString, "\" ") ; - } - - if ( aDefaultInput || lWasGdialog ) - { - strcat( lDialogString , "--inputbox" ) ; - } - else - { - if ( !lWasGraphicDialog && dialogName() && isDialogVersionBetter09b() ) - { - strcat( lDialogString , "--insecure " ) ; - } - strcat( lDialogString , "--passwordbox" ) ; - } - strcat( lDialogString , " \"" ) ; - if ( aMessage && strlen(aMessage) ) - { - strcat(lDialogString, aMessage) ; - } - strcat(lDialogString,"\" 10 60 ") ; - if ( aDefaultInput && strlen(aDefaultInput) ) - { - strcat(lDialogString, "\"") ; - strcat(lDialogString, aDefaultInput) ; - strcat(lDialogString, "\" ") ; - } - if ( lWasGraphicDialog ) - { - strcat(lDialogString,") 2>/tmp/tinyfd.txt;\ - if [ $? = 0 ];then tinyfdBool=1;else tinyfdBool=0;fi;\ - tinyfdRes=$(cat /tmp/tinyfd.txt);echo $tinyfdBool$tinyfdRes") ; - } - else - { - strcat(lDialogString,">/dev/tty ) 2>/tmp/tinyfd.txt;\ - if [ $? = 0 ];then tinyfdBool=1;else tinyfdBool=0;fi;\ - tinyfdRes=$(cat /tmp/tinyfd.txt);echo $tinyfdBool$tinyfdRes") ; - - if ( lWasXterm ) - { - strcat(lDialogString," >/tmp/tinyfd0.txt';cat /tmp/tinyfd0.txt"); - } - else - { - strcat(lDialogString, "; clear >/dev/tty") ; - } - } - } - else if ( ! isTerminalRunning( ) && terminalName() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"basicinput");return (char *)0;} - lWasBasicXterm = 1 ; - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'" ) ; - if ( !gWarningDisplayed && !tinyfd_forceConsole) - { - gWarningDisplayed = 1 ; - tinyfd_messageBox(gTitle,tinyfd_needs,"ok","warning",0); - } - if ( aTitle && strlen(aTitle) && !tinyfd_forceConsole) - { - strcat( lDialogString , "echo \"" ) ; - strcat( lDialogString, aTitle) ; - strcat( lDialogString , "\";echo;" ) ; - } - - strcat( lDialogString , "echo \"" ) ; - if ( aMessage && strlen(aMessage) ) - { - strcat( lDialogString, aMessage) ; - } - strcat( lDialogString , "\";read " ) ; - if ( ! aDefaultInput ) - { - strcat( lDialogString , "-s " ) ; - } - strcat( lDialogString , "-p \"" ) ; - strcat( lDialogString , "(esc+enter to cancel): \" ANSWER " ) ; - strcat( lDialogString , ";echo 1$ANSWER >/tmp/tinyfd.txt';" ) ; - strcat( lDialogString , "cat -v /tmp/tinyfd.txt"); - } - else if ( !gWarningDisplayed && ! isTerminalRunning( ) && ! terminalName() ) { - gWarningDisplayed = 1 ; - tinyfd_messageBox(gTitle,tinyfd_needs,"ok","warning",0); - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"no_solution");return (char *)0;} - free(lDialogString); - return NULL; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"basicinput");return (char *)0;} - if ( !gWarningDisplayed && !tinyfd_forceConsole) - { - gWarningDisplayed = 1 ; - tinyfd_messageBox(gTitle,tinyfd_needs,"ok","warning",0); - } - if ( aTitle && strlen(aTitle) ) - { - printf("\n%s\n", aTitle); - } - if ( aMessage && strlen(aMessage) ) - { - printf("\n%s\n",aMessage); - } - printf("(esc+enter to cancel): "); fflush(stdout); - if ( ! aDefaultInput ) - { - tcgetattr(STDIN_FILENO, & oldt) ; - newt = oldt ; - newt.c_lflag &= ~ECHO ; - tcsetattr(STDIN_FILENO, TCSANOW, & newt); - } - - lEOF = fgets(lBuff, MAX_PATH_OR_CMD, stdin); - /* printf("lbuff<%c><%d>\n",lBuff[0],lBuff[0]); */ - if ( ! lEOF || (lBuff[0] == '\0') ) - { - free(lDialogString); - return NULL; - } - - if ( lBuff[0] == '\n' ) - { - lEOF = fgets(lBuff, MAX_PATH_OR_CMD, stdin); - /* printf("lbuff<%c><%d>\n",lBuff[0],lBuff[0]); */ - if ( ! lEOF || (lBuff[0] == '\0') ) - { - free(lDialogString); - return NULL; - } - } - - if ( ! aDefaultInput ) - { - tcsetattr(STDIN_FILENO, TCSANOW, & oldt); - printf("\n"); - } - printf("\n"); - if ( strchr(lBuff,27) ) - { - free(lDialogString); - return NULL ; - } - if ( lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - free(lDialogString); - return lBuff ; - } - - if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ; - lIn = popen( lDialogString , "r" ); - if ( ! lIn ) - { - if ( fileExists("/tmp/tinyfd.txt") ) - { - wipefile("/tmp/tinyfd.txt"); - remove("/tmp/tinyfd.txt"); - } - if ( fileExists("/tmp/tinyfd0.txt") ) - { - wipefile("/tmp/tinyfd0.txt"); - remove("/tmp/tinyfd0.txt"); - } - free(lDialogString); - return NULL ; - } - while ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - {} - - pclose( lIn ) ; - - if ( fileExists("/tmp/tinyfd.txt") ) - { - wipefile("/tmp/tinyfd.txt"); - remove("/tmp/tinyfd.txt"); - } - if ( fileExists("/tmp/tinyfd0.txt") ) - { - wipefile("/tmp/tinyfd0.txt"); - remove("/tmp/tinyfd0.txt"); - } - - /* printf( "len Buff: %lu\n" , strlen(lBuff) ) ; */ - /* printf( "lBuff0: %s\n" , lBuff ) ; */ - if ( lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - /* printf( "lBuff1: %s len: %lu \n" , lBuff , strlen(lBuff) ) ; */ - if ( lWasBasicXterm ) - { - if ( strstr(lBuff,"^[") ) /* esc was pressed */ - { - free(lDialogString); - return NULL ; - } - } - - lResult = strncmp( lBuff , "1" , 1) ? 0 : 1 ; - /* printf( "lResult: %d \n" , lResult ) ; */ - if ( ! lResult ) - { - free(lDialogString); - return NULL ; - } - - /* printf( "lBuff+1: %s\n" , lBuff+1 ) ; */ - free(lDialogString); - return lBuff+1 ; -} - - -char * tinyfd_saveFileDialog( - char const * aTitle , /* NULL or "" */ - char const * aDefaultPathAndFile , /* NULL or "" */ - int aNumOfFilterPatterns , /* 0 */ - char const * const * aFilterPatterns , /* NULL or {"*.txt","*.doc"} */ - char const * aSingleFilterDescription ) /* NULL or "text files" */ -{ - static char lBuff[MAX_PATH_OR_CMD] ; - char lDialogString[MAX_PATH_OR_CMD] ; - char lString[MAX_PATH_OR_CMD] ; - int i ; - int lWasGraphicDialog = 0 ; - int lWasXterm = 0 ; - char * p ; - char * lPointerInputBox ; - FILE * lIn ; - lBuff[0]='\0'; - - if ( ! aFilterPatterns ) aNumOfFilterPatterns = 0 ; - if (tfd_quoteDetected(aTitle)) return tinyfd_saveFileDialog("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription); - if (tfd_quoteDetected(aDefaultPathAndFile)) return tinyfd_saveFileDialog(aTitle, "INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription); - if (tfd_quoteDetected(aSingleFilterDescription)) return tinyfd_saveFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, "INVALID FILTER_DESCRIPTION WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - for (i = 0; i < aNumOfFilterPatterns; i++) - { - if (tfd_quoteDetected(aFilterPatterns[i])) return tinyfd_saveFileDialog("INVALID FILTER_PATTERN WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, 0, NULL, NULL); - } - - if ( osascriptPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"applescript");return (char *)1;} - strcpy( lDialogString , "osascript "); - if ( ! osx9orBetter() ) strcat( lDialogString , " -e 'tell application \"Finder\"' -e 'Activate'"); - strcat( lDialogString , " -e 'try' -e 'POSIX path of ( choose file name " ); - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "with prompt \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - getPathWithoutFinalSlash( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "default location \"") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "\" " ) ; - } - getLastName( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "default name \"") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "\" " ) ; - } - strcat( lDialogString , ")' " ) ; - strcat(lDialogString, "-e 'on error number -128' " ) ; - strcat(lDialogString, "-e 'end try'") ; - if ( ! osx9orBetter() ) strcat( lDialogString, " -e 'end tell'") ; - } - else if ( tfd_kdialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"kdialog");return (char *)1;} - - strcpy( lDialogString , "kdialog" ) ; - if ( (tfd_kdialogPresent() == 2) && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - strcat( lDialogString , " --getsavefilename " ) ; - - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - if ( aDefaultPathAndFile[0] != '/' ) - { - strcat(lDialogString, "$PWD/") ; - } - strcat(lDialogString, "\"") ; - strcat(lDialogString, aDefaultPathAndFile ) ; - strcat(lDialogString , "\"" ) ; - } - else - { - strcat(lDialogString, "$PWD/") ; - } - - if ( aNumOfFilterPatterns > 0 ) - { - strcat(lDialogString , " \"" ) ; - strcat( lDialogString , aFilterPatterns[0] ) ; - for ( i = 1 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , " " ) ; - strcat( lDialogString , aFilterPatterns[i] ) ; - } - if ( aSingleFilterDescription && strlen(aSingleFilterDescription) ) - { - strcat( lDialogString , " | " ) ; - strcat( lDialogString , aSingleFilterDescription ) ; - } - strcat( lDialogString , "\"" ) ; - } - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, " --title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - } - } - else if ( tfd_zenityPresent() || tfd_matedialogPresent() || tfd_shellementaryPresent() || tfd_qarmaPresent() ) - { - if ( tfd_zenityPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"zenity");return (char *)1;} - strcpy( lDialogString , "zenity" ) ; - if ( (tfd_zenity3Present() >= 4) && !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat( lDialogString, " --attach=$(sleep .01;xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - else if ( tfd_matedialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"matedialog");return (char *)1;} - strcpy( lDialogString , "matedialog" ) ; - } - else if ( tfd_shellementaryPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"shellementary");return (char *)1;} - strcpy( lDialogString , "shellementary" ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"qarma");return (char *)1;} - strcpy( lDialogString , "qarma" ) ; - if ( !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - strcat(lDialogString, " --file-selection --save --confirm-overwrite" ) ; - - strcat(lDialogString, " --title=\"") ; - if (aTitle && strlen(aTitle)) strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - strcat(lDialogString, " --filename=\"") ; - strcat(lDialogString, aDefaultPathAndFile) ; - strcat(lDialogString, "\"") ; - } - if ( aNumOfFilterPatterns > 0 ) - { - strcat( lDialogString , " --file-filter='" ) ; - if ( aSingleFilterDescription && strlen(aSingleFilterDescription) ) - { - strcat( lDialogString , aSingleFilterDescription ) ; - strcat( lDialogString , " |" ) ; - } - for ( i = 0 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , " " ) ; - strcat( lDialogString , aFilterPatterns[i] ) ; - } - strcat( lDialogString , "' --file-filter='All files | *'" ) ; - } - if (tinyfd_silent) strcat( lDialogString , " 2>/dev/null "); - } - else if (tfd_yadPresent()) - { - if (aTitle && !strcmp(aTitle, "tinyfd_query")) { strcpy(tinyfd_response, "yad"); return (char*)1; } - strcpy(lDialogString, "yad --file --save --confirm-overwrite"); - if (aTitle && strlen(aTitle)) - { - strcat(lDialogString, " --title=\""); - strcat(lDialogString, aTitle); - strcat(lDialogString, "\""); - } - if (aDefaultPathAndFile && strlen(aDefaultPathAndFile)) - { - strcat(lDialogString, " --filename=\""); - strcat(lDialogString, aDefaultPathAndFile); - strcat(lDialogString, "\""); - } - if (aNumOfFilterPatterns > 0) - { - strcat(lDialogString, " --file-filter='"); - if (aSingleFilterDescription && strlen(aSingleFilterDescription)) - { - strcat(lDialogString, aSingleFilterDescription); - strcat(lDialogString, " |"); - } - for (i = 0; i < aNumOfFilterPatterns; i++) - { - strcat(lDialogString, " "); - strcat(lDialogString, aFilterPatterns[i]); - } - strcat(lDialogString, "' --file-filter='All files | *'"); - } - if (tinyfd_silent) strcat(lDialogString, " 2>/dev/null "); - } - else if ( !xdialogPresent() && tkinter3Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python3-tkinter");return (char *)1;} - strcpy( lDialogString , gPython3Name ) ; - strcat( lDialogString , - " -S -c \"import tkinter;from tkinter import filedialog;root=tkinter.Tk();root.withdraw();"); - strcat( lDialogString , "res=filedialog.asksaveasfilename("); - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - getPathWithoutFinalSlash( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "initialdir='") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "'," ) ; - } - getLastName( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "initialfile='") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "'," ) ; - } - } - if ( ( aNumOfFilterPatterns > 1 ) - || ( (aNumOfFilterPatterns == 1) /* test because poor osx behaviour */ - && ( aFilterPatterns[0][strlen(aFilterPatterns[0])-1] != '*' ) ) ) - { - strcat(lDialogString , "filetypes=(" ) ; - strcat( lDialogString , "('" ) ; - if ( aSingleFilterDescription && strlen(aSingleFilterDescription) ) - { - strcat( lDialogString , aSingleFilterDescription ) ; - } - strcat( lDialogString , "',(" ) ; - for ( i = 0 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , "'" ) ; - strcat( lDialogString , aFilterPatterns[i] ) ; - strcat( lDialogString , "'," ) ; - } - strcat( lDialogString , "))," ) ; - strcat( lDialogString , "('All files','*'))" ) ; - } - strcat( lDialogString, ");\nif not isinstance(res, tuple):\n\tprint(res)\n\"" ) ; - } - else if ( !xdialogPresent() && tkinter2Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python2-tkinter");return (char *)1;} - strcpy( lDialogString , "export PYTHONIOENCODING=utf-8;" ) ; - strcat( lDialogString , gPython2Name ) ; - if ( ! isTerminalRunning( ) && tfd_isDarwin( )) - { - strcat( lDialogString , " -i" ) ; /* for osx without console */ - } - strcat( lDialogString , -" -S -c \"import Tkinter,tkFileDialog;root=Tkinter.Tk();root.withdraw();"); - - if ( tfd_isDarwin( ) ) - { - strcat( lDialogString , -"import os;os.system('''/usr/bin/osascript -e 'tell app \\\"Finder\\\" to set\ - frontmost of process \\\"Python\\\" to true' ''');"); - } - - strcat( lDialogString , "res=tkFileDialog.asksaveasfilename("); - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - getPathWithoutFinalSlash( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "initialdir='") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "'," ) ; - } - getLastName( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "initialfile='") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "'," ) ; - } - } - if ( ( aNumOfFilterPatterns > 1 ) - || ( (aNumOfFilterPatterns == 1) /* test because poor osx behaviour */ - && ( aFilterPatterns[0][strlen(aFilterPatterns[0])-1] != '*' ) ) ) - { - strcat(lDialogString , "filetypes=(" ) ; - strcat( lDialogString , "('" ) ; - if ( aSingleFilterDescription && strlen(aSingleFilterDescription) ) - { - strcat( lDialogString , aSingleFilterDescription ) ; - } - strcat( lDialogString , "',(" ) ; - for ( i = 0 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , "'" ) ; - strcat( lDialogString , aFilterPatterns[i] ) ; - strcat( lDialogString , "'," ) ; - } - strcat( lDialogString , "))," ) ; - strcat( lDialogString , "('All files','*'))" ) ; - } - strcat( lDialogString, ");\nif not isinstance(res, tuple):\n\tprint res \n\"" ) ; - } - else if ( xdialogPresent() || dialogName() ) - { - if ( xdialogPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"xdialog");return (char *)1;} - lWasGraphicDialog = 1 ; - strcpy( lDialogString , "(Xdialog " ) ; - } - else if ( isTerminalRunning( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return (char *)0;} - strcpy( lDialogString , "(dialog " ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return (char *)0;} - lWasXterm = 1 ; - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'(" ) ; - strcat( lDialogString , dialogName() ) ; - strcat( lDialogString , " " ) ; - } - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - if ( !xdialogPresent() && !gdialogPresent() ) - { - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, - "tab: focus | /: populate | spacebar: fill text field | ok: TEXT FIELD ONLY") ; - strcat(lDialogString, "\" ") ; - } - - strcat( lDialogString , "--fselect \"" ) ; - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - if ( ! strchr(aDefaultPathAndFile, '/') ) - { - strcat(lDialogString, "./") ; - } - strcat(lDialogString, aDefaultPathAndFile) ; - } - else if ( ! isTerminalRunning( ) && !lWasGraphicDialog ) - { - strcat(lDialogString, getenv("HOME")) ; - strcat(lDialogString, "/") ; - } - else - { - strcat(lDialogString, "./") ; - } - - if ( lWasGraphicDialog ) - { - strcat(lDialogString, "\" 0 60 ) 2>&1 ") ; - } - else - { - strcat(lDialogString, "\" 0 60 >/dev/tty) ") ; - if ( lWasXterm ) - { - strcat( lDialogString , - "2>/tmp/tinyfd.txt';cat /tmp/tinyfd.txt;rm /tmp/tinyfd.txt"); - } - else - { - strcat(lDialogString, "2>&1 ; clear >/dev/tty") ; - } - } - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){return tinyfd_inputBox(aTitle,NULL,NULL);} - strcpy(lBuff, "Save file in "); - strcat(lBuff, getCurDir()); - lPointerInputBox = tinyfd_inputBox(NULL, NULL, NULL); /* obtain a pointer on the current content of tinyfd_inputBox */ - if (lPointerInputBox) strcpy(lString, lPointerInputBox); /* preserve the current content of tinyfd_inputBox */ - p = tinyfd_inputBox(aTitle, lBuff, ""); - if (p) strcpy(lBuff, p); else lBuff[0] = '\0'; - if (lPointerInputBox) strcpy(lPointerInputBox, lString); /* restore its previous content to tinyfd_inputBox */ - p = lBuff; - - getPathWithoutFinalSlash( lString , p ) ; - if ( strlen( lString ) && ! dirExists( lString ) ) - { - return NULL ; - } - getLastName(lString,p); - if ( ! strlen(lString) ) - { - return NULL; - } - return p ; - } - - if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ; - if ( ! ( lIn = popen( lDialogString , "r" ) ) ) - { - return NULL ; - } - while ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - {} - pclose( lIn ) ; - if ( lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - /* printf( "lBuff: %s\n" , lBuff ) ; */ - if ( ! strlen(lBuff) ) - { - return NULL; - } - getPathWithoutFinalSlash( lString , lBuff ) ; - if ( strlen( lString ) && ! dirExists( lString ) ) - { - return NULL ; - } - getLastName(lString,lBuff); - if ( ! filenameValid(lString) ) - { - return NULL; - } - return lBuff ; -} - - -/* in case of multiple files, the separator is | */ -char * tinyfd_openFileDialog( - char const * aTitle , /* NULL or "" */ - char const * aDefaultPathAndFile , /* NULL or "" */ - int aNumOfFilterPatterns , /* 0 */ - char const * const * aFilterPatterns , /* NULL or {"*.jpg","*.png"} */ - char const * aSingleFilterDescription , /* NULL or "image files" */ - int aAllowMultipleSelects ) /* 0 or 1 */ -{ - char lDialogString[MAX_PATH_OR_CMD] ; - char lString[MAX_PATH_OR_CMD] ; - int i ; - FILE * lIn ; - char * p ; - char * lPointerInputBox ; - int lWasKdialog = 0 ; - int lWasGraphicDialog = 0 ; - int lWasXterm = 0 ; - size_t lFullBuffLen ; - static char * lBuff = NULL; - - if ( ! aFilterPatterns ) aNumOfFilterPatterns = 0 ; - if (tfd_quoteDetected(aTitle)) return tinyfd_openFileDialog("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription, aAllowMultipleSelects); - if (tfd_quoteDetected(aDefaultPathAndFile)) return tinyfd_openFileDialog(aTitle, "INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription, aAllowMultipleSelects); - if (tfd_quoteDetected(aSingleFilterDescription)) return tinyfd_openFileDialog(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, "INVALID FILTER_DESCRIPTION WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aAllowMultipleSelects); - for (i = 0; i < aNumOfFilterPatterns; i++) - { - if (tfd_quoteDetected(aFilterPatterns[i])) return tinyfd_openFileDialog("INVALID FILTER_PATTERN WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPathAndFile, 0, NULL, NULL, aAllowMultipleSelects); - } - - free(lBuff); - if (aTitle&&!strcmp(aTitle,"tinyfd_query")) - { - lBuff = NULL; - } - else - { - if (aAllowMultipleSelects) - { - lFullBuffLen = MAX_MULTIPLE_FILES * MAX_PATH_OR_CMD + 1; - lBuff = (char *)(malloc(lFullBuffLen * sizeof(char))); - if (!lBuff) - { - lFullBuffLen = LOW_MULTIPLE_FILES * MAX_PATH_OR_CMD + 1; - lBuff = (char *)( malloc( lFullBuffLen * sizeof(char))); - } - } - else - { - lFullBuffLen = MAX_PATH_OR_CMD + 1; - lBuff = (char *)(malloc(lFullBuffLen * sizeof(char))); - } - if (!lBuff) return NULL; - lBuff[0]='\0'; - } - - if ( osascriptPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"applescript");return (char *)1;} - strcpy( lDialogString , "osascript "); - if ( ! osx9orBetter() ) strcat( lDialogString , " -e 'tell application \"System Events\"' -e 'Activate'"); - strcat( lDialogString , " -e 'try' -e '" ); - if ( ! aAllowMultipleSelects ) - { - - - strcat( lDialogString , "POSIX path of ( " ); - } - else - { - strcat( lDialogString , "set mylist to " ); - } - strcat( lDialogString , "choose file " ); - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "with prompt \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - getPathWithoutFinalSlash( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "default location \"") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "\" " ) ; - } - if ( aNumOfFilterPatterns > 0 ) - { - strcat(lDialogString , "of type {\"" ); - strcat( lDialogString , aFilterPatterns[0] + 2 ) ; - strcat( lDialogString , "\"" ) ; - for ( i = 1 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , ",\"" ) ; - strcat( lDialogString , aFilterPatterns[i] + 2) ; - strcat( lDialogString , "\"" ) ; - } - strcat( lDialogString , "} " ) ; - } - if ( aAllowMultipleSelects ) - { - strcat( lDialogString , "multiple selections allowed true ' " ) ; - strcat( lDialogString , - "-e 'set mystring to POSIX path of item 1 of mylist' " ); - strcat( lDialogString , - "-e 'repeat with i from 2 to the count of mylist' " ); - strcat( lDialogString , "-e 'set mystring to mystring & \"|\"' " ); - strcat( lDialogString , - "-e 'set mystring to mystring & POSIX path of item i of mylist' " ); - strcat( lDialogString , "-e 'end repeat' " ); - strcat( lDialogString , "-e 'mystring' " ); - } - else - { - strcat( lDialogString , ")' " ) ; - } - strcat(lDialogString, "-e 'on error number -128' " ) ; - strcat(lDialogString, "-e 'end try'") ; - if ( ! osx9orBetter() ) strcat( lDialogString, " -e 'end tell'") ; - } - else if ( tfd_kdialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"kdialog");return (char *)1;} - lWasKdialog = 1 ; - - strcpy( lDialogString , "kdialog" ) ; - if ( (tfd_kdialogPresent() == 2) && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - strcat( lDialogString , " --getopenfilename " ) ; - - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - if ( aDefaultPathAndFile[0] != '/' ) - { - strcat(lDialogString, "$PWD/") ; - } - strcat(lDialogString, "\"") ; - strcat(lDialogString, aDefaultPathAndFile ) ; - strcat(lDialogString , "\"" ) ; - } - else - { - strcat(lDialogString, "$PWD/") ; - } - - if ( aNumOfFilterPatterns > 0 ) - { - strcat(lDialogString , " \"" ) ; - strcat( lDialogString , aFilterPatterns[0] ) ; - for ( i = 1 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , " " ) ; - strcat( lDialogString , aFilterPatterns[i] ) ; - } - if ( aSingleFilterDescription && strlen(aSingleFilterDescription) ) - { - strcat( lDialogString , " | " ) ; - strcat( lDialogString , aSingleFilterDescription ) ; - } - strcat( lDialogString , "\"" ) ; - } - if ( aAllowMultipleSelects ) - { - strcat( lDialogString , " --multiple --separate-output" ) ; - } - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, " --title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - } - } - else if ( tfd_zenityPresent() || tfd_matedialogPresent() || tfd_shellementaryPresent() || tfd_qarmaPresent() ) - { - if ( tfd_zenityPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"zenity");return (char *)1;} - strcpy( lDialogString , "zenity" ) ; - if ( (tfd_zenity3Present() >= 4) && !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat( lDialogString, " --attach=$(sleep .01;xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - else if ( tfd_matedialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"matedialog");return (char *)1;} - strcpy( lDialogString , "matedialog" ) ; - } - else if ( tfd_shellementaryPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"shellementary");return (char *)1;} - strcpy( lDialogString , "shellementary" ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"qarma");return (char *)1;} - strcpy( lDialogString , "qarma" ) ; - if ( !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - strcat( lDialogString , " --file-selection" ) ; - - if ( aAllowMultipleSelects ) - { - strcat( lDialogString , " --multiple" ) ; - } - - strcat(lDialogString, " --title=\"") ; - if (aTitle && strlen(aTitle)) strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - strcat(lDialogString, " --filename=\"") ; - strcat(lDialogString, aDefaultPathAndFile) ; - strcat(lDialogString, "\"") ; - } - if ( aNumOfFilterPatterns > 0 ) - { - strcat( lDialogString , " --file-filter='" ) ; - if ( aSingleFilterDescription && strlen(aSingleFilterDescription) ) - { - strcat( lDialogString , aSingleFilterDescription ) ; - strcat( lDialogString , " |" ) ; - } - for ( i = 0 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , " " ) ; - strcat( lDialogString , aFilterPatterns[i] ) ; - } - strcat( lDialogString , "' --file-filter='All files | *'" ) ; - } - if (tinyfd_silent) strcat( lDialogString , " 2>/dev/null "); - } - else if (tfd_yadPresent()) - { - if (aTitle && !strcmp(aTitle, "tinyfd_query")) { strcpy(tinyfd_response, "yad"); return (char*)1; } - strcpy(lDialogString, "yad --file"); - if (aAllowMultipleSelects) - { - strcat(lDialogString, " --multiple"); - } - if (aTitle && strlen(aTitle)) - { - strcat(lDialogString, " --title=\""); - strcat(lDialogString, aTitle); - strcat(lDialogString, "\""); - } - if (aDefaultPathAndFile && strlen(aDefaultPathAndFile)) - { - strcat(lDialogString, " --filename=\""); - strcat(lDialogString, aDefaultPathAndFile); - strcat(lDialogString, "\""); - } - if (aNumOfFilterPatterns > 0) - { - strcat(lDialogString, " --file-filter='"); - if (aSingleFilterDescription && strlen(aSingleFilterDescription)) - { - strcat(lDialogString, aSingleFilterDescription); - strcat(lDialogString, " |"); - } - for (i = 0; i < aNumOfFilterPatterns; i++) - { - strcat(lDialogString, " "); - strcat(lDialogString, aFilterPatterns[i]); - } - strcat(lDialogString, "' --file-filter='All files | *'"); - } - if (tinyfd_silent) strcat(lDialogString, " 2>/dev/null "); - } - else if ( tkinter3Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python3-tkinter");return (char *)1;} - strcpy( lDialogString , gPython3Name ) ; - strcat( lDialogString , - " -S -c \"import tkinter;from tkinter import filedialog;root=tkinter.Tk();root.withdraw();"); - strcat( lDialogString , "lFiles=filedialog.askopenfilename("); - if ( aAllowMultipleSelects ) - { - strcat( lDialogString , "multiple=1," ) ; - } - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - getPathWithoutFinalSlash( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "initialdir='") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "'," ) ; - } - getLastName( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "initialfile='") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "'," ) ; - } - } - if ( ( aNumOfFilterPatterns > 1 ) - || ( ( aNumOfFilterPatterns == 1 ) /*test because poor osx behaviour*/ - && ( aFilterPatterns[0][strlen(aFilterPatterns[0])-1] != '*' ) ) ) - { - strcat(lDialogString , "filetypes=(" ) ; - strcat( lDialogString , "('" ) ; - if ( aSingleFilterDescription && strlen(aSingleFilterDescription) ) - { - strcat( lDialogString , aSingleFilterDescription ) ; - } - strcat( lDialogString , "',(" ) ; - for ( i = 0 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , "'" ) ; - strcat( lDialogString , aFilterPatterns[i] ) ; - strcat( lDialogString , "'," ) ; - } - strcat( lDialogString , "))," ) ; - strcat( lDialogString , "('All files','*'))" ) ; - } - strcat( lDialogString , ");\ -\nif not isinstance(lFiles, tuple):\n\tprint(lFiles)\nelse:\ -\n\tlFilesString=''\n\tfor lFile in lFiles:\n\t\tlFilesString+=str(lFile)+'|'\ -\n\tprint(lFilesString[:-1])\n\"" ) ; - } - else if ( tkinter2Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python2-tkinter");return (char *)1;} - strcpy( lDialogString , "export PYTHONIOENCODING=utf-8;" ) ; - strcat( lDialogString , gPython2Name ) ; - if ( ! isTerminalRunning( ) && tfd_isDarwin( ) ) - { - strcat( lDialogString , " -i" ) ; /* for osx without console */ - } - strcat( lDialogString , -" -S -c \"import Tkinter,tkFileDialog;root=Tkinter.Tk();root.withdraw();"); - - if ( tfd_isDarwin( ) ) - { - strcat( lDialogString , -"import os;os.system('''/usr/bin/osascript -e 'tell app \\\"Finder\\\" to set \ -frontmost of process \\\"Python\\\" to true' ''');"); - } - strcat( lDialogString , "lFiles=tkFileDialog.askopenfilename("); - if ( aAllowMultipleSelects ) - { - strcat( lDialogString , "multiple=1," ) ; - } - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - getPathWithoutFinalSlash( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "initialdir='") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "'," ) ; - } - getLastName( lString , aDefaultPathAndFile ) ; - if ( strlen(lString) ) - { - strcat(lDialogString, "initialfile='") ; - strcat(lDialogString, lString ) ; - strcat(lDialogString , "'," ) ; - } - } - if ( ( aNumOfFilterPatterns > 1 ) - || ( ( aNumOfFilterPatterns == 1 ) /*test because poor osx behaviour*/ - && ( aFilterPatterns[0][strlen(aFilterPatterns[0])-1] != '*' ) ) ) - { - strcat(lDialogString , "filetypes=(" ) ; - strcat( lDialogString , "('" ) ; - if ( aSingleFilterDescription && strlen(aSingleFilterDescription) ) - { - strcat( lDialogString , aSingleFilterDescription ) ; - } - strcat( lDialogString , "',(" ) ; - for ( i = 0 ; i < aNumOfFilterPatterns ; i ++ ) - { - strcat( lDialogString , "'" ) ; - strcat( lDialogString , aFilterPatterns[i] ) ; - strcat( lDialogString , "'," ) ; - } - strcat( lDialogString , "))," ) ; - strcat( lDialogString , "('All files','*'))" ) ; - } - strcat( lDialogString , ");\ -\nif not isinstance(lFiles, tuple):\n\tprint lFiles\nelse:\ -\n\tlFilesString=''\n\tfor lFile in lFiles:\n\t\tlFilesString+=str(lFile)+'|'\ -\n\tprint lFilesString[:-1]\n\"" ) ; - } - else if ( xdialogPresent() || dialogName() ) - { - if ( xdialogPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"xdialog");return (char *)1;} - lWasGraphicDialog = 1 ; - strcpy( lDialogString , "(Xdialog " ) ; - } - else if ( isTerminalRunning( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return (char *)0;} - strcpy( lDialogString , "(dialog " ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return (char *)0;} - lWasXterm = 1 ; - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'(" ) ; - strcat( lDialogString , dialogName() ) ; - strcat( lDialogString , " " ) ; - } - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - if ( !xdialogPresent() && !gdialogPresent() ) - { - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, - "tab: focus | /: populate | spacebar: fill text field | ok: TEXT FIELD ONLY") ; - strcat(lDialogString, "\" ") ; - } - - strcat( lDialogString , "--fselect \"" ) ; - if ( aDefaultPathAndFile && strlen(aDefaultPathAndFile) ) - { - if ( ! strchr(aDefaultPathAndFile, '/') ) - { - strcat(lDialogString, "./") ; - } - strcat(lDialogString, aDefaultPathAndFile) ; - } - else if ( ! isTerminalRunning( ) && !lWasGraphicDialog ) - { - strcat(lDialogString, getenv("HOME")) ; - strcat(lDialogString, "/"); - } - else - { - strcat(lDialogString, "./") ; - } - - if ( lWasGraphicDialog ) - { - strcat(lDialogString, "\" 0 60 ) 2>&1 ") ; - } - else - { - strcat(lDialogString, "\" 0 60 >/dev/tty) ") ; - if ( lWasXterm ) - { - strcat( lDialogString , - "2>/tmp/tinyfd.txt';cat /tmp/tinyfd.txt;rm /tmp/tinyfd.txt"); - } - else - { - strcat(lDialogString, "2>&1 ; clear >/dev/tty") ; - } - } - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){return tinyfd_inputBox(aTitle,NULL,NULL);} - strcpy(lBuff, "Open file from "); - strcat(lBuff, getCurDir()); - lPointerInputBox = tinyfd_inputBox(NULL, NULL, NULL); /* obtain a pointer on the current content of tinyfd_inputBox */ - if (lPointerInputBox) strcpy(lDialogString, lPointerInputBox); /* preserve the current content of tinyfd_inputBox */ - p = tinyfd_inputBox(aTitle, lBuff, ""); - if ( p ) strcpy(lBuff, p); else lBuff[0] = '\0'; - if (lPointerInputBox) strcpy(lPointerInputBox, lDialogString); /* restore its previous content to tinyfd_inputBox */ - if ( ! fileExists(lBuff) ) - { - free(lBuff); - lBuff = NULL; - } - else - { - lBuff = (char *)( realloc( lBuff, (strlen(lBuff)+1) * sizeof(char))); - } - return lBuff ; - } - - if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ; - if ( ! ( lIn = popen( lDialogString , "r" ) ) ) - { - free(lBuff); - lBuff = NULL; - return NULL ; - } - lBuff[0]='\0'; - p = lBuff; - while ( fgets( p , sizeof( lBuff ) , lIn ) != NULL ) - { - p += strlen( p ); - } - pclose( lIn ) ; - - if ( strlen( lBuff ) && lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - /* printf( "strlen lBuff: %d\n" , strlen( lBuff ) ) ; */ - if ( lWasKdialog && aAllowMultipleSelects ) - { - p = lBuff ; - while ( ( p = strchr( p , '\n' ) ) ) - * p = '|' ; - } - /* printf( "lBuff2: %s\n" , lBuff ) ; */ - if ( ! strlen( lBuff ) ) - { - free(lBuff); - lBuff = NULL; - return NULL; - } - if ( aAllowMultipleSelects && strchr(lBuff, '|') ) - { - if( ! ensureFilesExist( lBuff , lBuff ) ) - { - free(lBuff); - lBuff = NULL; - return NULL; - } - } - else if ( !fileExists(lBuff) ) - { - free(lBuff); - lBuff = NULL; - return NULL; - } - - lBuff = (char *)( realloc( lBuff, (strlen(lBuff)+1) * sizeof(char))); - - /*printf( "lBuff3 [%lu]: %s\n" , strlen(lBuff) , lBuff ) ; */ - return lBuff ; -} - - -char * tinyfd_selectFolderDialog( - char const * aTitle , /* "" */ - char const * aDefaultPath ) /* "" */ -{ - static char lBuff[MAX_PATH_OR_CMD] ; - char lDialogString[MAX_PATH_OR_CMD] ; - FILE * lIn ; - char * p ; - char * lPointerInputBox ; - int lWasGraphicDialog = 0 ; - int lWasXterm = 0 ; - lBuff[0]='\0'; - - if (tfd_quoteDetected(aTitle)) return tinyfd_selectFolderDialog("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultPath); - if (tfd_quoteDetected(aDefaultPath)) return tinyfd_selectFolderDialog(aTitle, "INVALID DEFAULT_PATH WITH QUOTES: use the GRAVE ACCENT \\x60 instead."); - - if ( osascriptPresent( )) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"applescript");return (char *)1;} - strcpy( lDialogString , "osascript "); - if ( ! osx9orBetter() ) strcat( lDialogString , " -e 'tell application \"System Events\"' -e 'Activate'"); - strcat( lDialogString , " -e 'try' -e 'POSIX path of ( choose folder "); - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "with prompt \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - if ( aDefaultPath && strlen(aDefaultPath) ) - { - strcat(lDialogString, "default location \"") ; - strcat(lDialogString, aDefaultPath ) ; - strcat(lDialogString , "\" " ) ; - } - strcat( lDialogString , ")' " ) ; - strcat(lDialogString, "-e 'on error number -128' " ) ; - strcat(lDialogString, "-e 'end try'") ; - if ( ! osx9orBetter() ) strcat( lDialogString, " -e 'end tell'") ; - } - else if ( tfd_kdialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"kdialog");return (char *)1;} - strcpy( lDialogString , "kdialog" ) ; - if ( (tfd_kdialogPresent() == 2) && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - strcat( lDialogString , " --getexistingdirectory " ) ; - - if ( aDefaultPath && strlen(aDefaultPath) ) - { - if ( aDefaultPath[0] != '/' ) - { - strcat(lDialogString, "$PWD/") ; - } - strcat(lDialogString, "\"") ; - strcat(lDialogString, aDefaultPath ) ; - strcat(lDialogString , "\"" ) ; - } - else - { - strcat(lDialogString, "$PWD/") ; - } - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, " --title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - } - } - else if ( tfd_zenityPresent() || tfd_matedialogPresent() || tfd_shellementaryPresent() || tfd_qarmaPresent() ) - { - if ( tfd_zenityPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"zenity");return (char *)1;} - strcpy( lDialogString , "zenity" ) ; - if ( (tfd_zenity3Present() >= 4) && !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat( lDialogString, " --attach=$(sleep .01;xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - else if ( tfd_matedialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"matedialog");return (char *)1;} - strcpy( lDialogString , "matedialog" ) ; - } - else if ( tfd_shellementaryPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"shellementary");return (char *)1;} - strcpy( lDialogString , "shellementary" ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"qarma");return (char *)1;} - strcpy( lDialogString , "qarma" ) ; - if ( !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - strcat( lDialogString , " --file-selection --directory" ) ; - - strcat(lDialogString, " --title=\"") ; - if (aTitle && strlen(aTitle)) strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - - if ( aDefaultPath && strlen(aDefaultPath) ) - { - strcat(lDialogString, " --filename=\"") ; - strcat(lDialogString, aDefaultPath) ; - strcat(lDialogString, "\"") ; - } - if (tinyfd_silent) strcat( lDialogString , " 2>/dev/null "); - } - else if (tfd_yadPresent()) - { - if (aTitle && !strcmp(aTitle, "tinyfd_query")) { strcpy(tinyfd_response, "yad"); return (char*)1; } - strcpy(lDialogString, "yad --file --directory"); - if (aTitle && strlen(aTitle)) - { - strcat(lDialogString, " --title=\""); - strcat(lDialogString, aTitle); - strcat(lDialogString, "\""); - } - if (aDefaultPath && strlen(aDefaultPath)) - { - strcat(lDialogString, " --filename=\""); - strcat(lDialogString, aDefaultPath); - strcat(lDialogString, "\""); - } - if (tinyfd_silent) strcat(lDialogString, " 2>/dev/null "); - } - else if ( !xdialogPresent() && tkinter3Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python3-tkinter");return (char *)1;} - strcpy( lDialogString , gPython3Name ) ; - strcat( lDialogString , - " -S -c \"import tkinter;from tkinter import filedialog;root=tkinter.Tk();root.withdraw();"); - strcat( lDialogString , "res=filedialog.askdirectory("); - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aDefaultPath && strlen(aDefaultPath) ) - { - strcat(lDialogString, "initialdir='") ; - strcat(lDialogString, aDefaultPath ) ; - strcat(lDialogString , "'" ) ; - } - strcat( lDialogString, ");\nif not isinstance(res, tuple):\n\tprint(res)\n\"" ) ; - } - else if ( !xdialogPresent() && tkinter2Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python2-tkinter");return (char *)1;} - strcpy( lDialogString , "export PYTHONIOENCODING=utf-8;" ) ; - strcat( lDialogString , gPython2Name ) ; - if ( ! isTerminalRunning( ) && tfd_isDarwin( ) ) - { - strcat( lDialogString , " -i" ) ; /* for osx without console */ - } - strcat( lDialogString , -" -S -c \"import Tkinter,tkFileDialog;root=Tkinter.Tk();root.withdraw();"); - - if ( tfd_isDarwin( ) ) - { - strcat( lDialogString , -"import os;os.system('''/usr/bin/osascript -e 'tell app \\\"Finder\\\" to set \ -frontmost of process \\\"Python\\\" to true' ''');"); - } - - strcat( lDialogString , "print tkFileDialog.askdirectory("); - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "',") ; - } - if ( aDefaultPath && strlen(aDefaultPath) ) - { - strcat(lDialogString, "initialdir='") ; - strcat(lDialogString, aDefaultPath ) ; - strcat(lDialogString , "'" ) ; - } - strcat( lDialogString , ")\"" ) ; - } - else if ( xdialogPresent() || dialogName() ) - { - if ( xdialogPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"xdialog");return (char *)1;} - lWasGraphicDialog = 1 ; - strcpy( lDialogString , "(Xdialog " ) ; - } - else if ( isTerminalRunning( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return (char *)0;} - strcpy( lDialogString , "(dialog " ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"dialog");return (char *)0;} - lWasXterm = 1 ; - strcpy( lDialogString , terminalName() ) ; - strcat( lDialogString , "'(" ) ; - strcat( lDialogString , dialogName() ) ; - strcat( lDialogString , " " ) ; - } - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, "--title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\" ") ; - } - - if ( !xdialogPresent() && !gdialogPresent() ) - { - strcat(lDialogString, "--backtitle \"") ; - strcat(lDialogString, - "tab: focus | /: populate | spacebar: fill text field | ok: TEXT FIELD ONLY") ; - strcat(lDialogString, "\" ") ; - } - - strcat( lDialogString , "--dselect \"" ) ; - if ( aDefaultPath && strlen(aDefaultPath) ) - { - strcat(lDialogString, aDefaultPath) ; - ensureFinalSlash(lDialogString); - } - else if ( ! isTerminalRunning( ) && !lWasGraphicDialog ) - { - strcat(lDialogString, getenv("HOME")) ; - strcat(lDialogString, "/"); - } - else - { - strcat(lDialogString, "./") ; - } - - if ( lWasGraphicDialog ) - { - strcat(lDialogString, "\" 0 60 ) 2>&1 ") ; - } - else - { - strcat(lDialogString, "\" 0 60 >/dev/tty) ") ; - if ( lWasXterm ) - { - strcat( lDialogString , - "2>/tmp/tinyfd.txt';cat /tmp/tinyfd.txt;rm /tmp/tinyfd.txt"); - } - else - { - strcat(lDialogString, "2>&1 ; clear >/dev/tty") ; - } - } - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){return tinyfd_inputBox(aTitle,NULL,NULL);} - strcpy(lBuff, "Select folder from "); - strcat(lBuff, getCurDir()); - lPointerInputBox = tinyfd_inputBox(NULL, NULL, NULL); /* obtain a pointer on the current content of tinyfd_inputBox */ - if (lPointerInputBox) strcpy(lDialogString, lPointerInputBox); /* preserve the current content of tinyfd_inputBox */ - p = tinyfd_inputBox(aTitle, lBuff, ""); - if (p) strcpy(lBuff, p); else lBuff[0] = '\0'; - if (lPointerInputBox) strcpy(lPointerInputBox, lDialogString); /* restore its previous content to tinyfd_inputBox */ - p = lBuff; - - if ( !p || ! strlen( p ) || ! dirExists( p ) ) - { - return NULL ; - } - return p ; - } - if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ; - if ( ! ( lIn = popen( lDialogString , "r" ) ) ) - { - return NULL ; - } - while ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - {} - pclose( lIn ) ; - if ( lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - /* printf( "lBuff: %s\n" , lBuff ) ; */ - if ( ! strlen( lBuff ) || ! dirExists( lBuff ) ) - { - return NULL ; - } - return lBuff ; -} - - -/* aDefaultRGB is used only if aDefaultHexRGB is absent */ -/* aDefaultRGB and aoResultRGB can be the same array */ -/* returns NULL on cancel */ -/* returns the hexcolor as a string "#FF0000" */ -/* aoResultRGB also contains the result */ -char * tinyfd_colorChooser( - char const * aTitle , /* NULL or "" */ - char const * aDefaultHexRGB , /* NULL or "#FF0000"*/ - unsigned char const aDefaultRGB[3] , /* { 0 , 255 , 255 } */ - unsigned char aoResultRGB[3] ) /* { 0 , 0 , 0 } */ -{ - static char lDefaultHexRGB[16]; - char lBuff[128] ; - - char lTmp[128] ; -#if !((defined(__cplusplus ) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__clang__)) - char * lTmp2 ; -#endif - char lDialogString[MAX_PATH_OR_CMD] ; - unsigned char lDefaultRGB[3]; - char * p; - char * lPointerInputBox; - FILE * lIn ; - int i ; - int lWasZenity3 = 0 ; - int lWasOsascript = 0 ; - int lWasXdialog = 0 ; - lBuff[0]='\0'; - - if (tfd_quoteDetected(aTitle)) return tinyfd_colorChooser("INVALID TITLE WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultHexRGB, aDefaultRGB, aoResultRGB); - if (tfd_quoteDetected(aDefaultHexRGB)) return tinyfd_colorChooser(aTitle, "INVALID DEFAULT_HEX_RGB WITH QUOTES: use the GRAVE ACCENT \\x60 instead.", aDefaultRGB, aoResultRGB); - - if (aDefaultHexRGB && (strlen(aDefaultHexRGB)==7) ) - { - Hex2RGB(aDefaultHexRGB, lDefaultRGB); - strcpy(lDefaultHexRGB, aDefaultHexRGB); - } - else - { - lDefaultRGB[0] = aDefaultRGB[0]; - lDefaultRGB[1] = aDefaultRGB[1]; - lDefaultRGB[2] = aDefaultRGB[2]; - RGB2Hex(aDefaultRGB, lDefaultHexRGB); - } - - if ( osascriptPresent( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"applescript");return (char *)1;} - lWasOsascript = 1 ; - strcpy( lDialogString , "osascript"); - - if ( ! osx9orBetter() ) - { - strcat( lDialogString , " -e 'tell application \"System Events\"' -e 'Activate'"); - strcat( lDialogString , " -e 'try' -e 'set mycolor to choose color default color {"); - } - else - { - strcat( lDialogString , -" -e 'try' -e 'tell app (path to frontmost application as Unicode text) \ -to set mycolor to choose color default color {"); - } - - sprintf(lTmp, "%d", 256 * lDefaultRGB[0] ) ; - strcat(lDialogString, lTmp ) ; - strcat(lDialogString, "," ) ; - sprintf(lTmp, "%d", 256 * lDefaultRGB[1] ) ; - strcat(lDialogString, lTmp ) ; - strcat(lDialogString, "," ) ; - sprintf(lTmp, "%d", 256 * lDefaultRGB[2] ) ; - strcat(lDialogString, lTmp ) ; - strcat(lDialogString, "}' " ) ; - strcat( lDialogString , -"-e 'set mystring to ((item 1 of mycolor) div 256 as integer) as string' " ); - strcat( lDialogString , -"-e 'repeat with i from 2 to the count of mycolor' " ); - strcat( lDialogString , -"-e 'set mystring to mystring & \" \" & ((item i of mycolor) div 256 as integer) as string' " ); - strcat( lDialogString , "-e 'end repeat' " ); - strcat( lDialogString , "-e 'mystring' "); - strcat(lDialogString, "-e 'on error number -128' " ) ; - strcat(lDialogString, "-e 'end try'") ; - if ( ! osx9orBetter() ) strcat( lDialogString, " -e 'end tell'") ; - } - else if ( tfd_kdialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"kdialog");return (char *)1;} - strcpy( lDialogString , "kdialog" ) ; - if ( (tfd_kdialogPresent() == 2) && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - sprintf( lDialogString + strlen(lDialogString) , " --getcolor --default '%s'" , lDefaultHexRGB ) ; - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, " --title \"") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - } - } - else if ( tfd_zenity3Present() || tfd_matedialogPresent() || tfd_shellementaryPresent() || tfd_qarmaPresent() ) - { - lWasZenity3 = 1 ; - if ( tfd_zenity3Present() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"zenity3");return (char *)1;} - strcpy( lDialogString , "zenity" ); - if ( (tfd_zenity3Present() >= 4) && !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat( lDialogString, " --attach=$(sleep .01;xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - else if ( tfd_matedialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"matedialog");return (char *)1;} - strcpy( lDialogString , "matedialog" ) ; - } - else if ( tfd_shellementaryPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"shellementary");return (char *)1;} - strcpy( lDialogString , "shellementary" ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"qarma");return (char *)1;} - strcpy( lDialogString , "qarma" ) ; - if ( !getenv("SSH_TTY") && tfd_xpropPresent() ) - { - strcat(lDialogString, " --attach=$(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)"); /* contribution: Paul Rouget */ - } - } - strcat( lDialogString , " --color-selection --show-palette" ) ; - sprintf( lDialogString + strlen(lDialogString), " --color=%s" , lDefaultHexRGB ) ; - - strcat(lDialogString, " --title=\"") ; - if (aTitle && strlen(aTitle)) strcat(lDialogString, aTitle) ; - strcat(lDialogString, "\"") ; - - if (tinyfd_silent) strcat( lDialogString , " 2>/dev/null "); - } - else if (tfd_yadPresent()) - { - if (aTitle && !strcmp(aTitle, "tinyfd_query")) { strcpy(tinyfd_response, "yad"); return (char*)1; } - strcpy(lDialogString, "yad --color"); - sprintf(lDialogString + strlen(lDialogString), " --init-color=%s", lDefaultHexRGB); - if (aTitle && strlen(aTitle)) - { - strcat(lDialogString, " --title=\""); - strcat(lDialogString, aTitle); - strcat(lDialogString, "\""); - } - if (tinyfd_silent) strcat(lDialogString, " 2>/dev/null "); - } - else if ( xdialogPresent() ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"xdialog");return (char *)1;} - lWasXdialog = 1 ; - strcpy( lDialogString , "Xdialog --colorsel \"" ) ; - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, aTitle) ; - } - strcat(lDialogString, "\" 0 60 ") ; -#if (defined(__cplusplus ) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__clang__) - sprintf(lTmp,"%hhu %hhu %hhu",lDefaultRGB[0],lDefaultRGB[1],lDefaultRGB[2]); -#else - sprintf(lTmp,"%hu %hu %hu",lDefaultRGB[0],lDefaultRGB[1],lDefaultRGB[2]); -#endif - strcat(lDialogString, lTmp) ; - strcat(lDialogString, " 2>&1"); - } - else if ( tkinter3Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python3-tkinter");return (char *)1;} - strcpy( lDialogString , gPython3Name ) ; - strcat( lDialogString , - " -S -c \"import tkinter;from tkinter import colorchooser;root=tkinter.Tk();root.withdraw();"); - strcat( lDialogString , "res=colorchooser.askcolor(color='" ) ; - strcat(lDialogString, lDefaultHexRGB ) ; - strcat(lDialogString, "'") ; - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, ",title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "'") ; - } - strcat( lDialogString , ");\ -\nif res[1] is not None:\n\tprint(res[1])\"" ) ; - } - else if ( tkinter2Present( ) ) - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){strcpy(tinyfd_response,"python2-tkinter");return (char *)1;} - strcpy( lDialogString , "export PYTHONIOENCODING=utf-8;" ) ; - strcat( lDialogString , gPython2Name ) ; - if ( ! isTerminalRunning( ) && tfd_isDarwin( ) ) - { - strcat( lDialogString , " -i" ) ; /* for osx without console */ - } - - strcat( lDialogString , -" -S -c \"import Tkinter,tkColorChooser;root=Tkinter.Tk();root.withdraw();"); - - if ( tfd_isDarwin( ) ) - { - strcat( lDialogString , -"import os;os.system('''osascript -e 'tell app \\\"Finder\\\" to set \ -frontmost of process \\\"Python\\\" to true' ''');"); - } - - strcat( lDialogString , "res=tkColorChooser.askcolor(color='" ) ; - strcat(lDialogString, lDefaultHexRGB ) ; - strcat(lDialogString, "'") ; - - - if ( aTitle && strlen(aTitle) ) - { - strcat(lDialogString, ",title='") ; - strcat(lDialogString, aTitle) ; - strcat(lDialogString, "'") ; - } - strcat( lDialogString , ");\ -\nif res[1] is not None:\n\tprint res[1]\"" ) ; - } - else - { - if (aTitle&&!strcmp(aTitle,"tinyfd_query")){return tinyfd_inputBox(aTitle,NULL,NULL);} - lPointerInputBox = tinyfd_inputBox(NULL, NULL, NULL); /* obtain a pointer on the current content of tinyfd_inputBox */ - if (lPointerInputBox) strcpy(lDialogString, lPointerInputBox); /* preserve the current content of tinyfd_inputBox */ - p = tinyfd_inputBox(aTitle, "Enter hex rgb color (i.e. #f5ca20)", lDefaultHexRGB); - - if ( !p || (strlen(p) != 7) || (p[0] != '#') ) - { - return NULL ; - } - for ( i = 1 ; i < 7 ; i ++ ) - { - if ( ! isxdigit( (int) p[i] ) ) - { - return NULL ; - } - } - Hex2RGB(p,aoResultRGB); - strcpy(lDefaultHexRGB, p); - if (lPointerInputBox) strcpy(lPointerInputBox, lDialogString); /* restore its previous content to tinyfd_inputBox */ - return lDefaultHexRGB; - } - - if (tinyfd_verbose) printf( "lDialogString: %s\n" , lDialogString ) ; - if ( ! ( lIn = popen( lDialogString , "r" ) ) ) - { - return NULL ; - } - while ( fgets( lBuff , sizeof( lBuff ) , lIn ) != NULL ) - { - } - pclose( lIn ) ; - if ( ! strlen( lBuff ) ) - { - return NULL ; - } - /* printf( "len Buff: %lu\n" , strlen(lBuff) ) ; */ - /* printf( "lBuff0: %s\n" , lBuff ) ; */ - if ( lBuff[strlen( lBuff ) -1] == '\n' ) - { - lBuff[strlen( lBuff ) -1] = '\0' ; - } - - if ( lWasZenity3 ) - { - if ( lBuff[0] == '#' ) - { - if ( strlen(lBuff)>7 ) - { - lBuff[3]=lBuff[5]; - lBuff[4]=lBuff[6]; - lBuff[5]=lBuff[9]; - lBuff[6]=lBuff[10]; - lBuff[7]='\0'; - } - Hex2RGB(lBuff,aoResultRGB); - } - else if ( lBuff[3] == '(' ) { -#if (defined(__cplusplus ) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__clang__) - sscanf(lBuff,"rgb(%hhu,%hhu,%hhu", & aoResultRGB[0], & aoResultRGB[1],& aoResultRGB[2]); -#else - aoResultRGB[0] = strtol(lBuff+4, & lTmp2, 10 ); - aoResultRGB[1] = strtol(lTmp2+1, & lTmp2, 10 ); - aoResultRGB[2] = strtol(lTmp2+1, NULL, 10 ); -#endif - RGB2Hex(aoResultRGB,lBuff); - } - else if ( lBuff[4] == '(' ) { -#if (defined(__cplusplus ) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__clang__) - sscanf(lBuff,"rgba(%hhu,%hhu,%hhu", & aoResultRGB[0], & aoResultRGB[1],& aoResultRGB[2]); -#else - aoResultRGB[0] = strtol(lBuff+5, & lTmp2, 10 ); - aoResultRGB[1] = strtol(lTmp2+1, & lTmp2, 10 ); - aoResultRGB[2] = strtol(lTmp2+1, NULL, 10 ); -#endif - RGB2Hex(aoResultRGB,lBuff); - } - } - else if ( lWasOsascript || lWasXdialog ) - { - /* printf( "lBuff: %s\n" , lBuff ) ; */ -#if (defined(__cplusplus ) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__clang__) - sscanf(lBuff,"%hhu %hhu %hhu", & aoResultRGB[0], & aoResultRGB[1],& aoResultRGB[2]); -#else - aoResultRGB[0] = strtol(lBuff, & lTmp2, 10 ); - aoResultRGB[1] = strtol(lTmp2+1, & lTmp2, 10 ); - aoResultRGB[2] = strtol(lTmp2+1, NULL, 10 ); -#endif - RGB2Hex(aoResultRGB,lBuff); - } - else - { - Hex2RGB(lBuff,aoResultRGB); - } - /* printf("%d %d %d\n", aoResultRGB[0],aoResultRGB[1],aoResultRGB[2]); */ - /* printf( "lBuff: %s\n" , lBuff ) ; */ - - strcpy(lDefaultHexRGB,lBuff); - return lDefaultHexRGB ; -} - -#endif /* _WIN32 */ - - -/* -int main( int argc , char * argv[] ) -{ -char const * lTmp; -char const * lTheSaveFileName; -char const * lTheOpenFileName; -char const * lTheSelectFolderName; -char const * lTheHexColor; -char const * lWillBeGraphicMode; -unsigned char lRgbColor[3]; -FILE * lIn; -char lBuffer[1024]; -char lString[1024]; -char const * lFilterPatterns[2] = { "*.txt", "*.text" }; - -tinyfd_verbose = argc - 1; -tinyfd_silent = 1; - -lWillBeGraphicMode = tinyfd_inputBox("tinyfd_query", NULL, NULL); - -strcpy(lBuffer, "v"); -strcat(lBuffer, tinyfd_version); -if (lWillBeGraphicMode) -{ - strcat(lBuffer, "\ngraphic mode: "); -} -else -{ - strcat(lBuffer, "\nconsole mode: "); -} -strcat(lBuffer, tinyfd_response); -strcat(lBuffer, "\n"); -strcat(lBuffer, tinyfd_needs+78); -strcpy(lString, "tinyfiledialogs"); -tinyfd_messageBox(lString, lBuffer, "ok", "info", 0); - -tinyfd_notifyPopup("the title", "the message\n\tfrom outer-space", "info"); - -if (lWillBeGraphicMode && !tinyfd_forceConsole) -{ - tinyfd_forceConsole = ! tinyfd_messageBox("Hello World", - "graphic dialogs [yes] / console mode [no]?", - "yesno", "question", 1); -} - -lTmp = tinyfd_inputBox( - "a password box", "your password will be revealed", NULL); - -if (!lTmp) return 1; - -strcpy(lString, lTmp); - -lTheSaveFileName = tinyfd_saveFileDialog( - "let us save this password", - "passwordFile.txt", - 2, - lFilterPatterns, - NULL); - -if (!lTheSaveFileName) -{ - tinyfd_messageBox( - "Error", - "Save file name is NULL", - "ok", - "error", - 1); - return 1; -} - -lIn = fopen(lTheSaveFileName, "w"); -if (!lIn) -{ - tinyfd_messageBox( - "Error", - "Can not open this file in write mode", - "ok", - "error", - 1); - return 1; -} -fputs(lString, lIn); -fclose(lIn); - -lTheOpenFileName = tinyfd_openFileDialog( - "let us read the password back", - "", - 2, - lFilterPatterns, - NULL, - 0); - -if (!lTheOpenFileName) -{ - tinyfd_messageBox( - "Error", - "Open file name is NULL", - "ok", - "error", - 1); - return 1; -} - -lIn = fopen(lTheOpenFileName, "r"); - -if (!lIn) -{ - tinyfd_messageBox( - "Error", - "Can not open this file in read mode", - "ok", - "error", - 1); - return(1); -} -lBuffer[0] = '\0'; -fgets(lBuffer, sizeof(lBuffer), lIn); -fclose(lIn); - -tinyfd_messageBox("your password is", - lBuffer, "ok", "info", 1); - -lTheSelectFolderName = tinyfd_selectFolderDialog( - "let us just select a directory", NULL); - -if (!lTheSelectFolderName) -{ - tinyfd_messageBox( - "Error", - "Select folder name is NULL", - "ok", - "error", - 1); - return 1; -} - -tinyfd_messageBox("The selected folder is", - lTheSelectFolderName, "ok", "info", 1); - -lTheHexColor = tinyfd_colorChooser( - "choose a nice color", - "#FF0077", - lRgbColor, - lRgbColor); - -if (!lTheHexColor) -{ - tinyfd_messageBox( - "Error", - "hexcolor is NULL", - "ok", - "error", - 1); - return 1; -} - -tinyfd_messageBox("The selected hexcolor is", - lTheHexColor, "ok", "info", 1); - - tinyfd_beep(); - - return 0; -} -*/ - -#ifdef _MSC_VER -#pragma warning(default:4996) -#pragma warning(default:4100) -#pragma warning(default:4706) -#endif diff --git a/FCLauncher/src/main/jni/lwjgl/tinyfd/tinyfiledialogs.h b/FCLauncher/src/main/jni/lwjgl/tinyfd/tinyfiledialogs.h deleted file mode 100644 index c2e8647f..00000000 --- a/FCLauncher/src/main/jni/lwjgl/tinyfd/tinyfiledialogs.h +++ /dev/null @@ -1,307 +0,0 @@ -/* SPDX-License-Identifier: ZLIB -Copyright (c) 2014 - 2023 Guillaume Vareille http://ysengrin.com - -If you are using a C++ compiler to compile tinyfiledialogs.c (maybe renamed with an extension ".cpp") -then comment out << extern "C" >> bellow in this header file) - _________ - / \ tinyfiledialogs.h v3.13.3 [Jul 2, 2023] - |tiny file| Unique header file created [November 9, 2014] - | dialogs | - \____ ___/ http://tinyfiledialogs.sourceforge.net - \| git clone http://git.code.sf.net/p/tinyfiledialogs/code tinyfd - ____________________________________________ -| | -| email: tinyfiledialogs at ysengrin.com | -|____________________________________________| - ________________________________________________________________________________ -| ____________________________________________________________________________ | -| | | | -| | - in tinyfiledialogs, char is UTF-8 by default (since v3.6) | | -| | | | -| | on windows: | | -| | - for UTF-16, use the wchar_t functions at the bottom of the header file | | -| | - _wfopen() requires wchar_t | | -| | | | -| | - but fopen() expects MBCS (not UTF-8) | | -| | - if you want char to be MBCS: set tinyfd_winUtf8 to 0 | | -| | | | -| | - alternatively, tinyfiledialogs provides | | -| | functions to convert between UTF-8, UTF-16 and MBCS | | -| |____________________________________________________________________________| | -|________________________________________________________________________________| - -If you like tinyfiledialogs, please upvote my stackoverflow answer -https://stackoverflow.com/a/47651444 - -- License - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef TINYFILEDIALOGS_H -#define TINYFILEDIALOGS_H - -#ifdef __cplusplus -/* if tinydialogs.c is compiled as C++ code rather than C code, you may need to comment this out - and the corresponding closing bracket near the end of this file. */ -extern "C" { -#endif - -/******************************************************************************************************/ -/**************************************** UTF-8 on Windows ********************************************/ -/******************************************************************************************************/ -#ifdef _WIN32 -/* On windows, if you want to use UTF-8 ( instead of the UTF-16/wchar_t functions at the end of this file ) -Make sure your code is really prepared for UTF-8 (on windows, functions like fopen() expect MBCS and not UTF-8) */ -extern int tinyfd_winUtf8; /* on windows char strings can be 1:UTF-8(default) or 0:MBCS */ -/* for MBCS change this to 0, in tinyfiledialogs.c or in your code */ - -/* Here are some functions to help you convert between UTF-16 UTF-8 MBSC */ -char * tinyfd_utf8toMbcs(char const * aUtf8string); -char * tinyfd_utf16toMbcs(wchar_t const * aUtf16string); -wchar_t * tinyfd_mbcsTo16(char const * aMbcsString); -char * tinyfd_mbcsTo8(char const * aMbcsString); -wchar_t * tinyfd_utf8to16(char const * aUtf8string); -char * tinyfd_utf16to8(wchar_t const * aUtf16string); -#endif -/******************************************************************************************************/ -/******************************************************************************************************/ -/******************************************************************************************************/ - -/************* 3 funtions for C# (you don't need this in C or C++) : */ -char const * tinyfd_getGlobalChar(char const * aCharVariableName); /* returns NULL on error */ -int tinyfd_getGlobalInt(char const * aIntVariableName); /* returns -1 on error */ -int tinyfd_setGlobalInt(char const * aIntVariableName, int aValue); /* returns -1 on error */ -/* aCharVariableName: "tinyfd_version" "tinyfd_needs" "tinyfd_response" - aIntVariableName : "tinyfd_verbose" "tinyfd_silent" "tinyfd_allowCursesDialogs" - "tinyfd_forceConsole" "tinyfd_assumeGraphicDisplay" "tinyfd_winUtf8" -**************/ - - -extern char tinyfd_version[8]; /* contains tinyfd current version number */ -extern char tinyfd_needs[]; /* info about requirements */ -extern int tinyfd_verbose; /* 0 (default) or 1 : on unix, prints the command line calls */ -extern int tinyfd_silent; /* 1 (default) or 0 : on unix, hide errors and warnings from called dialogs */ - -/** Curses dialogs are difficult to use and counter-intuitive. -On windows they are only ascii and still uses the unix backslash ! **/ -extern int tinyfd_allowCursesDialogs; /* 0 (default) or 1 */ - -extern int tinyfd_forceConsole; /* 0 (default) or 1 */ -/* 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 an X server is present. - if enabled, it can use the package Dialog or dialog.exe. - on windows it only make sense for console applications */ - -extern int tinyfd_assumeGraphicDisplay; /* 0 (default) or 1 */ -/* some systems don't set the environment variable DISPLAY even when a graphic display is present. -set this to 1 to tell tinyfiledialogs to assume the existence of a graphic display */ - -extern char tinyfd_response[1024]; -/* if you pass "tinyfd_query" as aTitle, -the functions will not display the dialogs -but will return 0 for console mode, 1 for graphic mode. -tinyfd_response is then filled with the retain solution. -possible values for tinyfd_response are (all lowercase) -for graphic mode: - windows_wchar windows applescript kdialog zenity zenity3 yad matedialog - shellementary qarma python2-tkinter python3-tkinter python-dbus - perl-dbus gxmessage gmessage xmessage xdialog gdialog dunst -for console mode: - dialog whiptail basicinput no_solution */ - -void tinyfd_beep(void); - -int tinyfd_notifyPopup( - char const * aTitle, /* NULL or "" */ - char const * aMessage, /* NULL or "" may contain \n \t */ - char const * aIconType); /* "info" "warning" "error" */ - /* return has only meaning for tinyfd_query */ - -int tinyfd_messageBox( - char const * aTitle , /* NULL or "" */ - char const * aMessage , /* NULL or "" may contain \n \t */ - char const * aDialogType , /* "ok" "okcancel" "yesno" "yesnocancel" */ - char const * aIconType , /* "info" "warning" "error" "question" */ - int aDefaultButton ) ; - /* 0 for cancel/no , 1 for ok/yes , 2 for no in yesnocancel */ - -char * tinyfd_inputBox( - char const * aTitle , /* NULL or "" */ - char const * aMessage , /* NULL or "" (\n and \t have no effect) */ - char const * aDefaultInput ) ; /* NULL = passwordBox, "" = inputbox */ - /* returns NULL on cancel */ - -char * tinyfd_saveFileDialog( - char const * aTitle , /* NULL or "" */ - char const * aDefaultPathAndFile , /* NULL or "" */ - int aNumOfFilterPatterns , /* 0 (1 in the following example) */ - char const * const * aFilterPatterns , /* NULL or char const * lFilterPatterns[1]={"*.txt"} */ - char const * aSingleFilterDescription ) ; /* NULL or "text files" */ - /* returns NULL on cancel */ - -char * tinyfd_openFileDialog( - char const * aTitle, /* NULL or "" */ - char const * aDefaultPathAndFile, /* NULL or "" */ - int aNumOfFilterPatterns , /* 0 (2 in the following example) */ - char const * const * aFilterPatterns, /* NULL or char const * lFilterPatterns[2]={"*.png","*.jpg"}; */ - char const * aSingleFilterDescription, /* NULL or "image files" */ - int aAllowMultipleSelects ) ; /* 0 or 1 */ - /* in case of multiple files, the separator is | */ - /* returns NULL on cancel */ - -char * tinyfd_selectFolderDialog( - char const * aTitle, /* NULL or "" */ - char const * aDefaultPath); /* NULL or "" */ - /* returns NULL on cancel */ - -char * tinyfd_colorChooser( - char const * aTitle, /* NULL or "" */ - char const * aDefaultHexRGB, /* NULL or "" or "#FF0000" */ - unsigned char const aDefaultRGB[3] , /* unsigned char lDefaultRGB[3] = { 0 , 128 , 255 }; */ - unsigned char aoResultRGB[3] ) ; /* unsigned char lResultRGB[3]; */ - /* aDefaultRGB is used only if aDefaultHexRGB is absent */ - /* aDefaultRGB and aoResultRGB can be the same array */ - /* returns NULL on cancel */ - /* returns the hexcolor as a string "#FF0000" */ - /* aoResultRGB also contains the result */ - - -/************ WINDOWS ONLY SECTION ************************/ -#ifdef _WIN32 - -/* windows only - utf-16 version */ -int tinyfd_notifyPopupW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aMessage, /* NULL or L"" may contain \n \t */ - wchar_t const * aIconType); /* L"info" L"warning" L"error" */ - -/* windows only - utf-16 version */ -int tinyfd_messageBoxW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aMessage, /* NULL or L"" may contain \n \t */ - wchar_t const * aDialogType, /* L"ok" L"okcancel" L"yesno" */ - wchar_t const * aIconType, /* L"info" L"warning" L"error" L"question" */ - int aDefaultButton ); /* 0 for cancel/no , 1 for ok/yes */ - /* returns 0 for cancel/no , 1 for ok/yes */ - -/* windows only - utf-16 version */ -wchar_t * tinyfd_inputBoxW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aMessage, /* NULL or L"" (\n nor \t not respected) */ - wchar_t const * aDefaultInput); /* NULL passwordBox, L"" inputbox */ - -/* windows only - utf-16 version */ -wchar_t * tinyfd_saveFileDialogW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aDefaultPathAndFile, /* NULL or L"" */ - int aNumOfFilterPatterns, /* 0 (1 in the following example) */ - wchar_t const * const * aFilterPatterns, /* NULL or wchar_t const * lFilterPatterns[1]={L"*.txt"} */ - wchar_t const * aSingleFilterDescription); /* NULL or L"text files" */ - /* returns NULL on cancel */ - -/* windows only - utf-16 version */ -wchar_t * tinyfd_openFileDialogW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aDefaultPathAndFile, /* NULL or L"" */ - int aNumOfFilterPatterns , /* 0 (2 in the following example) */ - wchar_t const * const * aFilterPatterns, /* NULL or wchar_t const * lFilterPatterns[2]={L"*.png","*.jpg"} */ - wchar_t const * aSingleFilterDescription, /* NULL or L"image files" */ - int aAllowMultipleSelects ) ; /* 0 or 1 */ - /* in case of multiple files, the separator is | */ - /* returns NULL on cancel */ - -/* windows only - utf-16 version */ -wchar_t * tinyfd_selectFolderDialogW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aDefaultPath); /* NULL or L"" */ - /* returns NULL on cancel */ - -/* windows only - utf-16 version */ -wchar_t * tinyfd_colorChooserW( - wchar_t const * aTitle, /* NULL or L"" */ - wchar_t const * aDefaultHexRGB, /* NULL or L"#FF0000" */ - unsigned char const aDefaultRGB[3], /* unsigned char lDefaultRGB[3] = { 0 , 128 , 255 }; */ - unsigned char aoResultRGB[3]); /* unsigned char lResultRGB[3]; */ - /* returns the hexcolor as a string L"#FF0000" */ - /* aoResultRGB also contains the result */ - /* aDefaultRGB is used only if aDefaultHexRGB is NULL */ - /* aDefaultRGB and aoResultRGB can be the same array */ - /* returns NULL on cancel */ - -#endif /*_WIN32 */ - -#ifdef __cplusplus -} /*extern "C"*/ -#endif - -#endif /* TINYFILEDIALOGS_H */ - -/* - ________________________________________________________________________________ -| ____________________________________________________________________________ | -| | | | -| | on windows: | | -| | - for UTF-16, use the wchar_t functions at the bottom of the header file | | -| | - _wfopen() requires wchar_t | | -| | | | -| | - in tinyfiledialogs, char is UTF-8 by default (since v3.6) | | -| | - but fopen() expects MBCS (not UTF-8) | | -| | - if you want char to be MBCS: set tinyfd_winUtf8 to 0 | | -| | | | -| | - alternatively, tinyfiledialogs provides | | -| | functions to convert between UTF-8, UTF-16 and MBCS | | -| |____________________________________________________________________________| | -|________________________________________________________________________________| - -- This is not for ios nor android (it works in termux though). -- The files can be renamed with extension ".cpp" as the code is 100% compatible C C++ - (just comment out << extern "C" >> in the header file) -- Windows is fully supported from XP to 10 (maybe even older versions) -- C# & LUA via dll, see files in the folder EXTRAS -- OSX supported from 10.4 to latest (maybe even older versions) -- Do not use " and ' as the dialogs will be displayed with a warning - instead of the title, message, etc... -- There's one file filter only, it may contain several patterns. -- If no filter description is provided, - the list of patterns will become the description. -- On windows link against Comdlg32.lib and Ole32.lib - (on windows the no linking claim is a lie) -- On unix: it tries command line calls, so no such need (NO LINKING). -- On unix you need one of the following: - applescript, kdialog, zenity, matedialog, shellementary, qarma, yad, - python (2 or 3)/tkinter/python-dbus (optional), Xdialog - or curses dialogs (opens terminal if running without console). -- One of those is already included on most (if not all) desktops. -- In the absence of those it will use gdialog, gxmessage or whiptail - with a textinputbox. If nothing is found, it switches to basic console input, - it opens a console if needed (requires xterm + bash). -- for curses dialogs you must set tinyfd_allowCursesDialogs=1 -- You can query the type of dialog that will be used (pass "tinyfd_query" as aTitle) -- String memory is preallocated statically for all the returned values. -- File and path names are tested before return, they should be valid. -- tinyfd_forceConsole=1; at run time, forces dialogs into console mode. -- On windows, console mode only make sense for console applications. -- On windows, console mode is not implemented for wchar_T UTF-16. -- Mutiple selects are not possible in console mode. -- The package dialog must be installed to run in curses dialogs in console mode. - It is already installed on most unix systems. -- On osx, the package dialog can be installed via - http://macappstore.org/dialog or http://macports.org -- On windows, for curses dialogs console mode, - dialog.exe should be copied somewhere on your executable path. - It can be found at the bottom of the following page: - http://andrear.altervista.org/home/cdialog.php -*/